feat(测试计划): 报告用例详情测试点展示支持过滤

This commit is contained in:
song-cc-rock 2024-09-12 10:52:49 +08:00 committed by Craftsman
parent c0400c483d
commit d9847330b1
3 changed files with 33 additions and 3 deletions

View File

@ -51,9 +51,14 @@
<select id="listCollection" resultType="io.metersphere.plan.dto.response.TestPlanReportDetailCollectionResponse"> <select id="listCollection" resultType="io.metersphere.plan.dto.response.TestPlanReportDetailCollectionResponse">
select tpc.id as id, tpc.name as name, tp.name as planName, count(tprac.id) as count select tpc.id as id, tpc.name as name, tp.name as planName, count(tprac.id) as count
from test_plan_report_api_case tprac from test_plan_report_api_case tprac
join test_plan_collection tpc on tprac.test_plan_collection_id = tpc.id and tpc.type = 'API' right join test_plan_collection tpc on tprac.test_plan_collection_id = tpc.id and tpc.type = 'API'
join test_plan tp on tpc.test_plan_id = tp.id join test_plan tp on tpc.test_plan_id = tp.id
where tprac.test_plan_report_id = #{request.reportId} where tprac.test_plan_report_id = #{request.reportId}
<if test="request.keyword != null and request.keyword != ''">
and (tprac.api_case_name like concat('%', #{request.keyword}, '%')
or tprac.api_case_num like concat('%', #{request.keyword}, '%'))
</if>
<include refid="filter"/>
group by tprac.test_plan_collection_id group by tprac.test_plan_collection_id
</select> </select>
@ -87,6 +92,11 @@
and tprac.api_case_priority in and tprac.api_case_priority in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/> <include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when> </when>
<!-- 计划名称 -->
<when test="key == 'planName'">
and tp.name in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose> </choose>
</if> </if>
</foreach> </foreach>

View File

@ -50,9 +50,14 @@
<select id="listCollection" resultType="io.metersphere.plan.dto.response.TestPlanReportDetailCollectionResponse"> <select id="listCollection" resultType="io.metersphere.plan.dto.response.TestPlanReportDetailCollectionResponse">
select tpc.id as id, tpc.name as name, tp.name as planName, count(tpras.id) as count select tpc.id as id, tpc.name as name, tp.name as planName, count(tpras.id) as count
from test_plan_report_api_scenario tpras from test_plan_report_api_scenario tpras
join test_plan_collection tpc on tpras.test_plan_collection_id = tpc.id and tpc.type = 'SCENARIO' right join test_plan_collection tpc on tpras.test_plan_collection_id = tpc.id and tpc.type = 'SCENARIO'
join test_plan tp on tpc.test_plan_id = tp.id join test_plan tp on tpc.test_plan_id = tp.id
where tpras.test_plan_report_id = #{request.reportId} where tpras.test_plan_report_id = #{request.reportId}
<if test="request.keyword != null and request.keyword != ''">
and (tpras.api_scenario_name like concat('%', #{request.keyword}, '%')
or tpras.api_scenario_num like concat('%', #{request.keyword}, '%'))
</if>
<include refid="filter"/>
group by tpras.test_plan_collection_id group by tpras.test_plan_collection_id
</select> </select>
@ -80,6 +85,11 @@
and tpras.api_scenario_priority in and tpras.api_scenario_priority in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/> <include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when> </when>
<!-- 计划名称 -->
<when test="key == 'planName'">
and tp.name in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose> </choose>
</if> </if>
</foreach> </foreach>

View File

@ -71,9 +71,14 @@
<select id="listCollection" resultType="io.metersphere.plan.dto.response.TestPlanReportDetailCollectionResponse"> <select id="listCollection" resultType="io.metersphere.plan.dto.response.TestPlanReportDetailCollectionResponse">
select tpc.id as id, tpc.name as name, tp.name as planName, count(tprfc.id) as count select tpc.id as id, tpc.name as name, tp.name as planName, count(tprfc.id) as count
from test_plan_report_function_case tprfc from test_plan_report_function_case tprfc
join test_plan_collection tpc on tprfc.test_plan_collection_id = tpc.id and tpc.type = 'FUNCTIONAL' right join test_plan_collection tpc on tprfc.test_plan_collection_id = tpc.id and tpc.type = 'FUNCTIONAL'
join test_plan tp on tpc.test_plan_id = tp.id join test_plan tp on tpc.test_plan_id = tp.id
where tprfc.test_plan_report_id = #{request.reportId} where tprfc.test_plan_report_id = #{request.reportId}
<if test="request.keyword != null and request.keyword != ''">
and (tprfc.function_case_num like concat('%', #{request.keyword}, '%')
or tprfc.function_case_name like concat('%', #{request.keyword}, '%'))
</if>
<include refid="filter"/>
group by tprfc.test_plan_collection_id group by tprfc.test_plan_collection_id
</select> </select>
@ -101,6 +106,11 @@
and tprfc.function_case_priority in and tprfc.function_case_priority in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/> <include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when> </when>
<!-- 计划名称 -->
<when test="key == 'planName'">
and tp.name in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose> </choose>
</if> </if>
</foreach> </foreach>