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..4bf518855a 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 @@ -77,6 +77,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { /** * @Description 中央区事件分析-项目分布 + * 【2021-06-03 修改查询红黄绿事件事件范围为一个月】 * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author liushaowen @@ -156,7 +157,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { /** * @Description 红黄绿事件总数 - * 绿色事件查询近30天,红色和黄色查询全部 + * 红黄绿事件均查询1个月以内的 * 可以添加传参 monthCount,查询几个月的绿色事件 * @Param formDTO * @author zxc @@ -169,17 +170,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..3ed76af34c 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 @@ -17,6 +17,7 @@ screen_project_data WHERE del_flag = '0' + AND UNIX_TIMESTAMP(CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL 1 MONTH)) and project_level = #{level} @@ -115,21 +116,13 @@ @@ -139,11 +132,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 +142,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 +152,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)) + ) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index fbf4e0c98a..31e5262c75 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -90,7 +90,7 @@ td.ORG_ID AS agencyId, td.ORG_NAME AS agencyName, IFNULL(td.PARTY_TOTAL,0) AS partyMemberTotal, - IFNULL(td.USER_TOTAL,0) AS gridMemberTotal, + IFNULL(td.grid_member_total,0) AS gridMemberTotal, (SELECT COUNT(ID) FROM screen_customer_grid WHERE DEL_FLAG = '0' AND PARENT_AGENCY_ID = #{agencyId}) AS gridTotal FROM screen_customer_agency sca LEFT JOIN screen_user_total_data td ON td.ORG_ID = sca.AGENCY_ID @@ -103,7 +103,7 @@