| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.IDataMapper">
- <select id="totalSceneCount" resultType="java.lang.Long">
- SELECT count(1) from t_scene_plus s
- left join jy_user jy on s.user_id = jy.user_id
- left join t_camera_detail d on s.camera_id = d.camera_id
- <include refid="commonWhere"></include>
- </select>
- <select id="totalUserCount" resultType="java.lang.Long">
- select count(1) from jy_user
- where rec_status = 'A'
- <if test="param.userId != null">
- and user_id =#{param.userId}
- </if>
- <if test="param.platformId != null">
- and platform_id =#{param.platformId}
- </if>
- </select>
- <select id="totalSceneUserCount" resultType="com.fdkankan.manage.vo.response.GroupByCount">
- SELECT s.user_id as id,count(1) as count from t_scene_plus s
- left join jy_user jy on s.user_id = jy.user_id
- left join t_camera_detail d on s.camera_id = d.camera_id
- where s.rec_status = 'A'
- <if test="param.userId != null">
- and s.user_id =#{param.userId}
- </if>
- <if test="param.platformId != null">
- and jy.platform_id =#{param.platformId}
- </if>
- <if test="param.cameraType!=null ">
- and d.type = #{param.cameraType}
- </if>
- GROUP BY s.user_id
- </select>
- <select id="getSceneGroupByDay" resultType="com.fdkankan.manage.vo.response.GroupByCountVo">
- SELECT DATE(s.create_time) as groupKey,count(1) as totalCount from t_scene_plus s
- left join jy_user jy on s.user_id = jy.user_id
- left join t_camera_detail d on s.camera_id = d.camera_id
- <include refid="commonWhere"></include>
- GROUP BY DATE(s.create_time)
- </select>
- <select id="getUserGroupByDay" resultType="com.fdkankan.manage.vo.response.GroupByCountVo">
- SELECT DATE(s.create_time) as groupKey,s.user_id,count(1) as totalCount from t_scene_plus s
- left join jy_user jy on s.user_id = jy.user_id
- left join t_camera_detail d on s.camera_id = d.camera_id
- <include refid="commonWhere"></include>
- GROUP BY DATE(s.create_time), s.user_id
- </select>
- <select id="getSceneGroupByDistrict" resultType="com.fdkankan.manage.vo.response.GroupByCountVo">
- SELECT s.district_code as groupKey,count(1) as totalCount from t_scene_plus s
- left join jy_user jy on s.user_id = jy.user_id
- left join t_camera_detail d on s.camera_id = d.camera_id
- <include refid="commonWhere"></include>
- GROUP BY s.district_code
- </select>
- <select id="getExPortSceneList" resultType="com.fdkankan.manage.vo.response.ExportSceneList">
- select s.title,jy.ry_nick_name,jy.ry_no,a.sn_code, s.create_time ,e.shoot_count,s.k_no
- from t_scene_plus s LEFT JOIN t_scene_plus_ext e on s.id =e.plus_id
- left join jy_user jy on s.user_id = jy.user_id
- left join t_camera a on s.camera_id = a.id
- left join t_camera_detail d on s.camera_id = d.camera_id
- <include refid="commonWhere"></include>
- <if test="param.districtCodeList!=null and param.districtCodeList.size >0">
- and s.district_code in
- <foreach item="districtCode" collection="param.districtCodeList" open="(" separator="," close=")">
- #{districtCode}
- </foreach>
- </if>
- <if test="param.cameraTypeList!=null and param.cameraTypeList.size >0">
- and d.type in
- <foreach item="type" collection="param.cameraTypeList" open="(" separator="," close=")">
- #{type}
- </foreach>
- </if>
- </select>
- <select id="getLastSceneBuildTime" resultType="java.lang.String">
- SELECT max(e.algorithm_time) from t_scene_plus s
- LEFT JOIN t_scene_plus_ext e on s.id =e.plus_id
- left join jy_user jy on s.user_id = jy.user_id
- left join t_camera_detail d on s.camera_id = d.camera_id
- <include refid="commonWhere"></include>
- and s.create_time is not null
- </select>
- <sql id="commonWhere">
- where s.rec_status = 'A'
- <if test="param.userId != null">
- and s.user_id =#{param.userId}
- </if>
- <if test="param.platformId != null">
- and jy.platform_id =#{param.platformId}
- </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>
- <if test="param.districtCode!=null and param.districtCode != ''">
- and s.district_code = #{param.districtCode}
- </if>
- <if test="param.cameraType!=null ">
- and d.type = #{param.cameraType}
- </if>
- </sql>
- </mapper>
|