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)) + )