123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.fdkankan.manage.mapper.ISceneProMapper">
- <select id="getCountGroupByUserId" resultType="com.fdkankan.manage.vo.response.GroupByCount" >
- SELECT user_id as id, count(id) as count FROM t_scene_pro WHERE rec_status = 'A' and is_upgrade = 0
- and user_id in
- <foreach item="userId" collection="userIdList" open="(" separator="," close=")">
- #{userId}
- </foreach>
- <if test="isObj !=null and isObj == 0">
- and scene_source in (1,2,3,12,13,14)
- </if>
- <if test="isObj !=null and isObj == 1">
- and is_obj = 1
- and scene_source = 4
- </if>
- GROUP BY user_id
- </select>
- <select id="getCountGroupByCameraId" resultType="com.fdkankan.manage.vo.response.GroupByCount">
- SELECT camera_id as id,count(id) as count FROM t_scene_pro WHERE rec_status = 'A' and is_upgrade = 0 AND camera_id is not null
- and scene_source in (1,2,3,12,13,14)
- and camera_id in
- <foreach item="cameraId" collection="cameraIds" open="(" separator="," close=")">
- #{cameraId}
- </foreach>
- GROUP BY camera_id
- </select>
- <select id="pageList" resultType="com.fdkankan.manage.vo.response.SceneVo">
- 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
- ,e.algorithm_time,s.user_id,jy.platform_id,s.scene_source,s.three_cam_type
- 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
- LEFT JOIN fdkk_laser.t_scene ls on s.num = ls.scene_code
- where
- <include refid="commonWhere"></include>
- <if test="param.sceneType == 0">
- <if test="param.userId!=null">
- and u.id = #{param.userId}
- </if>
- <if test="param.platformId!=null">
- and jy.platform_id = #{param.platformId}
- </if>
- </if>
- <if test="param.sceneType == 1">
- and ( 1!=1
- <if test="param.otherPlatformIds != null and param.otherPlatformIds.size >0">
- or jy.platform_id in
- <foreach item="platformId" collection="param.otherPlatformIds" open="(" separator="," close=")">
- #{platformId}
- </foreach>
- </if>
- <if test="param.otherUserIds !=null and param.otherUserIds.size>0">
- or u.id in
- <foreach item="userId" collection="param.otherUserIds" open="(" separator="," close=")">
- #{userId}
- </foreach>
- </if>
- <if test="param.authNumList !=null and param.authNumList.size>0 ">
- or s.num in
- <foreach item="num" collection="param.authNumList" open="(" separator="," close=")">
- #{num}
- </foreach>
- </if>
- )
- </if>
- order by create_time desc
- </select>
- <sql id="commonWhere">
- s.rec_status = 'A'
- <if test="param.sceneName != null and param.sceneName!='' ">
- and ( s.title like concat ('%',#{param.sceneName},'%')
- or ls.title like concat ('%',#{param.sceneName},'%')
- )
- </if>
- <if test="param.type != null and (param.type == 5 or param.type ==7)">
- and e.is_obj = 1
- </if>
- <if test="param.isObj != null and param.isObj == 0">
- and s.scene_source in (4,5)
- </if>
- <if test="param.isObj != null and param.isObj == 1">
- and ( e.is_obj = 1 or
- s.scene_source not in (4,5)
- )
- </if>
- <if test="param.snCode != null and param.snCode !='' ">
- and c.sn_code like concat ('%',#{param.snCode},'%')
- </if>
- <if test="param.num != null and param.num !='' ">
- and s.num like concat ('%',#{param.num},'%')
- </if>
- <if test="param.userName != null and param.userName !='' ">
- and u.user_name like concat ('%',#{param.userName},'%')
- </if>
- <if test="param.type !=null and param.type == 0 ">
- and s.scene_source in (1,2,12,13,14)
- and s.three_cam_type is null
- </if>
- <if test="param.type !=null and param.type == 8 ">
- and s.scene_source = 1
- and s.three_cam_type = 'yzl'
- </if>
- <if test="param.type !=null and param.type == 1">
- and s.scene_source = 3
- </if>
- <if test="param.type != null and (param.type == 2 or param.type ==5)">
- and s.scene_source = 4
- </if>
- <if test="param.type != null and (param.type == 6 or param.type ==7)">
- and s.scene_source = 5
- </if>
- </sql>
- </mapper>
|