收藏+订阅-搜索%修改

This commit is contained in:
xiejunyu
2022-03-18 13:46:47 +08:00
parent 065ffeb83c
commit 109c2db9a2
2 changed files with 44 additions and 8 deletions
@@ -24,12 +24,30 @@
onl_cgform_collection occ
left join buss_document_library bdl on occ.document_id = bdl.id
where occ.create_by = #{params.createBy}
<if test="params.serialNumber != null and params.serialNumber != '' ">
and bdl.serial_number like concat(concat('%',#{params.serialNumber}),'%')
<if test="params.serialNumber != null and params.serialNumber != ''">
<!--搜索条件:编号;包含%,单独搜索-->
<choose>
<when test='params.serialNumber != null and params.serialNumber != "" and params.serialNumber.contains("%")'>
and bdl.serial_number like '%1%%' escape '1'
</when>
<otherwise>
and bdl.serial_number like concat(concat('%',#{params.serialNumber}),'%')
</otherwise>
</choose>
</if>
<if test="params.title != null and params.title != '' ">
and bdl.title like concat(concat('%',#{params.title}),'%')
<if test="params.title != null and params.title != ''">
<!--搜索条件:标题;包含%,单独搜索-->
<choose>
<when test='params.title != null and params.title != "" and params.title.contains("%")'>
and bdl.title like '%1%%' escape '1'
</when>
<otherwise>
and bdl.title like concat(concat('%',#{params.title}),'%')
</otherwise>
</choose>
</if>
<if test="params.state != null and params.state != '' ">
and bdl.state in
<foreach collection="params.state.split(',')" index="index" item="item" open="(" separator="," close=")">
@@ -25,12 +25,30 @@
left join
buss_document_library bdl on ocs.document_id = bdl.id
where ocs.create_by = #{params.createBy}
<if test="params.serialNumber != null and params.serialNumber != '' ">
and bdl.serial_number like concat(concat('%',#{params.serialNumber}),'%')
<if test="params.serialNumber != null and params.serialNumber != ''">
<!--搜索条件:编号;包含%,单独搜索-->
<choose>
<when test='params.serialNumber != null and params.serialNumber != "" and params.serialNumber.contains("%")'>
and bdl.serial_number like '%1%%' escape '1'
</when>
<otherwise>
and bdl.serial_number like concat(concat('%',#{params.serialNumber}),'%')
</otherwise>
</choose>
</if>
<if test="params.title != null and params.title != '' ">
and bdl.title like concat(concat('%',#{params.title}),'%')
<if test="params.title != null and params.title != ''">
<!--搜索条件:标题;包含%,单独搜索-->
<choose>
<when test='params.title != null and params.title != "" and params.title.contains("%")'>
and bdl.title like '%1%%' escape '1'
</when>
<otherwise>
and bdl.title like concat(concat('%',#{params.title}),'%')
</otherwise>
</choose>
</if>
<if test="params.state != null and params.state != '' ">
and bdl.state in
<foreach collection="params.state.split(',')" index="index" item="item" open="(" separator="," close=")">