|
@@ -9,7 +9,6 @@
|
|
|
<include refid="sceneJoinCamera"></include>
|
|
|
WHERE is_upgrade = 0 and p.rec_status = 'A'
|
|
|
<include refid="commonWhere"></include>
|
|
|
- <include refid="commonSceneWhere"></include>
|
|
|
<if test="param.sceneName !=null and param.sceneName !=''">
|
|
|
and p.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
</if>
|
|
@@ -21,7 +20,6 @@
|
|
|
<include refid="sceneJoinCamera"></include>
|
|
|
WHERE p.rec_status = 'A'
|
|
|
<include refid="commonWhere"></include>
|
|
|
- <include refid="commonSceneWhere"></include>
|
|
|
<if test="param.sceneName !=null and param.sceneName !=''">
|
|
|
and p.title like CONCAT('%',#{param.sceneName},'%')
|
|
|
</if>
|
|
@@ -37,20 +35,25 @@
|
|
|
|
|
|
<sql id="sceneJoinCamera">
|
|
|
LEFT JOIN t_camera c on p.camera_id = c.id
|
|
|
- LEFT JOIN t_scene_cooperation coo on p.num = coo.scene_num
|
|
|
- LEFT JOIN t_user u on coo.user_id = u.id
|
|
|
+ LEFT JOIN t_user u on p.user_id = u.id
|
|
|
</sql>
|
|
|
|
|
|
<sql id="commonWhere">
|
|
|
- <if test="param.userId != null ">
|
|
|
- and p.user_id =#{param.userId}
|
|
|
+ <if test= 'param.userId != null or param.cooperationNums != null or param.cameraId != null'>
|
|
|
+ and ( 1!=1
|
|
|
</if>
|
|
|
- </sql>
|
|
|
-
|
|
|
- <sql id="commonSceneWhere">
|
|
|
- <if test="param.snCode !=null and param.snCode !=''">
|
|
|
- and c.sn_code like CONCAT('%',#{param.snCode},'%')
|
|
|
+ <if test="param.userId != null">
|
|
|
+ or p.user_id =#{param.userId}
|
|
|
+ </if>
|
|
|
+ <if test="param.cameraId !=null ">
|
|
|
+ or p.camera_id = #{param.cameraId}
|
|
|
+ </if>
|
|
|
+ <if test="param.cooperationNums !=null and param.cooperationNums !=''">
|
|
|
+ or p.num in ( #{param.cooperationNums} )
|
|
|
+ </if>
|
|
|
+ <if test= 'param.userId != null or param.cooperationNums != null or param.cameraId != null'>
|
|
|
+ )
|
|
|
</if>
|
|
|
- and coo.rec_status ='A'
|
|
|
</sql>
|
|
|
+
|
|
|
</mapper>
|