mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-11-29 18:48:13 +08:00
fix(测试计划): 修复测试计划列表高级搜索问题
--bug=1048906 --user=王旭 【测试计划】-筛选-使用计划名称与其他条件组合筛选,筛选结果错误 https://www.tapd.cn/55049933/s/1611266
This commit is contained in:
parent
9bedceefe2
commit
eeda5334ce
@ -29,6 +29,7 @@ public class TestPlanTableRequest extends BasePageRequest {
|
||||
@Schema(description = "通过其他条件查询出来的,必须要包含的测试计划ID")
|
||||
private List<String> innerIds;
|
||||
private List<String> combineInnerIds;
|
||||
private String combineOperator;
|
||||
|
||||
@Schema(description = "是否我的待办, 默认查询全部")
|
||||
private boolean myTodo = false;
|
||||
|
@ -137,7 +137,13 @@
|
||||
</when>
|
||||
</choose>-->
|
||||
<if test="request.combineInnerIds != null and request.combineInnerIds.size() > 0">
|
||||
and t.id in
|
||||
and t.id
|
||||
<if test="request.combineOperator != 'NOT_IN'">
|
||||
in
|
||||
</if>
|
||||
<if test="request.combineOperator == 'NOT_IN'">
|
||||
not in
|
||||
</if>
|
||||
<foreach collection="request.combineInnerIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@ -214,10 +220,12 @@
|
||||
</include>
|
||||
</if>
|
||||
<if test="condition.name == 'name'">
|
||||
<trim prefix="(" suffix=")">
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
||||
<property name="condition" value="condition"/>
|
||||
<property name="column" value="t.name"/>
|
||||
</include>
|
||||
<if test="request.type != 'TEST_PLAN'" >
|
||||
<if test="condition.operator == 'CONTAINS' or condition.operator == 'EQUALS'">
|
||||
or t.id in
|
||||
(
|
||||
@ -232,7 +240,10 @@
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
</trim>
|
||||
</if>
|
||||
<if test="condition.name == 'num'">
|
||||
<trim prefix="(" suffix=")">
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
||||
<property name="condition" value="condition"/>
|
||||
<property name="column" value="t.num"/>
|
||||
@ -252,6 +263,7 @@
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
</trim>
|
||||
</if>
|
||||
<if test="condition.name == 'createUser'">
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
||||
@ -278,10 +290,12 @@
|
||||
</include>
|
||||
</if>
|
||||
<if test="condition.name == 'tags'">
|
||||
<trim prefix="(" suffix=")">
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.arrayValueCondition">
|
||||
<property name="condition" value="condition"/>
|
||||
<property name="column" value="t.tags"/>
|
||||
</include>
|
||||
<if test="request.type != 'TEST_PLAN'" >
|
||||
<if test="condition.operator == 'CONTAINS'">
|
||||
or t.id in
|
||||
(
|
||||
@ -296,13 +310,15 @@
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
</trim>
|
||||
</if>
|
||||
|
||||
<!-- 状态 -->
|
||||
<if test="condition.name == 'status'">
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
||||
<property name="condition" value="condition"/>
|
||||
<property name="column" value="t.status"/>
|
||||
</include>
|
||||
status in
|
||||
<foreach collection="condition.value" item="v" separator="," open="(" close=")">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.queryType">
|
||||
<property name="searchMode" value="${combineSearch}.searchMode"/>
|
||||
@ -976,6 +992,7 @@
|
||||
<property name="condition" value="condition"/>
|
||||
<property name="column" value="t.name"/>
|
||||
</include>
|
||||
<if test="request.type != 'TEST_PLAN'" >
|
||||
<if test="condition.operator == 'CONTAINS' or condition.operator == 'EQUALS'">
|
||||
or t.id in
|
||||
(
|
||||
@ -990,6 +1007,7 @@
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
</if>
|
||||
<if test="condition.name == 'num'">
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
||||
<property name="condition" value="condition"/>
|
||||
@ -1040,6 +1058,7 @@
|
||||
<property name="condition" value="condition"/>
|
||||
<property name="column" value="t.tags"/>
|
||||
</include>
|
||||
<if test="request.type != 'TEST_PLAN'" >
|
||||
<if test="condition.operator == 'CONTAINS'">
|
||||
or t.id in
|
||||
(
|
||||
@ -1054,6 +1073,7 @@
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
</if>
|
||||
<!-- 状态 -->
|
||||
<if test="condition.name == 'status'">
|
||||
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
||||
|
@ -202,6 +202,7 @@ public class TestPlanManagementService {
|
||||
//目前未归档的测试计划只有3中类型。所以这里判断如果是3个的话等于直接查询未归档
|
||||
if (statusList.size() < 3) {
|
||||
request.setCombineInnerIds(this.selectTestPlanIdByProjectIdAndStatus(request.getProjectId(), statusList));
|
||||
request.setCombineOperator(item.getOperator());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user