From b827b2710c1f9ac64fe8879f08e1008a8647966a Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期四, 07 七月 2022 13:42:12 +0800
Subject: [PATCH] 大屏数据调整

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPropertyMapper.xml |   11 +++++------
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml                |    3 +--
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPropertyMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPropertyMapper.xml
index 19fbcae..65183d2 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPropertyMapper.xml
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPropertyMapper.xml
@@ -134,7 +134,7 @@
             SELECT DATE_FORMAT( t.create_time, '%Y-%m' ) AS filed, COUNT(1) AS num
             FROM com_property_alarm t
             LEFT JOIN com_property_equipment t1 ON t.serial_no = t1.serial_no
-            WHERE t1.community_id = #{communityId} AND t.`type` = 2 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &gt; DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m'
+            WHERE t1.community_id = #{communityId} AND t1.`type` = 2 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &gt; DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m'
             ) GROUP BY filed
             UNION ALL SELECT * FROM
             (
@@ -158,7 +158,7 @@
         SELECT COUNT( 1 ) AS num
         FROM com_property_alarm t
         LEFT JOIN com_property_equipment t1 ON t.serial_no = t1.serial_no
-        WHERE t1.community_id = #{communityId} AND t.`type` = 2 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &lt;= #{date}
+        WHERE t1.community_id = #{communityId} AND t1.`type` = 2 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &lt;= #{date}
     </select>
     <select id="retrieveServiceAddPolylineData"
             resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO">
@@ -166,7 +166,7 @@
             SELECT DATE_FORMAT( t.create_time, '%Y-%m' ) AS filed, COUNT(1) AS num
             FROM com_property_alarm t
             LEFT JOIN com_property_equipment t1 ON t.serial_no = t1.serial_no
-            WHERE t1.community_id = #{communityId} AND t.`type` = 1 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &gt; DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m'
+            WHERE t1.community_id = #{communityId} AND t1.`type` = 1 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &gt; DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m'
             ) GROUP BY filed
             UNION ALL SELECT * FROM
             (
@@ -190,7 +190,7 @@
         SELECT COUNT( 1 ) AS num
         FROM com_property_alarm t
         LEFT JOIN com_property_equipment t1 ON t.serial_no = t1.serial_no
-        WHERE t1.community_id = #{communityId} AND t.`type` = 1 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &lt;= #{date}
+        WHERE t1.community_id = #{communityId} AND t1.`type` = 1 AND DATE_FORMAT( t.create_time, '%Y-%m' ) &lt;= #{date}
     </select>
     <select id="getAbnormalList" resultType="com.panzhihua.common.model.vos.property.ComPropertyAlarmVO">
         SELECT
@@ -198,11 +198,10 @@
         t.create_time,
         t1.phone,
         t1.username AS NAME,
-        t3.address AS position
+        t1.position
         FROM
         com_property_alarm t
         LEFT JOIN com_property_equipment t1 ON t.serial_no = t1.serial_no
-        LEFT JOIN com_mng_population_house t3 ON t1.village_id = t3.id
         WHERE t1.community_id = #{communityId} AND t.`type` = #{type} AND t.`status` = #{status} and t.serial_no not like '70%'
         ORDER BY t.create_time DESC
     </select>
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
index 01b281a..dd0763c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
@@ -51,11 +51,10 @@
         COUNT(DISTINCT u.user_id)allUser,
         (select COUNT(m.id) from com_mng_volunteer_mng m where m.community_id = #{communityId} and m.`state`=2)volunteerUser,
          (select count(id) from com_pb_member cpm where cpm.audit_result = 1 and cpm.community_id = #{communityId}) partymemberUser,
-        COUNT(h.id)house
+        (select count(id) from com_mng_population_house where community_id = #{communityId}) house
         FROM
         sys_user u
         JOIN com_act c ON u.community_id = c.community_id
-        LEFT JOIN com_mng_struct_house_user h on u.user_id=h.user_id
         WHERE u.community_id = #{communityId} and u.type=1
     </select>
 

--
Gitblit v1.7.1