fix(用例管理): 用例管理多个需求时,高级搜索不包含条件搜索结果有误
--bug=1046945 --user=陈建星 【高级搜索】用例列表筛选,用例关联多个需求时,条件:关联需求 不包含/不等于 关键字 查询到的结果错误 https://www.tapd.cn/55049933/s/1583718
This commit is contained in:
parent
9bc12b7b7f
commit
30c12a8796
|
@ -185,18 +185,26 @@
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
(
|
(
|
||||||
|
${mainIdColumn}
|
||||||
<if test="${condition}.operator == 'NOT_IN' or ${condition}.operator == 'NOT_EQUALS' or ${condition}.operator == 'NOT_CONTAINS'">
|
<if test="${condition}.operator == 'NOT_IN' or ${condition}.operator == 'NOT_EQUALS' or ${condition}.operator == 'NOT_CONTAINS'">
|
||||||
${mainIdColumn} not in (
|
not
|
||||||
select ${associationIdColumn} from ${associationTable} where
|
|
||||||
${searchColumn} is not null and ${searchColumn} != ''
|
|
||||||
) or
|
|
||||||
</if>
|
</if>
|
||||||
${mainIdColumn} in (
|
in (
|
||||||
select ${associationIdColumn} from ${associationTable} where
|
select ${associationIdColumn} from ${associationTable} where
|
||||||
|
<choose>
|
||||||
|
<when test="${condition}.operator == 'NOT_IN' or ${condition}.operator == 'NOT_EQUALS' or ${condition}.operator == 'NOT_CONTAINS'">
|
||||||
|
<include refid="io.metersphere.system.mapper.BaseMapper.associationReversalCondition">
|
||||||
|
<property name="condition" value="${condition}"/>
|
||||||
|
<property name="column" value="${searchColumn}"/>
|
||||||
|
</include>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
|
||||||
<property name="condition" value="${condition}"/>
|
<property name="condition" value="${condition}"/>
|
||||||
<property name="column" value="${searchColumn}"/>
|
<property name="column" value="${searchColumn}"/>
|
||||||
</include>
|
</include>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
</otherwise>
|
</otherwise>
|
||||||
|
@ -274,6 +282,33 @@
|
||||||
</trim>
|
</trim>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<sql id="associationReversalCondition">
|
||||||
|
<trim prefix="(" suffix=")">
|
||||||
|
<choose>
|
||||||
|
<when test="${condition}.operator == 'NOT_CONTAINS'">
|
||||||
|
<foreach collection="${condition}.value.split(' ')" item="item" separator="and">
|
||||||
|
${column} like CONCAT('%', #{item},'%')
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<when test="${condition}.operator == 'NOT_IN'">
|
||||||
|
<if test="'${column}' == 'value'">
|
||||||
|
`value`
|
||||||
|
</if>
|
||||||
|
<if test="'${column}' != 'value'">
|
||||||
|
${column}
|
||||||
|
</if>
|
||||||
|
in
|
||||||
|
<foreach collection="${condition}.value" item="v" separator="," open="(" close=")">
|
||||||
|
#{v}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<when test=" ${condition}.operator == 'NOT_EQUALS'">
|
||||||
|
${column} = #{condition.value}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</trim>
|
||||||
|
</sql>
|
||||||
|
|
||||||
<sql id="queryType">
|
<sql id="queryType">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="${searchMode} == 'AND'">
|
<when test="${searchMode} == 'AND'">
|
||||||
|
|
Loading…
Reference in New Issue