|
@@ -116,4 +116,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
+ <select id="sceneOutTimeGroupBy" resultType="com.fdkankan.manage.vo.response.DataGroupByCount">
|
|
|
+ SELECT DATE_FORMAT(out_time,#{dateFormat}) AS groupKey, count(id) AS count ,
|
|
|
+ <if test="tb == 't_scene_pro' or tb == 't_scene_plus' ">
|
|
|
+ scene_source as groupKey2
|
|
|
+ </if>
|
|
|
+ <if test="tb == 't_camera_detail'">
|
|
|
+ type as groupKey2
|
|
|
+ </if>
|
|
|
+ FROM ${tb}
|
|
|
+ WHERE rec_status = 'A'
|
|
|
+ <if test="tb == 't_scene_pro'">
|
|
|
+ AND is_upgrade = 0
|
|
|
+ </if>
|
|
|
+ and out_time between #{startTime} and #{endTime}
|
|
|
+ GROUP BY groupKey ,groupKey2
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="sceneOutTimeGroupByWeek" resultType="com.fdkankan.manage.vo.response.DataGroupByCount">
|
|
|
+ SELECT groupKey ,count(1) as count,
|
|
|
+ <if test="tb == 't_scene_pro' or tb == 't_scene_plus' ">
|
|
|
+ scene_source as groupKey2
|
|
|
+ </if>
|
|
|
+ <if test="tb == 't_camera_detail'">
|
|
|
+ type as groupKey2
|
|
|
+ </if>
|
|
|
+ FROM (
|
|
|
+ select date_format(date_add(out_time,interval-(weekday(out_time ))day),'%Y-%m-%d') as groupKey,
|
|
|
+ <if test="tb == 't_scene_pro' or tb == 't_scene_plus' ">
|
|
|
+ scene_source
|
|
|
+ </if>
|
|
|
+ <if test="tb == 't_camera_detail'">
|
|
|
+ type
|
|
|
+ </if>
|
|
|
+ from ${tb}
|
|
|
+ WHERE rec_status = 'A'
|
|
|
+ <if test="tb == 't_scene_pro'">
|
|
|
+ AND is_upgrade = 0
|
|
|
+ </if>
|
|
|
+ and out_time between #{startTime} and #{endTime}
|
|
|
+ ) as tb GROUP BY groupKey,groupKey2
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|