From 7febb461fdabc11456586d4ea754e169720ab14c Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期四, 17 六月 2021 11:22:47 +0800
Subject: [PATCH] Merge branch 'test_screen' into 'master'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
index 94cf432..a9faba8 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -284,7 +284,7 @@
             " egd.grid_community_id = #{communityId}  " +
             " AND e.event_deal_status IN ( 1, 4 )  " +
             "ORDER BY " +
-            " e.create_at DESC  " +
+            " e.happen_time DESC  " +
             " LIMIT 8")
     List<IndexEventListStatisticsVO> getScreenIndexByEventList(@Param("communityId") Long communityId);
 
@@ -708,4 +708,20 @@
     @Select("select count(user_id) from sys_user where community_id = #{communityId} and type = 1")
     Long countUsedCommunityPopulation(@Param("communityId")Long communityId);
 
+    @Select(
+            "SELECT " +
+                    "(SELECT COUNT(aa.age) FROM " +
+                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) as aa where aa.age<= 16) as age16," +
+                    "(SELECT COUNT(aa.age) FROM " +
+                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27," +
+                    "(SELECT COUNT(aa.age) FROM " +
+                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35," +
+                    "(SELECT COUNT(aa.age) FROM " +
+                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," +
+                    "(SELECT COUNT(aa.age) FROM " +
+                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," +
+                    "(SELECT COUNT(aa.age) FROM " +
+                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over")
+    Map<String, Long> indexCountByAge(@Param("communityId")Long communityId);
+
 }

--
Gitblit v1.7.1