From 5307a5d09ead5871e6bd7c319e5cafd65ab72dd7 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 17 Sep 2021 17:07:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=B0=8F=E7=BB=84V2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/group/ResiGroupDao.xml | 53 +++++++------------ 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index 82d1531781..fd7e813840 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -108,41 +108,24 @@ topicContent, type FROM - ( - SELECT - a.ID AS textId, - a.TOPIC_CONTENT AS topicContent, - 'topic' AS type, - max( a.CREATED_TIME ) AS CREATED_TIME - FROM - resi_topic a - WHERE - a.GROUP_ID = #{groupId} - GROUP BY - a.GROUP_ID UNION ALL - SELECT - a.ID AS textId, - a.TITLE AS topicContent, - 'notice' AS type, - max( a.CREATED_TIME ) AS CREATED_TIME - FROM - notice a - WHERE - a.GROUP_ID = #{groupId} - GROUP BY - a.GROUP_ID UNION ALL - SELECT - a.ID AS textId, - a.TITLE AS topicContent, - 'activity' AS type, - max( a.CREATED_TIME ) AS CREATED_TIME - FROM - group_act_info a - WHERE - a.GROUP_ID = #{groupId} - GROUP BY - a.GROUP_ID - ) a + ( + SELECT + a.ID AS textId, + a.TOPIC_CONTENT AS topicContent, + 'topic' AS type, + a.CREATED_TIME + FROM + resi_topic a + INNER JOIN ( + SELECT max( CREATED_TIME ) AS CREATED_TIME + FROM resi_topic + WHERE GROUP_ID = #{groupId} + AND DEL_FLAG = '0' + ) b ON a.CREATED_TIME = b.CREATED_TIME + WHERE + a.DEL_FLAG = '0' + AND a.GROUP_ID = #{groupId} + ) a ORDER BY CREATED_TIME DESC LIMIT 1