| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <?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="selectMeshGroup" resultType="com.fdkankan.manage.vo.response.GroupByCount">
- SELECT ${groupKey} as id ,count(id) as count from (
- <include refid="selectMesh"></include>
- )as tb
- group by ${groupKey}
- </select>
- <select id="selectMesh" resultType="com.fdkankan.manage.vo.response.SceneVo">
- <include refid="selectMesh"></include>
- order by create_time desc,id asc
- </select>
- <select id="selectLaser" resultType="com.fdkankan.manage.vo.response.SceneVo">
- <include refid="selectLaser"></include>
- order by shoot_time desc,id asc
- </select>
- <select id="pageList2" resultType="com.fdkankan.manage.vo.response.SceneVo">
- <include refid="selectMesh"></include>
- UNION all
- <include refid="selectLaser"></include>
- ORDER BY create_time desc,id asc
- </select>
- <sql id="selectMesh">
- select s.id,'4dkankan' as sceneType,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,e.is_obj,jy.ry_nick_name as nickName,
- s.build_fail_reason,s.start_build_time,d.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 t_camera_detail d on s.camera_id = d.camera_id
- left join jy_user jy on u.id = jy.user_id
- WHERE s.rec_status = 'A'
- <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 ( s.scene_source in (4,5) and e.is_obj = 1 or s.scene_source not in (4,5) )
- </if>
- <if test="param.isObj == null ">
- and ( s.scene_source in (4,5) and e.is_obj = 1 or s.scene_source not in (4,5) )
- </if>
- <if test="param.sceneName != null and param.sceneName!='' ">
- and s.title like concat ('%',#{param.sceneName},'%')
- </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.notUserId != null ">
- and u.id != #{param.notUserId}
- </if>
- <if test="param.sceneStatus != null ">
- and s.scene_status = #{param.sceneStatus}
- </if>
- <if test="param.type!= null">
- and d.type = #{param.type}
- </if>
- <if test="param.threeCamType !=null ">
- and s.three_cam_type = 'yzl'
- </if>
- <if test="param.notThreeCamType !=null ">
- and s.three_cam_type is null
- </if>
- <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">
- <if test="param.platform!= null">
- and jy.platform_id = #{param.platform}
- </if>
- 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>
- </sql>
- <sql id="selectLaser">
- SELECT s.id,'laser' as sceneType, s.title as sceneName,s.scene_code as num,s.shoot_time as createTime,s.sn_code,s.space as scennSize,s.user_name,s.view_count,s.status,
- s.pay_status,'v4' as scene_version,s.web_site,s.init_pic as thumb,s.algorithm_time,s.user_id,jy.platform_id,s.scene_source,
- null as asthree_cam_type ,null as is_obj,jy.ry_nick_name as nickName,null as buildFailReason,null as startBuildTime,null as type
- from fdkk_laser.t_scene s
- left join t_user u on s.user_id = u.id
- left join jy_user jy on u.id = jy.user_id
- WHERE s.deleted = 0 and s.status !=-1 and s.scene_source in (4,5)
- <if test="param.sceneName != null and param.sceneName!='' ">
- and s.title like concat ('%',#{param.sceneName},'%')
- </if>
- <if test="param.snCode != null and param.snCode !='' ">
- and s.sn_code like concat ('%',#{param.snCode},'%')
- </if>
- <if test="param.num != null and param.num !='' ">
- and s.scene_code like concat ('%',#{param.num},'%')
- </if>
- <if test="param.userName != null and param.userName !='' ">
- and s.user_name like concat ('%',#{param.userName},'%')
- </if>
- <if test="param.notUserId != null ">
- and u.id != #{param.notUserId}
- </if>
- <if test="param.sceneStatus != null ">
- and s.status = #{param.sceneStatus}
- </if>
- <if test="param.sceneSource != null and param.sceneSource.size >0">
- and s.scene_source in
- <foreach item="source" collection="param.sceneSource" open="(" separator="," close=")">
- #{source}
- </foreach>
- </if>
- <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">
- <if test="param.platform!= null">
- and jy.platform_id = #{param.platform}
- </if>
- 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.scene_code in
- <foreach item="num" collection="param.authNumList" open="(" separator="," close=")">
- #{num}
- </foreach>
- </if>
- )
- </if>
- </sql>
- </mapper>
|