From 2ea4b6b4fe0dff9dc882b495694480d070c94da2 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期二, 07 十二月 2021 10:46:06 +0800
Subject: [PATCH] 修改排序

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java |    6 +++---
 1 files changed, 3 insertions(+), 3 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 fa09f6b..2938354 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
@@ -337,7 +337,7 @@
         + "FROM " + " event_grid_data AS egd  " + "WHERE " + " egd.grid_community_id = #{communityId}")
     List<EventGridStatisticsVO> getEventScreenGridData(@Param("communityId") Long communityId);
 
-    @Select("<script> " + "SELECT " + " event_type AS type, " + " e.id AS eventId, " + " happent_lat_lng AS latLng  "
+    @Select("<script> " + "(SELECT " + " event_type AS type, " + " e.id AS eventId, " + " happent_lat_lng AS latLng,e.create_at as createAt  "
         + "FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id  " + "WHERE "
         + " e.event_category = 1  " + " AND e.event_type IN ( 1, 2, 3, 4, 5, 6 )  " + " AND e.event_status = 2  "
         + " AND egd.grid_community_id = #{screenEventDTO.communityId}  "
@@ -349,14 +349,14 @@
         + " AND e.event_process_status = #{screenEventDTO.eventProcessStatus} " + " </if> "
         + "<if test='screenEventDTO.redCard != null'>" + " AND e.red_card = #{screenEventDTO.redCard} " + " </if> "
         + "<if test='screenEventDTO.yellowCard != null'>" + " AND e.yellow_card = #{screenEventDTO.yellowCard} "
-        + " </if> " + "UNION ALL SELECT " + " IFNULL( NULL, 7 ) AS type, " + " id AS eventId, " + " lng_lat AS latLng  "
+        + " </if> )" + "UNION ALL (SELECT " + " IFNULL( NULL, 7 ) AS type, " + " id AS eventId, " + " lng_lat AS latLng,create_at as createAt,  "
         + "FROM " + " com_act_easy_photo  " + "WHERE " + " community_id = #{screenEventDTO.communityId}  "
         + "<if test='screenEventDTO.startTime != null and screenEventDTO.startTime != &quot;&quot;'>"
         + " AND create_at <![CDATA[>=]]> #{screenEventDTO.startTime} " + " </if> "
         + "<if test='screenEventDTO.endTime != null and screenEventDTO.endTime != &quot;&quot;'>"
         + " AND create_at <![CDATA[<=]]> #{screenEventDTO.endTime} " + " </if> "
         + "<if test='screenEventDTO.eventProcessStatus != null'>"
-        + " AND handle_status = #{screenEventDTO.eventProcessStatus} " + " </if> " + " </script>")
+        + " AND handle_status = #{screenEventDTO.eventProcessStatus} " + " </if> )" + "order by createAt desc </script>")
     List<EventGridIncidentStatisticsVO>
         getEventScreenEventList(@Param("screenEventDTO") BigScreenEventDTO screenEventDTO);
 

--
Gitblit v1.7.1