feat(功能用例): 高级搜索输入框关键字支持按空格分隔

--task=1016128 --user=陈建星 高级搜索-视图增删改查-后端 https://www.tapd.cn/55049933/s/1573254
This commit is contained in:
AgAngle 2024-09-10 15:27:08 +08:00 committed by jianxing
parent 6e10709fdb
commit ad7ed4a392
1 changed files with 6 additions and 2 deletions

View File

@ -127,10 +127,14 @@
<trim prefix="(" suffix=")">
<choose>
<when test="${condition}.operator == 'CONTAINS'">
${column} like CONCAT('%', #{condition.value},'%')
<foreach collection="${condition}.value.split(' ')" item="item" separator="or">
${column} like CONCAT('%', #{item},'%')
</foreach>
</when>
<when test="${condition}.operator == 'NOT_CONTAINS'">
${column} not like CONCAT('%', #{condition.value},'%')
<foreach collection="${condition}.value.split(' ')" item="item" separator="and">
${column} not like CONCAT('%', #{item},'%')
</foreach>
</when>
<when test="${condition}.operator == 'IN'">
<if test="'${column}' == 'value'">