| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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 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 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="selectMesh" resultType="com.fdkankan.fusion.response.SceneVo">
- <include refid="selectMesh"></include>
- order by create_time desc
- </select>
- <select id="selectLaser" resultType="com.fdkankan.fusion.response.SceneVo">
- <include refid="selectLaser"></include>
- order by shoot_time desc
- </select>
- <select id="pageList2" resultType="com.fdkankan.fusion.response.SceneVo">
- <include refid="selectMesh"></include>
- UNION all
- <include refid="selectLaser"></include>
- ORDER BY create_time desc
- </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,s.scene_source,e.is_obj
- 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
- WHERE s.rec_status = 'A' and
- ( s.scene_source in (4,5) and e.is_obj = 1 or s.scene_source not in (4,5,57) )
- <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.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.userId!=null">
- and u.id = #{param.userId}
- </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>
- </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,s.scene_source ,null as is_obj
- from fdkk_laser.t_scene s
- left join t_user u on s.user_id = u.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.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.numList != null and param.numList.size >0">
- and s.scene_code in
- <foreach item="num" collection="param.numList" open="(" separator="," close=")">
- #{num}
- </foreach>
- </if>
- <if test="param.userId!=null">
- and u.id = #{param.userId}
- </if>
- </sql>
- </mapper>
|