| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?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.fusion.mapper.IScenePlusMapper">
- <select id="groupByCameraId" resultType="com.fdkankan.fusion.response.DataGroupVo">
- select camera_id as groupKey ,count(1) as dataCount from t_scene_plus where rec_status = 'A' and scene_source !=6
- and camera_id in
- <foreach item="cameraId" collection="cameraIds" open="(" separator="," close=")">
- #{cameraId}
- </foreach>
- <if test="startTime !=null and startTime !='' ">
- and create_time >= #{startTime}
- </if>
- <if test="endTime !=null and endTime !='' ">
- and create_time <= #{endTime}
- </if>
- group by camera_id
- </select>
- <select id="groupByType" resultType="com.fdkankan.fusion.response.DataGroupVo">
- select scene_source as groupKey ,count(1) as dataCount from t_scene_plus where rec_status = 'A' and scene_source !=6
- and camera_id in
- <foreach item="cameraId" collection="cameraIds" open="(" separator="," close=")">
- #{cameraId}
- </foreach>
- <if test="startTime !=null and startTime !='' ">
- and create_time >= #{startTime}
- </if>
- <if test="endTime !=null and endTime !='' ">
- and create_time <= #{endTime}
- </if>
- group by scene_source
- </select>
- <select id="sceneList" resultType="com.fdkankan.fusion.response.SceneVo">
- <include refid="commonSelect"></include>
- </select>
- <select id="sceneListPage" resultType="com.fdkankan.fusion.response.SceneVo">
- <include refid="commonSelect"></include>
- </select>
- <sql id="commonSelect">
- select s.id,s.title as title,s.title as name ,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,s.scene_source,e.is_obj,d.type as cameraType,e.rtk_location,e.orientation,e.location,laser_title
- 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
- WHERE s.rec_status = 'A' and s.camera_id is not null
- and s.scene_source !=6
- <if test="param.isObj != null and param.isObj==0">
- and s.scene_source in (4,5,7)
- </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,7) )
- </if>
- <if test="param.isObj ==1 and param.sceneName != null and param.sceneName!='' ">
- and s.title like concat ('%',#{param.sceneName},'%')
- </if>
- <if test="param.isObj ==0 and param.sceneName != null and param.sceneName!='' ">
- and s.laser_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.status != null ">
- and s.scene_status = #{param.status}
- </if>
- <if test="param.sceneStatus != null ">
- and s.scene_status = #{param.sceneStatus}
- </if>
- <if test="param.cameraType!= null">
- and d.type = #{param.cameraType}
- </if>
- <if test="param.snCodes!= null and param.snCodes.size >0">
- and c.sn_code in
- <foreach item="snCode" collection="param.snCodes" open="(" separator="," close=")">
- #{snCode}
- </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>
- ORDER BY create_time desc,id asc
- </sql>
- </mapper>
|