Browse Source

大屏区直部门统计

feature/dangjian
zhaoqifeng 3 years ago
parent
commit
baaa190b39
  1. 39
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventEfficiencyDao.java
  2. 199
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventEfficiencyServiceImpl.java
  3. 253
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventEfficiencyDao.xml

39
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventEfficiencyDao.java

@ -79,7 +79,7 @@ public interface ScreenDeptEventEfficiencyDao extends BaseDao<ScreenDeptEventEff
*/
List<EfficiencyEvaluationResultDTO> getScreenDataByInterval(EventStatisticsFormDTO formDTO);
void deleteData(@Param("statDate") String statDate);
void deleteData(@Param("statDate") String statDate, @Param("level") String level);
/**
* 柱状图
@ -89,4 +89,41 @@ public interface ScreenDeptEventEfficiencyDao extends BaseDao<ScreenDeptEventEff
* @Date 2022/10/18 10:06
*/
List<EfficiencyEvaluationResultDTO> getEventBar(EventStatisticsFormDTO formDTO);
/**
* 区直部门日统计
* @Param statDate
* @Return {@link List<ScreenDeptEventEfficiencyEntity>}
* @Author zhaoqifeng
* @Date 2022/10/11 15:50
*/
List<ScreenDeptEventEfficiencyEntity> getDeptEventEfficiencyDaily(@Param("statDate") String statDate);
/**
* 区直部门月统计
* @Param statDate
* @Return {@link List<ScreenDeptEventEfficiencyEntity>}
* @Author zhaoqifeng
* @Date 2022/10/11 15:50
*/
List<ScreenDeptEventEfficiencyEntity> getDeptEventEfficiencyMonthly(@Param("statDate") String statDate);
/**
* 区直部门年统计
* @Param statDate
* @Return {@link List<ScreenDeptEventEfficiencyEntity>}
* @Author zhaoqifeng
* @Date 2022/10/11 15:50
*/
List<ScreenDeptEventEfficiencyEntity> getDeptEventEfficiencyYearly(@Param("statDate") String statDate);
/**
* 获取区直部门大屏数据-自定义时间区间
* @Param formDTO
* @Return {@link List< EfficiencyEvaluationResultDTO>}
* @Author zhaoqifeng
* @Date 2022/10/12 14:40
*/
List<EfficiencyEvaluationResultDTO> getDeptScreenDataByInterval(EventStatisticsFormDTO formDTO);
}

199
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventEfficiencyServiceImpl.java

@ -68,65 +68,13 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
} else {
statDate = formDTO.getStatDate();
}
//下级部门统计
List<ScreenDeptEventEfficiencyEntity> list = baseDao.getEventEfficiencyDaily(statDate);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
item.setStatDate(statDate);
if (item.getEventCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getEventCount());
BigDecimal closedCount = new BigDecimal(item.getClosedCount());
BigDecimal responseCount = new BigDecimal(item.getResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
item.setClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getClosedCount() != NumConstant.ZERO) {
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
if (item.getLivelihoodCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getLivelihoodCount());
BigDecimal closedCount = new BigDecimal(item.getLivelihoodClosedCount());
BigDecimal responseCount = new BigDecimal(item.getLivelihoodResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getLivelihoodSatisfiedCount());
item.setLivelihoodClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setLivelihoodResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getLivelihoodClosedCount() != NumConstant.ZERO) {
item.setLivelihoodSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
if (item.getDevelopCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getDevelopCount());
BigDecimal closedCount = new BigDecimal(item.getDevelopClosedCount());
BigDecimal responseCount = new BigDecimal(item.getDevelopResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getDevelopSatisfiedCount());
item.setDevelopClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setDevelopResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getDevelopClosedCount() != NumConstant.ZERO) {
item.setDevelopSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
getData(statDate, list);
if (item.getLawCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getLawCount());
BigDecimal closedCount = new BigDecimal(item.getLawClosedCount());
BigDecimal responseCount = new BigDecimal(item.getLawResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getLawSatisfiedCount());
item.setLawClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setLawResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getLawClosedCount() != NumConstant.ZERO) {
item.setLawSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
});
baseDao.deleteData(statDate);
insertBatch(list);
}
//区直部门统计
List<ScreenDeptEventEfficiencyEntity> deptList = baseDao.getDeptEventEfficiencyDaily(statDate);
getDeptData(statDate, deptList);
}
/**
@ -147,25 +95,11 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
statDate = formDTO.getStatDate();
}
List<ScreenDeptEventEfficiencyEntity> list = baseDao.getEventEfficiencyMonthly(statDate);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
item.setStatDate(statDate);
if (item.getEventCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getEventCount());
BigDecimal closedCount = new BigDecimal(item.getClosedCount());
BigDecimal responseCount = new BigDecimal(item.getResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
item.setClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getClosedCount() != NumConstant.ZERO) {
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
});
baseDao.deleteData(statDate);
insertBatch(list);
}
getData(statDate, list);
//区直部门统计
List<ScreenDeptEventEfficiencyEntity> deptList = baseDao.getDeptEventEfficiencyMonthly(statDate);
getDeptData(statDate, deptList);
}
/**
@ -186,6 +120,51 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
statDate = formDTO.getStatDate();
}
List<ScreenDeptEventEfficiencyEntity> list = baseDao.getEventEfficiencyYearly(statDate);
getData(statDate, list);
//区直部门统计
List<ScreenDeptEventEfficiencyEntity> deptList = baseDao.getDeptEventEfficiencyYearly(statDate);
getDeptData(statDate, deptList);
}
private void getDeptData(String statDate, List<ScreenDeptEventEfficiencyEntity> deptList) {
if (CollectionUtils.isNotEmpty(deptList)) {
deptList.forEach(item -> {
item.setStatDate(statDate);
if (item.getEventCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getEventCount());
BigDecimal closedCount = new BigDecimal(item.getClosedCount());
item.setClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
if (item.getLivelihoodCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getLivelihoodCount());
BigDecimal closedCount = new BigDecimal(item.getLivelihoodClosedCount());
item.setLivelihoodClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
if (item.getDevelopCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getDevelopCount());
BigDecimal closedCount = new BigDecimal(item.getDevelopClosedCount());
item.setDevelopClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
if (item.getLawCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getLawCount());
BigDecimal closedCount = new BigDecimal(item.getLawClosedCount());
item.setLawClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
});
baseDao.deleteData(statDate, NumConstant.TWO_STR);
insertBatch(deptList);
}
}
private void getData(String statDate, List<ScreenDeptEventEfficiencyEntity> list) {
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
item.setStatDate(statDate);
@ -201,8 +180,47 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
if (item.getLivelihoodCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getLivelihoodCount());
BigDecimal closedCount = new BigDecimal(item.getLivelihoodClosedCount());
BigDecimal responseCount = new BigDecimal(item.getLivelihoodResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getLivelihoodSatisfiedCount());
item.setLivelihoodClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setLivelihoodResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getLivelihoodClosedCount() != NumConstant.ZERO) {
item.setLivelihoodSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
if (item.getDevelopCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getDevelopCount());
BigDecimal closedCount = new BigDecimal(item.getDevelopClosedCount());
BigDecimal responseCount = new BigDecimal(item.getDevelopResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getDevelopSatisfiedCount());
item.setDevelopClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setDevelopResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getDevelopClosedCount() != NumConstant.ZERO) {
item.setDevelopSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
if (item.getLawCount() != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getLawCount());
BigDecimal closedCount = new BigDecimal(item.getLawClosedCount());
BigDecimal responseCount = new BigDecimal(item.getLawResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getLawSatisfiedCount());
item.setLawClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setLawResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getLawClosedCount() != NumConstant.ZERO) {
item.setLawSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
});
baseDao.deleteData(statDate);
baseDao.deleteData(statDate, NumConstant.ONE_STR);
insertBatch(list);
}
}
@ -230,7 +248,12 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
formDTO.setStatDate(DateUtils.format(new Date(), DateUtils.DATE_PATTERN).substring(0, 4));
} else {
//自定义区间
List<EfficiencyEvaluationResultDTO> list = baseDao.getScreenDataByInterval(formDTO);
List<EfficiencyEvaluationResultDTO> list;
if (NumConstant.ONE_STR.equals(formDTO.getType())) {
list = baseDao.getScreenDataByInterval(formDTO);
} else {
list = baseDao.getDeptScreenDataByInterval(formDTO);
}
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
if ("grid_party".equals(item.getDeptLevel())) {
@ -243,17 +266,19 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal eventCount = new BigDecimal(item.getEventCount());
BigDecimal closedCount = new BigDecimal(item.getClosedCount());
BigDecimal responseCount = new BigDecimal(item.getResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
String closedRatio = closedCount.multiply(hundred).divide(eventCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
String responseRatio = responseCount.multiply(hundred).divide(eventCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
item.setClosedRatio(closedRatio.concat("%"));
item.setResponseRatio(responseRatio.concat("%"));
if (item.getClosedCount() != NumConstant.ZERO) {
String satisfiedRatio = satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
item.setSatisfiedRatio(satisfiedRatio.concat("%"));
} else {
item.setSatisfiedRatio("0%");
if (NumConstant.ONE_STR.equals(formDTO.getType())) {
BigDecimal responseCount = new BigDecimal(item.getResponseCount());
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
String responseRatio = responseCount.multiply(hundred).divide(eventCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
item.setResponseRatio(responseRatio.concat("%"));
if (item.getClosedCount() != NumConstant.ZERO) {
String satisfiedRatio = satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
item.setSatisfiedRatio(satisfiedRatio.concat("%"));
} else {
item.setSatisfiedRatio("0%");
}
}
} else {
item.setClosedRatio("0%");

253
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventEfficiencyDao.xml

@ -7,6 +7,13 @@
FROM screen_dept_event_efficiency
WHERE 1 = 1
AND STAT_DATE = #{statDate}
<if test='level == "2"'>
AND (DEPT_LEVEL = 'street_dept' OR DEPT_LEVEL = 'district_dept')
</if>
<if test='level != "2"'>
AND DEPT_LEVEL != 'street_dept'
AND DEPT_LEVEL != 'district_dept'
</if>
</delete>
<select id="getEventEfficiencyDaily" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity">
SELECT a.id AS deptId,
@ -107,6 +114,8 @@
GROUP BY ALL_DEPT_IDS
) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%')
WHERE a.del_flag = '0'
AND a.type_key != 'street_dept'
AND a.type_key != 'district_dept'
GROUP BY a.id
</select>
<select id="getEventEfficiencyMonthly" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity">
@ -227,6 +236,8 @@
GROUP BY ALL_DEPT_IDS
) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%')
WHERE a.del_flag = '0'
AND a.type_key != 'street_dept'
AND a.type_key != 'district_dept'
GROUP BY a.id
</select>
<select id="getEventEfficiencyYearly" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity">
@ -347,6 +358,8 @@
GROUP BY ALL_DEPT_IDS
) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%')
WHERE a.del_flag = '0'
AND a.type_key != 'street_dept'
AND a.type_key != 'district_dept'
GROUP BY a.id
</select>
<select id="getScreenData" resultType="com.elink.esua.epdc.dto.screen.result.EfficiencyEvaluationResultDTO">
@ -605,12 +618,8 @@
GROUP BY ALL_DEPT_IDS
) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%')
WHERE a.del_flag = '0'
<if test='type == "2"'>
AND (a.type_key = 'street_dept' OR a.type_key = 'district_dept')
</if>
<if test='type != "2"'>
AND a.type_key != 'street_dept' AND a.type_key != 'district_dept'
</if>
AND a.type_key != 'street_dept'
AND a.type_key != 'district_dept'
AND a.PID = #{deptId}
GROUP BY a.id
ORDER BY a.sort,
@ -660,4 +669,236 @@
ORDER BY a.sort,
CONVERT(a.`name` USING gbk) ASC
</select>
<select id="getDeptEventEfficiencyDaily" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity">
SELECT a.GRID_UNITID AS deptId,
a.GRID_UNITNAME AS deptName,
'0' AS pid,
'0' AS pids,
'1' AS statType,
'district_dept' AS deptLevel,
0 AS deptSort,
COUNT(DISTINCT a.ITEM_ID) AS eventCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '0' THEN a.ITEM_ID END) AS livelihoodCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '1' THEN a.ITEM_ID END) AS developCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '2' THEN a.ITEM_ID END) AS lawCount,
COUNT(DISTINCT CASE WHEN c.ITEM_ID IS NOT NULL THEN a.ITEM_ID END) AS closedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '0' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS livelihoodClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '1' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS developClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '2' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS lawClosedCount
FROM epdc_item_handle_process a
INNER JOIN epdc_item b ON a.ITEM_ID = b.ID
AND b.DEL_FLAG = '0'
AND PEOPLE_FLAG IS NOT NULL
AND IS_PEOPLE = '1'
AND EVENT_ID IS NULL
AND ISSUE_ID IS NULL
AND DATE_FORMAT(b.CREATED_TIME, '%Y-%m-%d') &lt;= #{statDate}
LEFT JOIN epdc_item_handle_process c ON a.ITEM_ID = c.ITEM_ID
AND c.DEL_FLAG = '0'
AND c.STATE = '60'
AND DATE_FORMAT(c.CREATED_TIME, '%Y-%m-%d') &lt;= #{statDate}
WHERE a.DEL_FLAG = '0'
AND a.GRID_CANTONCODE = '370203'
AND a.GRID_UNITNAME IS NOT NULL
AND a.GRID_UNITNAME != ''
AND a.GRID_UNITNAME != '北尚诉办'
AND a.GRID_PARTYID NOT IN (
'101', '1525', '1549', '1550', '1551', '1552', '1553', '1554', '1555', '1556', '1557', '1558', '1559', '1560',
'1561', '1562', '1563', '1564', '1565', '1566', '1567', '1568', '1569', '1570', '1571', '1572', '1573', '1574',
'1575', '1576', '1577', '1578', '1579', '1580', '1581', '1582', '1583', '1584', '1585', '1586', '1587', '1588',
'1589', '1590', '1591', '1592', '1593', '1594', '1595', '1596', '1597', '1598', '1599', '1600', '1601', '1602',
'1603', '1604', '1605', '1606', '1607', '1608', '1609', '1610', '1611', '1612', '1613', '1614', '1615', '1616',
'1617', '1618', '1619', '1620', '1621', '1622', '1623', '1624', '1625', '1626', '1627', '1628', '1629', '1630',
'1631', '1632', '1633', '1634', '1635', '1636', '1637', '1638', '1639', '1640', '1641', '1642', '1643', '2216',
'2247', '2248', '2252', '2254', '2255', '2258', '2259', '2261', '2265', '2267', '2271', '2272', '2275', '2280',
'2281', '2285', '2287', '2290', '2292', '2293', '2294', '2295', '2298', '2299', '4701', '7487', '7488', '7489',
'7490', '7491', '7492', '7493', '7494', '7495', '7496', '7497', '7498', '7499', '7500', '7501', '7502', '7503',
'7504', '8481', '9841', '10100', '14751', '19177', '130954', '248834', '257176', '1140746', '1607411', '1636766',
'1636767', '1976283', '3368267', '3368281', '3368284', '3368286', '3368288', '3368291', '3537573', '3537682', '4180987',
'4181079', '4400541', '4742418', '4860578', '4885731'
)
GROUP BY a.GRID_UNITID
</select>
<select id="getDeptEventEfficiencyMonthly" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity">
SELECT a.GRID_UNITID AS deptId,
a.GRID_UNITNAME AS deptName,
'0' AS pid,
'0' AS pids,
'2' AS statType,
'district_dept' AS deptLevel,
0 AS deptSort,
COUNT(DISTINCT a.ITEM_ID) AS eventCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '0' THEN a.ITEM_ID END) AS livelihoodCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '1' THEN a.ITEM_ID END) AS developCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '2' THEN a.ITEM_ID END) AS lawCount,
COUNT(DISTINCT CASE WHEN c.ITEM_ID IS NOT NULL THEN a.ITEM_ID END) AS closedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '0' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS livelihoodClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '1' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS developClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '2' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS lawClosedCount
FROM epdc_item_handle_process a
INNER JOIN epdc_item b ON a.ITEM_ID = b.ID
AND b.DEL_FLAG = '0'
AND PEOPLE_FLAG IS NOT NULL
AND IS_PEOPLE = '1'
AND EVENT_ID IS NULL
AND ISSUE_ID IS NULL
AND DATE_FORMAT(b.CREATED_TIME, '%Y-%m') = #{statDate}
LEFT JOIN epdc_item_handle_process c ON a.ITEM_ID = c.ITEM_ID
AND c.DEL_FLAG = '0'
AND c.STATE = '60'
AND DATE_FORMAT(c.CREATED_TIME, '%Y-%m') = #{statDate}
WHERE a.DEL_FLAG = '0'
AND a.GRID_CANTONCODE = '370203'
AND a.GRID_UNITNAME IS NOT NULL
AND a.GRID_UNITNAME != ''
AND a.GRID_UNITNAME != '北尚诉办'
AND a.GRID_PARTYID NOT IN (
'101', '1525', '1549', '1550', '1551', '1552', '1553', '1554', '1555', '1556', '1557', '1558', '1559', '1560',
'1561', '1562', '1563', '1564', '1565', '1566', '1567', '1568', '1569', '1570', '1571', '1572', '1573', '1574',
'1575', '1576', '1577', '1578', '1579', '1580', '1581', '1582', '1583', '1584', '1585', '1586', '1587', '1588',
'1589', '1590', '1591', '1592', '1593', '1594', '1595', '1596', '1597', '1598', '1599', '1600', '1601', '1602',
'1603', '1604', '1605', '1606', '1607', '1608', '1609', '1610', '1611', '1612', '1613', '1614', '1615', '1616',
'1617', '1618', '1619', '1620', '1621', '1622', '1623', '1624', '1625', '1626', '1627', '1628', '1629', '1630',
'1631', '1632', '1633', '1634', '1635', '1636', '1637', '1638', '1639', '1640', '1641', '1642', '1643', '2216',
'2247', '2248', '2252', '2254', '2255', '2258', '2259', '2261', '2265', '2267', '2271', '2272', '2275', '2280',
'2281', '2285', '2287', '2290', '2292', '2293', '2294', '2295', '2298', '2299', '4701', '7487', '7488', '7489',
'7490', '7491', '7492', '7493', '7494', '7495', '7496', '7497', '7498', '7499', '7500', '7501', '7502', '7503',
'7504', '8481', '9841', '10100', '14751', '19177', '130954', '248834', '257176', '1140746', '1607411', '1636766',
'1636767', '1976283', '3368267', '3368281', '3368284', '3368286', '3368288', '3368291', '3537573', '3537682', '4180987',
'4181079', '4400541', '4742418', '4860578', '4885731'
)
GROUP BY a.GRID_UNITID
</select>
<select id="getDeptEventEfficiencyYearly" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity">
SELECT a.GRID_UNITID AS deptId,
a.GRID_UNITNAME AS deptName,
'0' AS pid,
'0' AS pids,
'3' AS statType,
'district_dept' AS deptLevel,
0 AS deptSort,
COUNT(DISTINCT a.ITEM_ID) AS eventCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '0' THEN a.ITEM_ID END) AS livelihoodCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '1' THEN a.ITEM_ID END) AS developCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '2' THEN a.ITEM_ID END) AS lawCount,
COUNT(DISTINCT CASE WHEN c.ITEM_ID IS NOT NULL THEN a.ITEM_ID END) AS closedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '0' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS livelihoodClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '1' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS developClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '2' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS lawClosedCount
FROM epdc_item_handle_process a
INNER JOIN epdc_item b ON a.ITEM_ID = b.ID
AND b.DEL_FLAG = '0'
AND PEOPLE_FLAG IS NOT NULL
AND IS_PEOPLE = '1'
AND EVENT_ID IS NULL
AND ISSUE_ID IS NULL
AND DATE_FORMAT(b.CREATED_TIME, '%Y') = #{statDate}
LEFT JOIN epdc_item_handle_process c ON a.ITEM_ID = c.ITEM_ID
AND c.DEL_FLAG = '0'
AND c.STATE = '60'
AND DATE_FORMAT(c.CREATED_TIME, '%Y') = #{statDate}
WHERE a.DEL_FLAG = '0'
AND a.GRID_CANTONCODE = '370203'
AND a.GRID_UNITNAME IS NOT NULL
AND a.GRID_UNITNAME != ''
AND a.GRID_UNITNAME != '北尚诉办'
AND a.GRID_PARTYID NOT IN (
'101', '1525', '1549', '1550', '1551', '1552', '1553', '1554', '1555', '1556', '1557', '1558', '1559', '1560',
'1561', '1562', '1563', '1564', '1565', '1566', '1567', '1568', '1569', '1570', '1571', '1572', '1573', '1574',
'1575', '1576', '1577', '1578', '1579', '1580', '1581', '1582', '1583', '1584', '1585', '1586', '1587', '1588',
'1589', '1590', '1591', '1592', '1593', '1594', '1595', '1596', '1597', '1598', '1599', '1600', '1601', '1602',
'1603', '1604', '1605', '1606', '1607', '1608', '1609', '1610', '1611', '1612', '1613', '1614', '1615', '1616',
'1617', '1618', '1619', '1620', '1621', '1622', '1623', '1624', '1625', '1626', '1627', '1628', '1629', '1630',
'1631', '1632', '1633', '1634', '1635', '1636', '1637', '1638', '1639', '1640', '1641', '1642', '1643', '2216',
'2247', '2248', '2252', '2254', '2255', '2258', '2259', '2261', '2265', '2267', '2271', '2272', '2275', '2280',
'2281', '2285', '2287', '2290', '2292', '2293', '2294', '2295', '2298', '2299', '4701', '7487', '7488', '7489',
'7490', '7491', '7492', '7493', '7494', '7495', '7496', '7497', '7498', '7499', '7500', '7501', '7502', '7503',
'7504', '8481', '9841', '10100', '14751', '19177', '130954', '248834', '257176', '1140746', '1607411', '1636766',
'1636767', '1976283', '3368267', '3368281', '3368284', '3368286', '3368288', '3368291', '3537573', '3537682', '4180987',
'4181079', '4400541', '4742418', '4860578', '4885731'
)
GROUP BY a.GRID_UNITID
</select>
<select id="getDeptScreenDataByInterval" resultType="com.elink.esua.epdc.dto.screen.result.EfficiencyEvaluationResultDTO">
SELECT a.GRID_UNITID AS deptId,
a.GRID_UNITNAME AS deptName,
'0' AS pid,
'0' AS pids,
'3' AS statType,
'district_dept' AS deptLevel,
0 AS deptSort,
COUNT(DISTINCT a.ITEM_ID) AS eventCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '0' THEN a.ITEM_ID END) AS livelihoodCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '1' THEN a.ITEM_ID END) AS developCount,
COUNT(DISTINCT CASE WHEN PEOPLE_FLAG = '2' THEN a.ITEM_ID END) AS lawCount,
COUNT(DISTINCT CASE WHEN c.ITEM_ID IS NOT NULL THEN a.ITEM_ID END) AS closedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '0' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS livelihoodClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '1' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS developClosedCount,
COUNT(DISTINCT CASE
WHEN PEOPLE_FLAG = '2' AND c.ITEM_ID IS NOT NULL
THEN a.ITEM_ID END) AS lawClosedCount
FROM epdc_item_handle_process a
INNER JOIN epdc_item b ON a.ITEM_ID = b.ID
AND b.DEL_FLAG = '0'
AND PEOPLE_FLAG IS NOT NULL
AND IS_PEOPLE = '1'
AND EVENT_ID IS NULL
AND ISSUE_ID IS NULL
AND DATE_FORMAT(b.CREATED_TIME, '%Y-%m-%d') &gt;= #{startDate}
AND DATE_FORMAT(b.CREATED_TIME, '%Y-%m-%d') &lt;= #{endDate}
LEFT JOIN epdc_item_handle_process c ON a.ITEM_ID = c.ITEM_ID
AND c.DEL_FLAG = '0'
AND c.STATE = '60'
AND DATE_FORMAT(c.CREATED_TIME, '%Y-%m-%d') &gt;= #{startDate}
AND DATE_FORMAT(c.CREATED_TIME, '%Y-%m-%d') &lt;= #{endDate}
WHERE a.DEL_FLAG = '0'
AND a.GRID_CANTONCODE = '370203'
AND a.GRID_UNITNAME IS NOT NULL
AND a.GRID_UNITNAME != ''
AND a.GRID_UNITNAME != '北尚诉办'
AND a.GRID_PARTYID NOT IN (
'101', '1525', '1549', '1550', '1551', '1552', '1553', '1554', '1555', '1556', '1557', '1558', '1559', '1560',
'1561', '1562', '1563', '1564', '1565', '1566', '1567', '1568', '1569', '1570', '1571', '1572', '1573', '1574',
'1575', '1576', '1577', '1578', '1579', '1580', '1581', '1582', '1583', '1584', '1585', '1586', '1587', '1588',
'1589', '1590', '1591', '1592', '1593', '1594', '1595', '1596', '1597', '1598', '1599', '1600', '1601', '1602',
'1603', '1604', '1605', '1606', '1607', '1608', '1609', '1610', '1611', '1612', '1613', '1614', '1615', '1616',
'1617', '1618', '1619', '1620', '1621', '1622', '1623', '1624', '1625', '1626', '1627', '1628', '1629', '1630',
'1631', '1632', '1633', '1634', '1635', '1636', '1637', '1638', '1639', '1640', '1641', '1642', '1643', '2216',
'2247', '2248', '2252', '2254', '2255', '2258', '2259', '2261', '2265', '2267', '2271', '2272', '2275', '2280',
'2281', '2285', '2287', '2290', '2292', '2293', '2294', '2295', '2298', '2299', '4701', '7487', '7488', '7489',
'7490', '7491', '7492', '7493', '7494', '7495', '7496', '7497', '7498', '7499', '7500', '7501', '7502', '7503',
'7504', '8481', '9841', '10100', '14751', '19177', '130954', '248834', '257176', '1140746', '1607411', '1636766',
'1636767', '1976283', '3368267', '3368281', '3368284', '3368286', '3368288', '3368291', '3537573', '3537682', '4180987',
'4181079', '4400541', '4742418', '4860578', '4885731'
)
GROUP BY a.GRID_UNITID
</select>
</mapper>
Loading…
Cancel
Save