refactor(缺陷管理): 缺陷详情关联用例支持高级搜索

This commit is contained in:
guoyuqi 2024-12-02 18:16:05 +08:00 committed by 刘瑞斌
parent a56a3b1582
commit 9dad00730c
5 changed files with 52 additions and 50 deletions

View File

@ -75,6 +75,7 @@ public interface ExtApiScenarioMapper {
* @param sort 排序
* @return 通用的列表Case集合
*/
@BaseConditionFilter
List<TestCaseProviderDTO> listUnRelatedCaseWithBug(@Param("request") TestCasePageProviderRequest request, @Param("deleted") boolean deleted, @Param("sort") String sort);
/**

View File

@ -576,32 +576,32 @@
<select id="listUnRelatedCaseWithBug" resultMap="TestCaseProviderDTO">
select
ao.id,
ao.num,
ao.name,
ao.priority,
ao.project_id,
ao.tags,
api_scenario.id,
api_scenario.num,
api_scenario.name,
api_scenario.priority,
api_scenario.project_id,
api_scenario.tags,
pv.name as versionName,
ao.create_user,
api_scenario.create_user,
u.name as createUserName,
ao.create_time
from api_scenario ao
left join project_version pv ON ao.version_id = pv.id
left join user u ON ao.create_user = u.id
where ao.deleted = #{deleted}
and ao.project_id = #{request.projectId}
and ao.id not in
api_scenario.create_time
from api_scenario
left join project_version pv ON api_scenario.version_id = pv.id
left join user u ON api_scenario.create_user = u.id
where api_scenario.deleted = #{deleted}
and api_scenario.project_id = #{request.projectId}
and api_scenario.id not in
(
select brc.case_id from bug_relation_case brc where brc.bug_id = #{request.sourceId} and brc.case_type = #{request.sourceType}
)
<include refid="queryByTestCaseProviderParam"/>
<include refid="queryWhereConditionByProvider"/>
order by
<if test="sort != null and sort != ''">
ao.${sort}
api_scenario.${sort}
</if>
<if test="sort == null or sort == ''">
ao.create_time desc
api_scenario.create_time desc
</if>
</select>

View File

@ -90,6 +90,7 @@ public interface ExtApiTestCaseMapper {
* @param sort 排序
* @return 通用的列表Case集合
*/
@BaseConditionFilter
List<TestCaseProviderDTO> listUnRelatedCaseWithBug(@Param("request") TestCasePageProviderRequest request, @Param("deleted") boolean deleted, @Param("sort") String sort);
/**

View File

@ -366,33 +366,33 @@
<select id="listUnRelatedCaseWithBug" resultMap="TestCaseProviderDTO">
select
ac.id,
ac.num,
ac.name,
ac.priority,
ac.project_id,
ac.tags,
atc.id,
atc.num,
atc.name,
atc.priority,
atc.project_id,
atc.tags,
pv.name as versionName,
ac.create_user,
atc.create_user,
u.name as createUserName,
ac.create_time
from api_test_case ac
inner join api_definition ad on ac.api_definition_id = ad.id
left join project_version pv ON ac.version_id = pv.id
left join user u ON ac.create_user = u.id
where ac.deleted = #{deleted}
and ac.project_id = #{request.projectId}
and ac.id not in
atc.create_time
from api_test_case atc
inner join api_definition a on atc.api_definition_id = a.id
left join project_version pv ON atc.version_id = pv.id
left join user u ON atc.create_user = u.id
where atc.deleted = #{deleted}
and atc.project_id = #{request.projectId}
and atc.id not in
(
select brc.case_id from bug_relation_case brc where brc.bug_id = #{request.sourceId} and brc.case_type = #{request.sourceType}
)
<include refid="queryByTestCaseProviderParam"/>
<include refid="queryWhereCondition"/>
order by
<if test="sort != null and sort != ''">
ac.${sort}
atc.${sort}
</if>
<if test="sort == null or sort == ''">
ac.create_time desc
atc.create_time desc
</if>
</select>

View File

@ -600,30 +600,30 @@
<select id="listUnRelatedCaseWithBug" resultMap="TestCaseProviderDTO">
select
fc.id,
fc.num,
fc.name,
fc.project_id,
fc.tags,
functional_case.id,
functional_case.num,
functional_case.name,
functional_case.project_id,
functional_case.tags,
pv.name as versionName,
fc.create_user,
functional_case.create_user,
u.name as createUserName,
fc.create_time
from functional_case fc left join project_version pv ON fc.version_id = pv.id
left join user u ON fc.create_user = u.id
where fc.deleted = #{deleted}
and fc.project_id = #{request.projectId}
and fc.id not in
functional_case.create_time
from functional_case left join project_version pv ON functional_case.version_id = pv.id
left join user u ON functional_case.create_user = u.id
where functional_case.deleted = #{deleted}
and functional_case.project_id = #{request.projectId}
and functional_case.id not in
(
select brc.case_id from bug_relation_case brc where brc.bug_id = #{request.sourceId} and brc.case_type = #{request.sourceType}
)
<include refid="queryByTestCaseProviderParam"/>
<include refid="queryWhereCondition"/>
order by
<if test="sort != null and sort != ''">
fc.${sort}
functional_case.${sort}
</if>
<if test="sort == null or sort == ''">
fc.create_time desc
functional_case.create_time desc
</if>
</select>