| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <?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>
- 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 * FROM(
- select s.scene_name ,s.num,s.create_time,s.space as sceneSize
- ,s.view_count,s.status,s.pay_status,'v3' as scene_version ,s.web_site , s.thumb
- ,null as algorithmTime,data_source,s.shoot_count,s.gps,s.user_id,s.camera_id,s.compute_time,null as location,null as mixture,s.laser_title,null as slamCount,
- null as meshComputeTime,s.scene_source,s.feedback_option_id,s.is_obj
- from t_scene_pro s
- <include refid="commonWhere"></include>
- <if test="param.isLaser ==0 and param.sceneName != null and param.sceneName!='' ">
- and s.scene_name like concat ('%',#{param.sceneName},'%')
- </if>
- <if test="param.isLaser ==1 and param.sceneName != null and param.sceneName!='' ">
- and s.laser_title like concat ('%',#{param.sceneName},'%')
- </if>
- <if test="param.shootCountMin != null ">
- and s.shoot_count >= #{param.shootCountMin}
- </if>
- <if test="param.shootCountMax != null ">
- and s.shoot_count <= #{param.shootCountMax}
- </if>
- <if test="param.locations !=null and param.locations.size >0">
- and s.rec_status = 'AAA'
- </if>
- and is_upgrade = 0
- UNION ALL
- select s.title as sceneName ,s.num,s.create_time,e.space as sceneSize
- ,e.view_count,s.scene_status as status,s.pay_status,'v4' as scene_version,e.web_site,e.thumb
- ,algorithm_time,data_source,e.shoot_count,e.gps,s.user_id,s.camera_id,e.compute_time,e.location,e.mixture,s.laser_title,e.slam_count,
- e.mesh_compute_time,s.scene_source,s.feedback_option_id,e.is_obj
- from t_scene_plus s
- left join t_scene_plus_ext e on s.id = e.plus_id
- <include refid="commonWhere"></include>
- <if test="param.isLaser ==0 and param.sceneName != null and param.sceneName!='' ">
- and s.title like concat ('%',#{param.sceneName},'%')
- </if>
- <if test="param.isLaser ==1 and param.sceneName != null and param.sceneName!='' ">
- and s.laser_title like concat ('%',#{param.sceneName},'%')
- </if>
- <if test="param.shootCountMin != null ">
- and e.shoot_count >= #{param.shootCountMin}
- </if>
- <if test="param.shootCountMax != null ">
- and e.shoot_count <= #{param.shootCountMax}
- </if>
- <if test="param.locations !=null and param.locations.size >0">
- and e.location in
- <foreach item="location" collection="param.locations" open="(" separator="," close=")">
- #{location}
- </foreach>
- </if>
- ) as tb
- order by ${param.field} ${param.order}
- </select>
- <sql id="commonWhere">
- where s.rec_status = #{param.recStatus}
- <if test="param.cameraIds !=null and param.cameraIds.size >0">
- and s.camera_id in
- <foreach item="cameraId" collection="param.cameraIds" open="(" separator="," close=")">
- #{cameraId}
- </foreach>
- </if>
- <if test="param.userIds !=null and param.userIds.size >0">
- and s.user_id in
- <foreach item="userId" collection="param.userIds" open="(" separator="," close=")">
- #{userId}
- </foreach>
- </if>
- <if test="param.numList !=null and param.numList.size >0">
- and s.num in
- <foreach item="num" collection="param.numList" open="(" separator="," close=")">
- #{num}
- </foreach>
- </if>
- <if test="param.type !=null and param.type == 0">
- and s.scene_source in (1,2,12,13,14)
- </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">
- and s.scene_source = 4
- </if>
- <if test="param.type !=null and param.type == 5">
- and s.scene_source = 4 and is_obj = 1
- </if>
- <if test="param.type !=null and param.type == 6">
- and s.scene_source = 5
- </if>
- <if test="param.type !=null and param.type == 7">
- and s.scene_source = 5 and is_obj = 1
- </if>
- <if test="param.type !=null and param.type == 8">
- and s.scene_source = 7
- </if>
- <if test="param.type !=null and param.type == 57">
- and s.scene_source = 57
- </if>
- <if test="param.type !=null and param.type == 58">
- and s.scene_source = 57 and is_obj = 1
- </if>
- <if test="param.num !=null and param.num !='' ">
- and s.num like concat ('%',#{param.num},'%')
- </if>
- <if test="param.startTime !=null and param.startTime !='' ">
- and s.create_time >= #{param.startTime}
- </if>
- <if test="param.endTime !=null and param.endTime !='' ">
- and s.create_time <= #{param.endTime}
- </if>
- </sql>
- <select id="getProSpaceGroupByCameraId" resultType="com.fdkankan.manage.vo.response.GroupByCount">
- SELECT camera_id as id,sum(space) as count FROM t_scene_pro
- WHERE rec_status = 'A' and is_upgrade = 0 GROUP BY camera_id
- </select>
- <select id="getPlusSpaceGroupByCameraId" resultType="com.fdkankan.manage.vo.response.GroupByCount">
- SELECT p.camera_id as id,sum(space) as count FROM t_scene_plus p left join t_scene_plus_ext e on p.id = e.plus_id
- WHERE p.rec_status = 'A' GROUP BY p.camera_id
- </select>
- <select id="getSpaceSumByCameraId" resultType="java.lang.Long">
- select sum(space) from t_scene_pro where rec_status= 'A' and status = -2 and is_upgrade = 0 and camera_id = #{cameraId}
- </select>
- <select id="selectDelPro" resultType="com.fdkankan.manage.entity.ScenePro">
- select * from t_scene_pro WHERE rec_status = 'I'
- and num in
- <foreach item="num" collection="numList" open="(" separator="," close=")">
- #{num}
- </foreach>
- </select>
- <update id="reDelScenePro">
- update t_scene_pro set rec_status = 'A' WHERE rec_status = 'I'
- and num in
- <foreach item="num" collection="numList" open="(" separator="," close=")">
- #{num}
- </foreach>
- </update>
- <update id="reDelSceneProEdit">
- update t_scene_pro_edit set rec_status = 'A' WHERE rec_status = 'I'
- and pro_id in
- <foreach item="proId" collection="proIds" open="(" separator="," close=")">
- #{proId}
- </foreach>
- </update>
- </mapper>
|