|
@@ -9,6 +9,9 @@
|
|
|
FROM t_scene_pro p
|
|
|
<include refid="sceneJoinCamera"></include>
|
|
|
WHERE is_upgrade = 0 and p.rec_status = 'A' and p.status in(1,-2)
|
|
|
+ <if test="param.sceneName !=null and param.sceneName != '' ">
|
|
|
+ and p.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
+ </if>
|
|
|
<include refid="commonWhere"></include>
|
|
|
<if test="param.searchKey !=null and param.searchKey !=''">
|
|
|
and ( p.scene_name like CONCAT('%',#{param.searchKey},'%')
|
|
@@ -28,6 +31,9 @@
|
|
|
LEFT JOIN t_scene_plus_ext e on p.id = e.plus_id
|
|
|
<include refid="sceneJoinCamera"></include>
|
|
|
WHERE p.rec_status = 'A' and p.scene_status in(1,-2)
|
|
|
+ <if test="param.sceneName !=null and param.sceneName != '' ">
|
|
|
+ and p.title like CONCAT('%',#{param.sceneName},'%')
|
|
|
+ </if>
|
|
|
<include refid="commonWhere"></include>
|
|
|
|
|
|
<if test="param.searchKey !=null and param.searchKey !=''">
|
|
@@ -47,10 +53,20 @@
|
|
|
|
|
|
<sql id="commonWhere">
|
|
|
and p.user_id =#{param.userId} and pay_status = 1
|
|
|
+ <if test="param.snCode !=null and param.snCode != '' ">
|
|
|
+ and c.sn_code like CONCAT('%',#{param.snCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime !=null and param.startTime !=''">
|
|
|
+ and p.create_time >= #{param.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime !=null and param.endTime !=''">
|
|
|
+ and p.create_time <= #{param.endTime}
|
|
|
+ </if>
|
|
|
</sql>
|
|
|
|
|
|
<sql id="sceneJoinCamera">
|
|
|
LEFT JOIN t_camera c on p.camera_id = c.id
|
|
|
</sql>
|
|
|
|
|
|
+
|
|
|
</mapper>
|