特殊字符限制搜索

This commit is contained in:
mashuai 2024-11-19 16:39:35 +08:00
parent b2fc2c33c6
commit c30aedd5de
13 changed files with 34 additions and 34 deletions

View File

@ -267,16 +267,16 @@
where
b.audit_status = 1
<if test="proName != null and proName != ''">
and b.pro_name like concat('%',#{proName},'%') ESCAPE '/'
and b.pro_name like concat('%',#{proName},'%')
</if>
<if test="departName != null and departName != ''">
and b.depart_name like concat('%',#{departName},'%') ESCAPE '/'
and b.depart_name like concat('%',#{departName},'%')
</if>
<if test="devName != null and devName != ''">
and a.dev_name like concat('%',#{devName},'%') ESCAPE '/'
and a.dev_name like concat('%',#{devName},'%')
</if>
<if test="devCode != null and devCode != ''">
and a.dev_code like concat('%',#{devCode},'%') ESCAPE '/'
and a.dev_code like concat('%',#{devCode},'%')
</if>
</select>

View File

@ -38,13 +38,13 @@
left join tb_bd_device_record tbd on tbd.record_id = tbr.id
where del_flag = 0
<if test="departName != null and departName != ''">
and tbr.depart_name like concat('%',#{departName},'%') ESCAPE '/'
and tbr.depart_name like concat('%',#{departName},'%')
</if>
<if test="proName != null and proName != ''">
and tbr.pro_name like concat('%',#{proName},'%') ESCAPE '/'
and tbr.pro_name like concat('%',#{proName},'%')
</if>
<if test="relUser != null and relUser != ''">
and tbr.rel_user like concat('%',#{relUser},'%') ESCAPE '/'
and tbr.rel_user like concat('%',#{relUser},'%')
</if>
<if test="applyTime != null and applyTime != ''">
and DATE_FORMAT(tbr.create_time, '%Y-%m-%d') = #{applyTime}

View File

@ -48,7 +48,7 @@
WHERE
tddr.is_warn = '1'
<if test="devName != null and devName != ''">
and tddr.dev_name like concat('%',#{devName},'%') ESCAPE '/'
and tddr.dev_name like concat('%',#{devName},'%')
</if>
<if test="devType != null and devType != ''">
and tddr.dev_type = #{devType}

View File

@ -286,10 +286,10 @@
and td.dev_type = #{devType}
</if>
<if test="devName != null and devName != ''">
and td.dev_name like concat('%',#{devName},'%') ESCAPE '/'
and td.dev_name like concat('%',#{devName},'%')
</if>
<if test="devCode != null and devCode != ''">
and td.dev_code like concat('%',#{devCode},'%') ESCAPE '/'
and td.dev_code like concat('%',#{devCode},'%')
</if>
<if test="devStatus != null">
and td.dev_status = #{devStatus}
@ -343,10 +343,10 @@
and td.dev_type = #{devTypeCode}
</if>
<if test="devName != null and devName != ''">
and td.dev_name like concat('%',#{devName},'%') ESCAPE '/'
and td.dev_name like concat('%',#{devName},'%')
</if>
<if test="devCode != null and devCode != ''">
and td.dev_code like concat('%',#{devCode},'%') ESCAPE '/'
and td.dev_code like concat('%',#{devCode},'%')
</if>
</select>
@ -374,10 +374,10 @@
left join tb_bd_record tbr on tbdr.record_id = tbr.id and tbr.del_flag = 0
where tbr.audit_status = 1 and tp.del_flag = 0
<if test="devName != null and devName != ''">
and tbdr.dev_name like concat('%',#{devName},'%') ESCAPE '/'
and tbdr.dev_name like concat('%',#{devName},'%')
</if>
<if test="devCode != null and devCode != ''">
and tbdr.dev_code like concat('%',#{devCode},'%') ESCAPE '/'
and tbdr.dev_code like concat('%',#{devCode},'%')
</if>
<if test="devStatus != null ">
and tbdr.dev_status = #{devStatus}

View File

@ -20,7 +20,7 @@
and tp.team_id = #{id}
</if>
<if test="relName != null and relName != ''">
and tp.rel_name like concat('%',#{relName},'%') ESCAPE '/'
and tp.rel_name like concat('%',#{relName},'%')
</if>
<if test="sex != null">
and tp.sex = #{sex}

View File

@ -26,10 +26,10 @@
and tpd.area_id = #{areaId}
</if>
<if test="departName != null and departName != ''">
and tpd.depart_name like concat('%',#{departName},'%') ESCAPE '/'
and tpd.depart_name like concat('%',#{departName},'%')
</if>
<if test="headUser != null and headUser != ''">
and tpd.head_user like concat('%',#{headUser},'%') ESCAPE '/'
and tpd.head_user like concat('%',#{headUser},'%')
</if>
ORDER BY tpd.create_time DESC
</select>

View File

@ -11,7 +11,7 @@
and tb.pro_id = #{id}
</if>
<if test="gtName != null and gtName != ''">
and tb.gt_name like concat('%',#{gtName},'%') ESCAPE '/'
and tb.gt_name like concat('%',#{gtName},'%')
</if>
</select>

View File

@ -31,7 +31,7 @@
and tb.id = #{id}
</if>
<if test="proName != null and proName != ''">
and tb.pro_name like concat('%',#{proName},'%') ESCAPE '/'
and tb.pro_name like concat('%',#{proName},'%')
</if>
<if test="relId != null and relId != '' ">
and tb.rel_id = #{relId}
@ -43,7 +43,7 @@
and tb.pro_type = #{proType}
</if>
<if test="departName != null and departName != ''">
and tpd.depart_name like concat('%',#{departName},'%') ESCAPE '/'
and tpd.depart_name like concat('%',#{departName},'%')
</if>
<if test="departId != null">
and tb.depart_id = #{departId}

View File

@ -25,19 +25,19 @@
and id = #{id}
</if>
<if test="teamName != null and teamName != ''">
and tt.team_name like concat('%',#{teamName},'%') ESCAPE '/'
and tt.team_name like concat('%',#{teamName},'%')
</if>
<if test="relName != null and relName != ''">
and tt.rel_name like concat('%',#{relName},'%') ESCAPE '/'
and tt.rel_name like concat('%',#{relName},'%')
</if>
<if test="keyWord != null and keyWord != ''">
and (
tt.team_name LIKE CONCAT('%', #{keyWord}, '%') ESCAPE '/'
OR tt.rel_name LIKE CONCAT('%', #{keyWord}, '%') ESCAPE '/'
OR tt.pro_name LIKE CONCAT('%', #{keyWord}, '%') ESCAPE '/'
tt.team_name LIKE CONCAT('%', #{keyWord}, '%')
OR tt.rel_name LIKE CONCAT('%', #{keyWord}, '%')
OR tt.pro_name LIKE CONCAT('%', #{keyWord}, '%')
OR
CASE WHEN tt.js_time IS NULL THEN '正常' ELSE '已解散' END
LIKE CONCAT('%', #{keyWord}, '%') ESCAPE '/'
LIKE CONCAT('%', #{keyWord}, '%')
)
</if>
GROUP BY tt.id

View File

@ -14,10 +14,10 @@
and create_time = #{createTime}
</if>
<if test="postName != null and postName != ''">
and post_name like concat('%',#{postName},'%') ESCAPE '/'
and post_name like concat('%',#{postName},'%')
</if>
<if test="relName != null and relName != ''">
and rel_name like concat('%',#{relName},'%') ESCAPE '/'
and rel_name like concat('%',#{relName},'%')
</if>
</where>
</select>

View File

@ -410,7 +410,7 @@
and twc.configu_type = #{configuType}
</if>
<if test="configName != null and configName != ''">
and twc.config_name like concat('%',#{configName},'%') ESCAPE '/'
and twc.config_name like concat('%',#{configName},'%')
</if>
<if test="devId != null">
and td.id = #{devId}

View File

@ -41,7 +41,7 @@
and td.dev_type = #{devTypeCode}
</if>
<if test="proName != null and proName != ''">
and tp.pro_name like concat('%',#{proName},'%') ESCAPE '/'
and tp.pro_name like concat('%',#{proName},'%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE(tddr.create_time) BETWEEN #{startTime} AND #{endTime} ]]>
@ -127,7 +127,7 @@
where
tp.del_flag = 0
<if test="proName != null and proName != ''">
and tp.pro_name like concat('%',#{proName},'%') ESCAPE '/'
and tp.pro_name like concat('%',#{proName},'%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE(twp.create_time) BETWEEN #{startTime} AND #{endTime} ]]>

View File

@ -36,10 +36,10 @@
AND tt.pro_id = #{proId}
</if>
<if test="teamName != null and teamName != ''">
and tt.team_name like concat('%',#{teamName},'%') ESCAPE '/'
and tt.team_name like concat('%',#{teamName},'%')
</if>
<if test="masterName != null and masterName != ''">
and tt.rel_name like concat('%',#{masterName},'%') ESCAPE '/'
and tt.rel_name like concat('%',#{masterName},'%')
</if>
group by tt.id
</select>
@ -59,7 +59,7 @@
AND tt.pro_id = #{proId}
</if>
<if test="peopleName != null and peopleName != ''">
and tp.rel_name like concat('%',#{peopleName},'%') ESCAPE '/'
and tp.rel_name like concat('%',#{peopleName},'%')
</if>
<if test="postCode != null and postCode != ''">
and tp.post_code = #{postCode}