zhanghua
2023-09-26 27cb33cf918ee09eae680e2ee006af13716e12f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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.ycl.mapper.apidata.ApiDataMapper">
 
 
    <select id="listTop10" resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$Top10VO">
        SELECT NAME
        ,
        IFNULL(month_index_number,0) month_index_number
        FROM
        ums_team_construction
        <where>
            <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null">
                and create_time between #{beginTime} and #{endTime}
            </if>
        </where>
        ORDER BY
        month_index_number DESC
        LIMIT 10
    </select>
    <select id="arithmeticEvent"
            resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$ArithmeticVO">
        SELECT dd.`name` ,COUNT(v.id) count
        from ums_violations v
        INNER JOIN ums_data_dictionary dd on v.grade_id = dd.id
        INNER JOIN ums_base_case b on b.id = v.id
        WHERE v.video_alarm_report_id is not NULL
        <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null">
            and create_time between #{beginTime} and #{endTime}
        </if>
        <if test="streetId !=null ">
            and b.street_id = #{streetId}
        </if>
        GROUP BY v.grade_id
        order by COUNT(v.id) desc
    </select>
    <select id="listLot" resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$LotVO">
        SELECT vp.`name` ,COUNT(v.id) count
        from ums_violations v
            INNER JOIN ums_data_dictionary dd on v.grade_id = dd.id
            INNER JOIN ums_base_case b on b.id = v.id
            INNER JOIN ums_video_point vp on v.video_point_id = vp.id
        WHERE v.video_alarm_report_id is not NULL
        <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null">
            and create_time between #{beginTime} and #{endTime}
        </if>
        <if test="streetId !=null ">
            and b.street_id = #{streetId}
        </if>
        GROUP BY v.video_point_id
        ORDER BY count DESC
    </select>
</mapper>