From 76e2237752e8738781e5d10a01efa92c7fc908c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E9=A3=9E?= Date: Sat, 30 May 2020 16:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=BD=91=E6=A0=BC=E5=BC=80=E9=80=9A?= =?UTF-8?q?=E6=83=85=E5=86=B5=E3=80=91-=E3=80=90=E7=A4=BE=E7=BE=A4?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BB=9F=E8=AE=A1=E6=80=A7=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91-lipf-=2020200530?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/user/UserAnalysisDao.xml | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml index 0270e2000..1465ee8ae 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -235,18 +235,35 @@ SELECT epgr.GRID_ID gridId, COUNT( DISTINCT epgr.ID ) communityCount, - COUNT( DISTINCT ug.user_id ) communityMemberCount, - COUNT( DISTINCT ut.ID ) communityTopicCount + ( + SELECT + count(DISTINCT user_id) FROM - esua_epdc_group.epdc_group epgr - LEFT JOIN esua_epdc_group.epdc_user_group ug ON epgr.id = ug.group_id AND ug.DEL_FLAG = '0' + esua_epdc_group.epdc_user_group + WHERE + DEL_FLAG = '0' - AND DATE_FORMAT(ug.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} + AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} - LEFT JOIN esua_epdc_group.epdc_topic ut ON epgr.id = ut.group_id AND ut.DEL_FLAG = '0' + AND epgr.id = group_id + + ) AS communityMemberCount, + ( + SELECT + count(1) + FROM + esua_epdc_group.epdc_topic + WHERE + DEL_FLAG = '0' - AND DATE_FORMAT(ut.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} + AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} + AND epgr.id = group_id + + ) AS communityTopicCount + + FROM + esua_epdc_group.epdc_group epgr WHERE epgr.DEL_FLAG = '0' AND ( epgr.STATE = '10' OR epgr.STATE = '15' )