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