Browse Source

首页统计,加入传感器事件

lyq 2 năm trước cách đây
mục cha
commit
13644d09b4

+ 36 - 2
src/main/resources/mapper/index/CentereventTEventIndexMapper.xml

@@ -27,8 +27,7 @@
                         SELECT
                         SELECT
                             CASE
                             CASE
 
 
-                                WHEN
-                                    b.camera_name LIKE '%双辽%' THEN
+                                WHEN b.camera_name LIKE '%双辽%' THEN
                                     '双辽市'
                                     '双辽市'
                                 WHEN b.camera_name LIKE '%伊通%' THEN
                                 WHEN b.camera_name LIKE '%伊通%' THEN
                                     '伊通县'
                                     '伊通县'
@@ -59,6 +58,41 @@
                                     create_by
                                     create_by
                             ) a
                             ) a
                                 INNER JOIN onest_monitor.centermonitor_t_camera b ON b.id = a.create_by
                                 INNER JOIN onest_monitor.centermonitor_t_camera b ON b.id = a.create_by
+                        UNION ALL
+                        SELECT
+                            CASE
+
+                                WHEN b.address LIKE '%双辽%' THEN
+                                    '双辽市'
+                                WHEN b.address LIKE '%伊通%' THEN
+                                    '伊通县'
+                                WHEN b.address LIKE '%梨树%' THEN
+                                    '梨树县'
+                                WHEN b.address LIKE '%铁东%' THEN
+                                    '铁东区'
+                                WHEN b.address LIKE '%铁西%' THEN
+                                    '铁西区' ELSE '四平市'
+                                END `name`,
+                            a.sb,
+                            a.qr,
+                            a.wb,
+                            a.cf
+                        FROM
+                            (
+                                SELECT
+                                    create_by,
+                                    count( event_status_value = 'forest_event_status_1' OR NULL ) sb,
+                                    count( event_status_value = 'forest_event_status_7' OR NULL ) qr,
+                                    count( event_status_value = 'forest_event_status_3' OR NULL ) wb,
+                                    count( event_status_value = 'forest_event_status_4' OR NULL ) cf
+                                FROM
+                                    onest_event.centerevent_t_eventcatalogue
+                                WHERE
+                                    dept_id IS NULL AND report_source = 'reporting_source_4' AND data_status = '0'
+                                GROUP BY
+                                    create_by
+                            ) a
+                                INNER JOIN onest_monitor.centermonitor_t_monitoring_device b ON b.id = a.create_by
                     ) t
                     ) t
                 GROUP BY
                 GROUP BY
                     `name`
                     `name`

+ 0 - 143
src/main/resources/mapper/index/CentereventTEventStgzMapper.xml

@@ -1,143 +0,0 @@
-<?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.sooka.sponest.event.index.mapper.CenterevenTEventStgzMapper">
-
-    <select id="selectCentereventTEventCountyList" resultType="Map">
-        SELECT
-            a.`name` ,
-            IFNULL( sb, 0 ) 'sb',
-                IFNULL( qr, 0 ) 'qr',
-                IFNULL( wb, 0 ) 'wb',
-                IFNULL( cf, 0 ) 'cf',
-                IFNULL( qs, 0 ) 'qs',
-                IFNULL( bj, 0 ) 'bj',
-                IFNULL( gd, 0 ) 'gd'
-        FROM
-            (
-                SELECT
-                    `name`,
-                    sum( sb ) sb,
-                    sum( qr ) qr,
-                    sum( wb ) wb,
-                    sum( cf ) cf
-                FROM
-                    (
-                        SELECT
-                            CASE
-
-                                WHEN
-                                    b.camera_name LIKE '%双辽%' THEN
-                                    '双辽市'
-                                WHEN b.camera_name LIKE '%伊通%' THEN
-                                    '伊通县'
-                                WHEN b.camera_name LIKE '%梨树%' THEN
-                                    '梨树县'
-                                WHEN b.camera_name LIKE '%铁东%' THEN
-                                    '铁东区'
-                                WHEN b.camera_name LIKE '%铁西%' THEN
-                                    '铁西区' ELSE '四平市'
-                                END `name`,
-                            a.sb,
-                            a.qr,
-                            a.wb,
-                            a.cf
-                        FROM
-                            (
-                                SELECT
-                                    create_by,
-                                    count( event_status_value = 'forest_event_status_1' OR NULL ) sb,
-                                    count( event_status_value = 'forest_event_status_7' OR NULL ) qr,
-                                    count( event_status_value = 'forest_event_status_3' OR NULL ) wb,
-                                    count( event_status_value = 'forest_event_status_4' OR NULL ) cf
-                                FROM
-                                    onest_event.centerevent_t_eventcatalogue
-                                WHERE
-                                    dept_id IS NULL
-                                  AND report_source = 'reporting_source_1'
-                                GROUP BY
-                                    create_by
-                            ) a
-                                INNER JOIN onest_monitor.centermonitor_t_camera b ON b.id = a.create_by
-                    ) t
-                GROUP BY
-                    `name`
-            ) a
-                LEFT JOIN (
-                SELECT
-                    `name`,
-                    sum( qs ) qs,
-                    sum( bj ) bj,
-                    sum( gd ) gd
-                FROM
-                    (
-                        SELECT
-                            CASE
-
-                                WHEN
-                                    CONCAT( b.ancestors, ',', b.dept_id ) LIKE '%369%' THEN
-                                    '双辽市'
-                                WHEN CONCAT( b.ancestors, ',', b.dept_id ) LIKE '%370%' THEN
-                                    '伊通县'
-                                WHEN CONCAT( b.ancestors, ',', b.dept_id ) LIKE '%371%' THEN
-                                    '梨树县'
-                                WHEN CONCAT( b.ancestors, ',', b.dept_id ) LIKE '%372%' THEN
-                                    '铁东区'
-                                WHEN CONCAT( b.ancestors, ',', b.dept_id ) LIKE '%373%' THEN
-                                    '铁西区' ELSE '四平'
-                                END `name`,
-                            a.qs,
-                            a.bj,
-                            a.gd
-                        FROM
-                            (
-                                SELECT
-                                    dept_id,
-                                    count( event_status_value = 'forest_event_status_2' OR NULL ) qs,
-                                    count( event_status_value = 'forest_event_status_5' OR NULL ) bj,
-                                    count( event_status_value = 'forest_event_status_6' OR NULL ) gd
-                                FROM
-                                    onest_event.centerevent_t_eventcatalogue
-                                WHERE
-                                    dept_id IS NOT NULL
-                                GROUP BY
-                                    dept_id
-                            ) a
-                                INNER JOIN onest_system.sys_dept b ON b.dept_id = a.dept_id
-                    ) t
-                GROUP BY
-                    `name`
-            ) b ON b.`name` = a.`name`;
-    </select>
-
-    <select id="selectCentereventTEventmapdept" resultType="Map">
-        SELECT
-            a.`name` ,
-            b.total
-        FROM
-            (
-                SELECT
-                    dept_id,
-                    IFNull(dept_as,dept_name) `name`,
-                    order_num
-                FROM
-                    onest_system.sys_dept
-                WHERE
-                    dept_id IN ( 367, 3772, 3773, 3774, 3775, 3776, 3777, 3778 )
-            ) a
-                LEFT JOIN (
-                SELECT
-                    c.dept_id,
-                    count(*) total
-                FROM
-                    ( SELECT event_code, event_status_value FROM onest_event.centerevent_t_eventcatalogue WHERE event_status_value IN ( 'forest_event_status_2', 'forest_event_status_5', 'forest_event_status_6' ) ) a
-                        INNER JOIN onest_event.centerevent_t_dept_event c ON c.event_code = a.event_code
-                        AND c.dept_handle_type = 'dept_handleType_3'
-                GROUP BY
-                    c.dept_id
-            ) b ON b.dept_id = a.dept_id
-        ORDER BY
-            order_num;
-    </select>
-</mapper>