From bdabd15c343ec1fc83d2875ca246c0cac1e3c9bd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 27 May 2021 10:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=E3=80=81?= =?UTF-8?q?=E5=8C=BA=E7=9B=B4=E9=83=A8=E9=97=A8=E7=9B=B8=E5=85=B3=EF=BC=8C?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97=EF=BC=8C=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=BB=A5screen=5Fcustomer=5Fgrid=E3=80=81screen=5Fcustomer=5Fd?= =?UTF-8?q?ept=E4=B8=BA=E4=B8=BB=E8=A1=A8=E3=80=82=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=88=96=E7=BD=91=E6=A0=BC=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=8E=9F=E5=A7=8B=E6=8C=87=E6=A0=87=E5=80=BC=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 8 +- .../FactIndexGovrnAblityDeptMonthlyDao.xml | 82 ++++----- .../FactIndexGovrnAblityGridMonthlyDao.xml | 105 +++++------- .../FactIndexPartyAblityGridMonthlyDao.xml | 156 ++++++++---------- .../FactIndexServiceAblityGridMonthlyDao.xml | 80 ++++----- 5 files changed, 196 insertions(+), 235 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index b785d78b4a..86da0df973 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -192,9 +192,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.error("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } - //查询总记录数 + //查询总记录数:如果网格内没有产生业务数据,fact_index_party_ablity_grid_monthly为空,改为以screen_customer_grid为主表 + //举例:有10个网格,只有2个网格在指标表里面有记录,实际total应该还是为10. 并且那8个指标值赋值为0 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { + log.warn(String.format("customerId=%s,monthId=%s,没有找到screen_customer_grid记录", formDTO.getCustomerId(), formDTO.getMonthId())); log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } @@ -214,6 +216,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; //前10条 + //这块逻辑也要改为以screen_customer_grid表为主表,没有五级指标值的网格,赋值为0 List> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), formDTO.getMonthId(), pageIndex, @@ -603,7 +606,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.error("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); } - //查询总记录数 + //查询总记录数:如果网格内没有产生业务数据,fact_index_govrn_ablity_grid_monthly为空,改为以screen_customer_grid为主表 + //举例:有10个网格,只有2个网格在指标表里面有记录,实际total应该还是为10. 并且那8个指标值赋值为0 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index f782210785..8b50b7c989 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -98,24 +98,16 @@ SELECT - m.CUSTOMER_ID, - m.DEPT_ID, - m.MONTH_ID, - MIN(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MIN, - MAX(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MAX, - MIN(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MIN, - MAX(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MAX, - MIN(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MIN, - MAX(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MAX, - MIN(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MIN, - MAX(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MAX, - MIN(M.CLOSED_PROJECT_RATIO) as CLOSED_PROJECT_RATIO_MIN, - MAX(M.CLOSED_PROJECT_RATIO) as CLOSED_PROJECT_RATIO_MAX, - MIN(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MIN, - MAX(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MAX + IFNULL(MIN(m.TRANSFERED_COUNT),0) as TRANSFERED_COUNT_MIN, + IFNULL(MAX(m.TRANSFERED_COUNT),0) as TRANSFERED_COUNT_MAX, + IFNULL(MIN(m.CLOSED_PROJECT_COUNT),0) as CLOSED_PROJECT_COUNT_MIN, + IFNULL(MAX(m.CLOSED_PROJECT_COUNT),0) as CLOSED_PROJECT_COUNT_MAX, + IFNULL(MIN(m.RESP_PROJECT_RATIO),0) as RESP_PROJECT_RATIO_MIN, + IFNULL(MAX(m.RESP_PROJECT_RATIO),0) as RESP_PROJECT_RATIO_MAX, + IFNULL(MIN(m.HANDLE_PROJECT_RATIO),0) as HANDLE_PROJECT_RATIO_MIN, + IFNULL(MAX(m.HANDLE_PROJECT_RATIO),0) as HANDLE_PROJECT_RATIO_MAX, + IFNULL(MIN(M.CLOSED_PROJECT_RATIO),0) as CLOSED_PROJECT_RATIO_MIN, + IFNULL(MAX(M.CLOSED_PROJECT_RATIO),0) as CLOSED_PROJECT_RATIO_MAX, + IFNULL(MIN(M.SATISFACTION_RATIO),0) as SATISFACTION_RATIO_MIN, + IFNULL(MAX(M.SATISFACTION_RATIO),0) as SATISFACTION_RATIO_MAX FROM fact_index_govrn_ablity_dept_monthly m inner join screen_customer_dept scd @@ -155,7 +144,6 @@ and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scd.CUSTOMER_ID=#{customerId} @@ -164,38 +152,36 @@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 755e3aab60..3298ce153b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -100,80 +100,73 @@ SELECT - count( 1 ) AS total + count( scg.GRID_ID ) AS total FROM - fact_index_govrn_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID=#{monthId} and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scg.CUSTOMER_ID=#{customerId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index a1d0e85e45..c34190359f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -105,98 +105,92 @@ + - SELECT - count(1) as total + SELECT + count(scg.GRID_ID) as total FROM - fact_index_party_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' - and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID =#{monthId} - - - and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - - - AND m.CUSTOMER_ID =#{customerId} - and scg.CUSTOMER_ID=#{customerId} - - + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and scg.CUSTOMER_ID=#{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index fa6f11e4a3..ab55e72e48 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -81,51 +81,59 @@ SELECT - count(1) as total + count(scg.GRID_ID) as total FROM - fact_index_service_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID =#{monthId} and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scg.CUSTOMER_ID=#{customerId}