|
@@ -28,42 +28,53 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="pageList" resultType="com.fdkankan.manage.vo.response.SceneVo">
|
|
|
- SELECT * FROM(
|
|
|
- select s.scene_name ,s.num,s.create_time,c.sn_code,s.space as sceneSize
|
|
|
- ,u.user_name,s.view_count,s.status,s.pay_status,'v3' as scene_version ,s.web_site , s.thumb
|
|
|
- ,null as algorithmTime,s.user_id
|
|
|
- from t_scene_pro s
|
|
|
- <include refid="commonWhere"></include>
|
|
|
- <if test="param.sceneName != null and param.sceneName!='' ">
|
|
|
- and s.scene_name like concat ('%',#{param.sceneName},'%')
|
|
|
- </if>
|
|
|
- <if test="param.type == 5 or param.type ==7">
|
|
|
- and s.is_obj = 1
|
|
|
- </if>
|
|
|
- and is_upgrade = 0
|
|
|
- UNION
|
|
|
select s.title as sceneName ,s.num,s.create_time,c.sn_code,e.space as sceneSize
|
|
|
,u.user_name,e.view_count,s.scene_status as status,s.pay_status,'v4' as scene_version,e.web_site , e.thumb
|
|
|
,algorithm_time,s.user_id
|
|
|
from t_scene_plus s
|
|
|
left join t_scene_plus_ext e on s.id = e.plus_id
|
|
|
+ left join t_user u on s.user_id = u.id
|
|
|
+ left join t_camera c on s.camera_id = c.id
|
|
|
+ left join jy_user jy on u.id = jy.user_id
|
|
|
<include refid="commonWhere"></include>
|
|
|
- <if test="param.sceneName != null and param.sceneName!='' ">
|
|
|
- and s.title like concat ('%',#{param.sceneName},'%')
|
|
|
+
|
|
|
+ <if test="param.platformIds != null and param.platformIds.size >0">
|
|
|
+ and jy.platform_id in
|
|
|
+ <foreach item="platformId" collection="param.platformIds" open="(" separator="," close=")">
|
|
|
+ #{platformId}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
- <if test="param.type == 5 or param.type ==7">
|
|
|
- and e.is_obj = 1
|
|
|
+
|
|
|
+ <if test="param.userIds !=null and param.userIds.size>0">
|
|
|
+ and u.id in
|
|
|
+ <foreach item="userId" collection="param.userIds" open="(" separator="," close=")">
|
|
|
+ #{userId}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
- ) as tb
|
|
|
+
|
|
|
+ <if test="param.authNumList !=null and param.authNumList.size>0 ">
|
|
|
+ or (
|
|
|
+ <include refid="commonWhere"></include>
|
|
|
+ and s.num in
|
|
|
+ <foreach item="num" collection="param.authNumList" open="(" separator="," close=")">
|
|
|
+ #{num}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
order by create_time desc
|
|
|
</select>
|
|
|
|
|
|
<sql id="commonWhere">
|
|
|
- left join t_user u on s.user_id = u.id
|
|
|
- left join t_camera c on s.camera_id = c.id
|
|
|
- left join t_camera_detail d on c.id = d.camera_id
|
|
|
- left join t_company co on d.company_id = co.id
|
|
|
where s.rec_status = 'A'
|
|
|
+ <if test="param.sceneName != null and param.sceneName!='' ">
|
|
|
+ and s.title like concat ('%',#{param.sceneName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.type == 5 or param.type ==7">
|
|
|
+ and e.is_obj = 1
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="param.snCode != null and param.snCode !='' ">
|
|
|
and c.sn_code like concat ('%',#{param.snCode},'%')
|
|
|
</if>
|
|
@@ -82,31 +93,8 @@
|
|
|
<if test="param.type == 2 or param.type ==5">
|
|
|
and s.scene_source = 4
|
|
|
</if>
|
|
|
-
|
|
|
<if test="param.type == 6 or param.type ==7">
|
|
|
and s.scene_source = 5
|
|
|
</if>
|
|
|
- <if test="param.companyId !=null ">
|
|
|
- and co.id = #{param.companyId}
|
|
|
- </if>
|
|
|
- <if test="param.userIds !=null and param.userIds.size>0 and param.authNumList.size<= 0">
|
|
|
- and u.id in
|
|
|
- <foreach item="userId" collection="param.userIds" open="(" separator="," close=")">
|
|
|
- #{userId}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="param.userIds !=null and param.userIds.size>0 and param.authNumList.size>0 ">
|
|
|
- and (u.id in
|
|
|
- <foreach item="userId" collection="param.userIds" open="(" separator="," close=")">
|
|
|
- #{userId}
|
|
|
- </foreach>
|
|
|
- or s.num in
|
|
|
- <foreach item="num" collection="param.authNumList" open="(" separator="," close=")">
|
|
|
- #{num}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- </if>
|
|
|
-
|
|
|
</sql>
|
|
|
</mapper>
|