fix(测试跟踪): 当测试用例状态为空时,测试计划报告数据统计有误

This commit is contained in:
chenjianxing 2023-02-16 14:56:49 +08:00 committed by jianxing
parent 01ccfde3e6
commit 1a247ef130
1 changed files with 7 additions and 8 deletions

View File

@ -233,7 +233,7 @@
<include refid="queryVersionCondition">
<property name="versionTable" value="test_case"/>
</include>
and test_case.status != 'Trash'
and test_plan_test_case.is_del = 0
<include refid="filter"/>
</where>
</sql>
@ -434,8 +434,7 @@
<select id="getExecResultByPlanId" resultType="java.lang.String">
select status
from test_plan_test_case
where plan_id = #{planId}
AND case_id in (SELECT id FROM test_case WHERE (`status` is null or `status` != 'Trash'))
where plan_id = #{planId} and test_plan_test_case.is_del = 0
</select>
<select id="listByPlanId" resultType="io.metersphere.dto.TestPlanCaseDTO">
SELECT test_plan_api_case.id as reportId,test_plan_api_case.api_case_id as id,"definition" as
@ -445,7 +444,7 @@
api_definition a
on
api_test_case.api_definition_id = a.id
and a.status != 'Trash'
and (a.status != 'Trash' or a.status is null)
<where>
<if test="request.planId != null">
and test_plan_api_case.test_plan_id = #{request.planId}
@ -459,7 +458,7 @@
api_scenario
on
test_plan_api_scenario.api_scenario_id=api_scenario.id
and api_scenario.status != 'Trash'
and (api_scenario.status != 'Trash' or api_scenario.status is null)
<where>
<if test="request.planId != null">
and test_plan_api_scenario.test_plan_id = #{request.planId}
@ -505,7 +504,7 @@
<where>
pc.plan_id = #{request.planId}
and t.node_id = #{request.nodeId}
and (t.status != 'Trash' or t.status is null)
and pc.is_del = 0
</where>
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select>
@ -524,7 +523,7 @@
select tptc.id, tptc.status
from test_plan_test_case tptc
inner join test_case tc
on tc.id = tptc.case_id and tc.status != 'Trash'
on tc.id = tptc.case_id and tptc.is_del = 0
where tptc.plan_id = #{planId};
</select>
<select id="getCasesByStatusList" resultType="io.metersphere.dto.TestPlanCaseDTO">
@ -543,7 +542,7 @@
#{status}
</foreach>
</if>
and (tc.status != 'Trash' or tc.status is null)
and tptc.is_del = 0
order by tptc.`order` desc
</select>
<update id="updateTestCaseStates" parameterType="java.lang.String">