|
@@ -11,9 +11,16 @@
|
|
|
WHERE is_upgrade = 0 and p.rec_status = 'A'
|
|
|
<include refid="commonWhere"></include>
|
|
|
|
|
|
- <include refid="commonSceneWhere"></include>
|
|
|
<if test="param.searchKey !=null and param.searchKey !=''">
|
|
|
- and p.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
+ and ( p.scene_name like CONCAT('%',#{param.searchKey},'%')
|
|
|
+ or c.sn_code like CONCAT('%',#{param.searchKey},'%')
|
|
|
+ <if test="param.numList !=null and param.numList.size >0">
|
|
|
+ or num in
|
|
|
+ <foreach item="num" collection="param.numList" open="(" separator="," close=")">
|
|
|
+ #{num}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</if>
|
|
|
UNION
|
|
|
SELECT p.id as id ,null as name ,0 as isFolder,null as type,null as parentId,p.create_time ,num,title as scene_name,description as scene_dec,
|
|
@@ -24,9 +31,16 @@
|
|
|
WHERE p.rec_status = 'A'
|
|
|
<include refid="commonWhere"></include>
|
|
|
|
|
|
- <include refid="commonSceneWhere"></include>
|
|
|
<if test="param.searchKey !=null and param.searchKey !=''">
|
|
|
- and p.title like CONCAT('%',#{param.sceneName},'%')
|
|
|
+ and ( p.title like CONCAT('%',#{param.searchKey},'%')
|
|
|
+ or c.sn_code like CONCAT('%',#{param.searchKey},'%')
|
|
|
+ <if test="param.numList !=null and param.numList.size >0">
|
|
|
+ or num in
|
|
|
+ <foreach item="num" collection="param.numList" open="(" separator="," close=")">
|
|
|
+ #{num}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</if>
|
|
|
ORDER BY create_time desc
|
|
|
) as scene_tb
|
|
@@ -42,15 +56,4 @@
|
|
|
LEFT JOIN t_camera c on p.camera_id = c.id
|
|
|
</sql>
|
|
|
|
|
|
- <sql id="commonSceneWhere">
|
|
|
- <if test="param.numList !=null and param.numList.size >0">
|
|
|
- and num in
|
|
|
- <foreach item="num" collection="param.numList" open="(" separator="," close=")">
|
|
|
- #{num}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="param.searchKey !=null and param.searchKey !=''">
|
|
|
- and c.sn_code like CONCAT('%',#{param.searchKey},'%')
|
|
|
- </if>
|
|
|
- </sql>
|
|
|
</mapper>
|