From 4bab272de0d048fad7b4643fea26b8773df8d3c4 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期六, 24 八月 2024 12:48:33 +0800
Subject: [PATCH] feat:新增大屏公安部数据查询条件

---
 ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml                   |    6 ++++--
 ycl-pojo/src/main/java/com/ycl/platform/domain/query/DashboardQuery.java        |    2 +-
 ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml                    |   24 ++++++++++++------------
 ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java |    3 +--
 4 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DashboardQuery.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DashboardQuery.java
index 4cbcd38..17086a8 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DashboardQuery.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DashboardQuery.java
@@ -10,7 +10,7 @@
 public class DashboardQuery {
 
     /**
-     * 鏁版嵁鏉冮檺锛�1鐪佸巺锛�2甯傚眬锛�3鍏朵粬
+     * 鏁版嵁鏉冮檺锛�1鐪佸巺锛�2甯傚眬锛�3鍏畨閮ㄦ暟鎹�
      */
     private Integer dataScope;
 
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
index b91b2b4..e03649d 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -222,8 +222,7 @@
 
     @Override
     public List<MonitorTotalVO> monitorTotal(DashboardQuery dashboardQuery) {
-        List<MonitorTotalVO> list = baseMapper.monitorTotal(dashboardQuery);
-        return list;
+        return baseMapper.monitorTotal(dashboardQuery);
     }
 
     @Override
diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
index 1dd8412..14b8c34 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -367,8 +367,8 @@
             COUNT(p2.id) AS errorNum,
             COUNT(p1.id) - COUNT(p2.id) AS normalNum
         FROM t_monitor
-        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 'province' </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
-        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 'province' </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.important_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
         WHERE INSTR(camera_fun_type, 1)
         UNION ALL
         SELECT
@@ -377,8 +377,8 @@
             COUNT(p2.id) AS errorNum,
             COUNT(p1.id) - COUNT(p2.id) AS normalNum
         FROM t_monitor
-        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 'province' </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
-        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 'province' </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.important_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = '1' </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
         WHERE INSTR(camera_fun_type, 2)
         UNION ALL
         SELECT
@@ -387,8 +387,8 @@
             COUNT(p2.id) AS errorNum,
             COUNT(p1.id) - COUNT(p2.id) AS normalNum
         FROM t_monitor
-        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 'province' </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
-        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 'province' </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.important_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
         WHERE INSTR(camera_fun_type, 3)
     </select>
 
@@ -405,8 +405,8 @@
                     COUNT(m2.id) AS faceErrorNum
                 FROM
                     sys_dept d
-                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 'province' </if>
-                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 'province' </if>
+                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.important_tag = 1 </if>
+                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if>
                         LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 1)
                         LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 1)
                 WHERE d.del_flag = 0 AND d.area IS NOT NULL
@@ -423,8 +423,8 @@
                     COUNT(m2.id) AS carErrorNum
                 FROM
                     sys_dept d
-                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 'province' </if>
-                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 'province' </if>
+                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.important_tag = 1 </if>
+                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if>
                         LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 2)
                         LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 2)
                 WHERE d.del_flag = 0 AND d.area IS NOT NULL
@@ -441,8 +441,8 @@
                     COUNT(m2.id) AS videoErrorNum
                 FROM
                     sys_dept d
-                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 'province' </if>
-                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 'province' </if>
+                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.important_tag = 1 </if>
+                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if>
                         LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 3)
                         LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 3)
                 WHERE d.del_flag = 0 AND d.area IS NOT NULL
diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
index 82d305d..cb2ef5c 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
@@ -172,7 +172,8 @@
         FROM t_work_order w
         LEFT JOIN t_yw_point p ON w.serial_number = p.serial_number AND p.deleted = 0
         WHERE w.deleted = 0
-        <if test="dataScope == 1"> AND p.province_tag = 'province' </if>
+        <if test="dataScope == 1"> AND p.province_tag = 1 </if>
+        <if test="dataScope == 3"> AND p.important_tag = 1 </if>
         <if test="deptId != null"> AND p.dept_id = #{deptId} </if>
     </select>
 
@@ -186,7 +187,8 @@
         LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0
         LEFT JOIN t_work_order w ON w.serial_number = p.serial_number AND w.deleted = 0
         WHERE d.del_flag = 0 AND d.area IS NOT NULL
-        <if test="dataScope == 1"> AND p.province_tag = 'province' </if>
+        <if test="dataScope == 1"> AND p.province_tag = 1 </if>
+        <if test="dataScope == 3"> AND p.important_tag = 1 </if>
         <!-- <if test="deptId != null"> AND p.dept_id = #{deptId} </if> -->
         GROUP BY d.area, d.dept_id
         ORDER BY d.dept_id

--
Gitblit v1.8.0