From 61942ef747db4d4262cfca28de31a527afb35b5c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 3 Jun 2021 13:34:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E9=BB=84=E7=BB=BF=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BA=E6=9F=A5=E8=AF=A2=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenProjectDataDao.java | 2 +- .../screen/impl/ScreenProjectServiceImpl.java | 16 +++------- .../mapper/screen/ScreenProjectDataDao.xml | 31 ++++++------------- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java index 2ee4a79202..49797b9cb2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -44,5 +44,5 @@ public interface ScreenProjectDataDao { * @author zxc * @date 2021/6/1 3:48 下午 */ - List selectColorProjectByAreaCode(@Param("areaCode") String areaCode,@Param("level")Integer level,@Param("monthCount")Integer monthCount); + List selectColorProjectByAreaCode(@Param("areaCode") String areaCode,@Param("monthCount")Integer monthCount); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index 2e1e8babcf..91e8b227d8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -156,7 +156,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { /** * @Description 红黄绿事件总数 - * 绿色事件查询近30天,红色和黄色查询全部 + * 红黄绿事件均查询1个月以内的 * 可以添加传参 monthCount,查询几个月的绿色事件 * @Param formDTO * @author zxc @@ -169,17 +169,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { if (StringUtils.isEmpty(formDTO.getAreaCode())){ list = screenProjectDataDao.selectColorProjectByAgencyId(formDTO.getAgencyId(), formDTO.getMonthCount()); }else { - List colorProjectTotal1 = screenProjectDataDao.selectColorProjectByAreaCode(formDTO.getAreaCode(), NumConstant.ONE, formDTO.getMonthCount()); - if (!CollectionUtils.isEmpty(colorProjectTotal1)){ - list.addAll(colorProjectTotal1); - } - List colorProjectTotal2 = screenProjectDataDao.selectColorProjectByAreaCode(formDTO.getAreaCode(), NumConstant.TWO, formDTO.getMonthCount()); - if (!CollectionUtils.isEmpty(colorProjectTotal2)){ - list.addAll(colorProjectTotal2); - } - List colorProjectTotal3 = screenProjectDataDao.selectColorProjectByAreaCode(formDTO.getAreaCode(), NumConstant.THREE, formDTO.getMonthCount()); - if (!CollectionUtils.isEmpty(colorProjectTotal3)){ - list.addAll(colorProjectTotal3); + List colorProjectTotal = screenProjectDataDao.selectColorProjectByAreaCode(formDTO.getAreaCode(), formDTO.getMonthCount()); + if (!CollectionUtils.isEmpty(colorProjectTotal)){ + list.addAll(colorProjectTotal); } } // 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index 210d0a1b27..26578cec46 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -115,21 +115,13 @@ @@ -139,11 +131,9 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pd.ORG_ID WHERE pd.DEL_FLAG = '0' AND pd.ORG_TYPE = 'agency' - AND pd.PROJECT_LEVEL = #{level} + AND pd.PROJECT_LEVEL != 0 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - - AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) - + AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) ) UNION ALL (SELECT pd.PROJECT_LEVEL @@ -151,11 +141,9 @@ LEFT JOIN screen_customer_grid scg ON scg.GRID_ID = pd.ORG_ID WHERE pd.DEL_FLAG = '0' AND pd.ORG_TYPE = 'grid' - AND pd.PROJECT_LEVEL = #{level} + AND pd.PROJECT_LEVEL != 0 AND scg.AREA_CODE LIKE CONCAT(#{areaCode},'%') - - AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) - + AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) ) UNION ALL (SELECT pd.PROJECT_LEVEL @@ -163,10 +151,9 @@ LEFT JOIN screen_customer_dept scd ON scd.DEPT_ID = pd.ORG_ID WHERE pd.DEL_FLAG = '0' AND pd.ORG_TYPE = 'department' - AND pd.PROJECT_LEVEL = #{level} + AND pd.PROJECT_LEVEL != 0 AND scd.AREA_CODE LIKE CONCAT(#{areaCode},'%') - - AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) - ) + AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) + )