Commit 88d8c95c authored by wdy's avatar wdy

待办任务车型测试子任务进度

parent 07ec99a8
......@@ -2,6 +2,9 @@ package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.ModelTestTask;
import com.ruoyi.web.response.ResultCountResponse;
import com.ruoyi.web.response.TaskFindResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -15,4 +18,10 @@ public interface ModelTestTaskMapper extends BaseMapper<ModelTestTask> {
// 查询pending状态下的所有任务
List<ModelTestTask> findByStatus();
// 根据总任务列表查询子任务
List<ModelTestTask> findByTaskList(@Param("responses") List<TaskFindResponse> responses);
// 根据子任务列表查询进度
List<ResultCountResponse> testAnswerCount(@Param("responses")List<TaskFindResponse> responses);
}
......@@ -31,6 +31,34 @@
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,test_case,create_time,leader_id,leader,standard_id,name,standard_no,submit_id,submit_name,images_url,details,standards,test_scheme_id
FROM t_model_test_task WHERE task_status = 'PENDING'
</select>
<select id="findByTaskList" resultType="com.ruoyi.domain.ModelTestTask">
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,test_case,create_time,leader_id,leader,standard_id,name,standard_no,submit_id,submit_name,images_url,details,standards,test_scheme_id
FROM t_model_test_task
WHERE id IN
<foreach collection="responses" item="task" open="(" separator="," close=")">
#{task.modelTestTaskId}
</foreach>
</select>
<select id="testAnswerCount" resultType="com.ruoyi.web.response.ResultCountResponse">
<foreach item="task" collection="responses" separator="UNION ALL">
SELECT
#{task.modelTestTaskId} AS taskId,
(IFNULL(
(SELECT COUNT(*) FROM t_test_records WHERE task_id = #{task.modelTestTaskId}),
0
) /
IFNULL(
(SELECT COUNT(*) FROM t_task_scenario_relation tsr
INNER JOIN t_test_scenario tts ON tts.id = tsr.test_scenario_id
INNER JOIN t_test_usecase ttu ON tts.id = ttu.test_scenario_id
WHERE tsr.task_id = #{task.id}),
1
)) * 90 AS schedule,
tm.task_status AS taskStatus
from t_model_test_task tm where tm.id = #{task.modelTestTaskId}
</foreach>
group by taskId
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment