You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
375 lines
14 KiB
375 lines
14 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.elink.esua.epdc.modules.screen.dao.EpdcScreenDao">
|
|
<resultMap type="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenFrontPageDeptInfoResultDTO" id="frontPageDeptInfoListMap">
|
|
<result property="id" column="id"/>
|
|
<result property="name" column="name"/>
|
|
<result property="typeKey" column="typeKey"/>
|
|
<result property="introduction" column="introduction"/>
|
|
<result property="acreage" column="acreage"/>
|
|
<result property="communityNum" column="communityNum"/>
|
|
<result property="gridNum" column="gridNum"/>
|
|
<result property="gridmanNum" column="gridmanNum"/>
|
|
<result property="partyMemberNum" column="partyMemberNum"/>
|
|
<result property="longitude" column="longitude"/>
|
|
<result property="latitude" column="latitude"/>
|
|
<collection property="images" ofType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenImagesDTO">
|
|
<result property="imgType" column="imgType"/>
|
|
<result property="imgUrl" column="imgUrl"/>
|
|
</collection>
|
|
</resultMap>
|
|
<select id="gridGovernanceItemList" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenGridGovernanceItemResultDTO">
|
|
SELECT
|
|
i.ID,
|
|
i.ITEM_CONTENT,
|
|
c.CATEGORY_NAME,
|
|
i.DISTRIBUTE_TIME,
|
|
IFNULL(e.APPROVE_NUM + e.OPPOSE_NUM + e.COMMENT_NUM, 0) AS attentionNum
|
|
FROM
|
|
esua_epdc_events.epdc_item i
|
|
LEFT JOIN esua_epdc_events.epdc_category c ON c.CATEGORY_CODE = i.CATEGORY_CODE
|
|
LEFT JOIN esua_epdc_events.epdc_events e ON e.ID = i.EVENT_ID
|
|
WHERE
|
|
i.DEL_FLAG = '0'
|
|
ORDER BY
|
|
<if test="orderType == 1">
|
|
attentionNum DESC,
|
|
</if>
|
|
i.DISTRIBUTE_TIME DESC
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<select id="itemCategoryStatistics" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenGridGovernanceItemCategoryResultDTO">
|
|
SELECT
|
|
ec.CATEGORY_NAME,
|
|
t.itemNum
|
|
FROM
|
|
esua_epdc_analysis.meta_epdc_category ec
|
|
LEFT JOIN (
|
|
SELECT
|
|
c.CATEGORY_NAME,
|
|
IFNULL( SUM( c.ITEM_TOTLE ), 0 ) itemNum
|
|
FROM
|
|
esua_epdc_analysis.epdc_issue_item_category c
|
|
WHERE
|
|
c.CATEGORY_TYPE = '1'
|
|
GROUP BY
|
|
c.CATEGORY_NAME
|
|
ORDER BY
|
|
itemNum DESC
|
|
) t ON t.CATEGORY_NAME = ec.CATEGORY_NAME
|
|
WHERE
|
|
ec.DEL_FLAG = 0
|
|
AND ec.CATEGORY_TYPE = '0'
|
|
</select>
|
|
|
|
<select id="itemStatusStatistics" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenGridGovernanceItemStatusResultDTO">
|
|
SELECT
|
|
IFNULL(SUM(ITEM_STATE = 0), 0) AS processingNum,
|
|
IFNULL(SUM(ITEM_STATE = 5 OR ITEM_STATE = 10), 0) AS completedNum
|
|
FROM
|
|
esua_epdc_events.epdc_item
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
</select>
|
|
|
|
<select id="difficultItemList" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenGridGovernanceItemDifficultResultDTO">
|
|
SELECT
|
|
di.EVENT_ID,
|
|
di.ITEM_CONTENT,
|
|
di.DISTRIBUTE_TIME,
|
|
di.SPEND_TIME,
|
|
di.HANDLE_TOTAL,
|
|
di.DEPT_TOTAL
|
|
FROM
|
|
esua_epdc_analysis.epdc_difficult_item di,
|
|
esua_epdc_analysis.epdc_item_difficult_config dc
|
|
WHERE
|
|
di.DEL_FLAG = '0'
|
|
AND (
|
|
di.SPEND_TIME >= dc.MIN_SPEND_TIME
|
|
OR di.HANDLE_TOTAL >= dc.MIN_HANDLE_TOTAL
|
|
OR di.DEPT_TOTAL >= dc.MIN_DEPT_TOTAL)
|
|
ORDER BY
|
|
<if test="orderType == 0">
|
|
di.SPEND_TIME DESC,
|
|
</if>
|
|
<if test="orderType == 1">
|
|
di.DEPT_TOTAL DESC,
|
|
</if>
|
|
<if test="orderType == 2">
|
|
di.HANDLE_TOTAL DESC,
|
|
</if>
|
|
di.DISTRIBUTE_TIME DESC
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<select id="governanceRanking" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenGridGovernanceRankingResultDTO">
|
|
SELECT
|
|
DEPT_ID,
|
|
DEPT_NAME,
|
|
REGISTRATION_RATE,
|
|
RESPONSE_RATE,
|
|
RESOLUTION_RATE,
|
|
SATISFACTION_RATE,
|
|
AUTONOMY_RATE
|
|
FROM
|
|
esua_epdc_analysis.epdc_screen_governance_ranking
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND STATISTIC_TYPE = #{statisticType}
|
|
ORDER BY
|
|
REGISTRATION_RATE DESC,
|
|
RESPONSE_RATE DESC,
|
|
RESOLUTION_RATE DESC,
|
|
SATISFACTION_RATE DESC,
|
|
AUTONOMY_RATE DESC
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<select id="noticeList" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenPartyBuildingNoticeListResultDTO">
|
|
SELECT
|
|
n.ID,
|
|
n.NOTICE_TITLE,
|
|
n.NOTICE_CONTENT,
|
|
n.DEPT_NAME,
|
|
n.CREATED_TIME,
|
|
n.TOP_FLAG
|
|
FROM
|
|
esua_epdc_news.epdc_notice n
|
|
LEFT JOIN esua_epdc_news.epdc_module_type t ON t.id = n.TYPE_ID
|
|
WHERE
|
|
n.DEL_FLAG = '0'
|
|
AND n.NOTICE_RELEASE_STATE = '1'
|
|
AND n.NOTICE_UP_DOWN_STATE = '1'
|
|
AND n.TOP_FLAG = '1'
|
|
ORDER BY
|
|
n.TOP_TIME DESC,
|
|
n.CREATED_TIME DESC
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<select id="partyOrgActList" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenPartyBuildingPartyOrgActResultDTO">
|
|
SELECT
|
|
d.id AS deptId,
|
|
d.`name` AS deptName,
|
|
IFNULL( a.ACT_ZTDR_NUM, 0 ) AS actZtdrNum,
|
|
IFNULL( a.ACT_SHYK_NUM, 0 ) AS actShykNum,
|
|
IFNULL( a.ACT_LJGJ_NUM, 0 ) AS actLjgjNum,
|
|
IFNULL( a.ACT_ZTDR_PERSON_NUM, 0 ) AS actZtdrPersonNum,
|
|
IFNULL( a.ACT_SHYK_PERSON_NUM, 0 ) AS actShykPersonNum,
|
|
IFNULL( a.ACT_LJGJ_PERSON_NUM, 0 ) AS actLjgjPersonNum
|
|
FROM
|
|
esua_epdc_admin.sys_dept d
|
|
LEFT JOIN esua_epdc_analysis.epdc_screen_community_act_statistics a ON a.DEPT_ID = d.id
|
|
AND a.DEL_FLAG = '0'
|
|
WHERE
|
|
d.del_flag = 0
|
|
AND d.type_key = 'community_party'
|
|
ORDER BY
|
|
<if test="orderType == 0">
|
|
actZtdrNum+actShykNum+actLjgjNum DESC,
|
|
</if>
|
|
<if test="orderType == 1">
|
|
actZtdrPersonNum+actShykPersonNum+actLjgjPersonNum DESC,
|
|
</if>
|
|
d.`name`
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<select id="partyOrgTypeList" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenPartyBuildingPartyOrgTypeResultDTO">
|
|
SELECT
|
|
ot.ID,
|
|
ot.TYPE_NAME,
|
|
COUNT( po.ID ) AS partyOrgNum
|
|
FROM
|
|
esua_epdc_admin.epdc_party_org_type ot
|
|
LEFT JOIN esua_epdc_admin.epdc_party_org po ON po.TYPE_CODE = ot.TYPE_CODE
|
|
AND po.DEL_FLAG = '0'
|
|
WHERE
|
|
ot.DEL_FLAG = '0'
|
|
AND `ENABLE` = '1'
|
|
GROUP BY
|
|
ot.ID
|
|
ORDER BY
|
|
SORT
|
|
</select>
|
|
|
|
<select id="partyOrgList" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenPartyBuildingPartyOrgResultDTO">
|
|
SELECT
|
|
ID,
|
|
PARTY_ORG_NAME,
|
|
INTRODUCTION,
|
|
TWO_COMMITTEES,
|
|
PARTY_MEMBER_NUM,
|
|
LONGITUDE,
|
|
LATITUDE
|
|
FROM
|
|
esua_epdc_admin.epdc_party_org
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
</select>
|
|
|
|
<select id="brightIdentity" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenPartyBuildingBrightIdentityResultDTO">
|
|
SELECT
|
|
ui.ID,
|
|
u.REAL_NAME,
|
|
u.FACE_IMG,
|
|
u.MOBILE,
|
|
ui.MOTTO,
|
|
ui.PROMISE,
|
|
ui.SERVICE_AREA
|
|
FROM
|
|
esua_epdc_user.epdc_user_info ui
|
|
LEFT JOIN esua_epdc_user.epdc_user u ON u.ID = ui.USER_ID
|
|
WHERE
|
|
ui.DEL_FLAG = '0'
|
|
AND ui.RECOMMEND_FLAG = '1'
|
|
ORDER BY
|
|
ui.RECOMMEND_TIME DESC,
|
|
ui.CREATED_TIME DESC
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<select id="partyMemberAge" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenPartyBuildingPartyMemberAgeResultDTO">
|
|
SELECT
|
|
IFNULL(SUM( AGE_EIGHTEEN_THIRTY ), 0) AS ageEighteenThirty,
|
|
IFNULL(SUM( AGE_THIRTY_ONE_FORTY ), 0) AS ageThirtyOneForty,
|
|
IFNULL(SUM( AGE_FORTY_ONE_FIFTY ), 0) AS ageFortyOneFifty,
|
|
IFNULL(SUM( AGE_FIFTY_ONE_SIXTY ), 0) AS ageFiftyOneSixty,
|
|
IFNULL(SUM( AGE_SIXTY_ONE_SEVENTY ), 0) AS ageSixtyOneSeventy,
|
|
IFNULL(SUM( AGE_OVER_SEVENTY ), 0) AS ageOverSeventy
|
|
FROM
|
|
esua_epdc_analysis.epdc_screen_party_member_age_statistics
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
</select>
|
|
|
|
<select id="frontPageDeptInfoList" resultMap="frontPageDeptInfoListMap">
|
|
SELECT
|
|
sd.id AS id,
|
|
sd.name AS name,
|
|
sd.type_key AS typeKey,
|
|
sdi.introduction AS introduction,
|
|
sdi.COMMUNITY_NUM AS communityNum,
|
|
sdi.GRID_NUM AS gridNum,
|
|
sdi.GRIDMAN_NUM AS gridmanNum,
|
|
sdi.PARTY_MEMBER_NUM AS partyMemberNum,
|
|
sdi.LONGITUDE AS longitude,
|
|
sdi.LATITUDE AS latitude,
|
|
sdi.ACREAGE AS acreage,
|
|
edi.IMG_URL AS imgUrl,
|
|
edi.IMG_TYPE AS imgType
|
|
FROM sys_dept_info sdi
|
|
LEFT JOIN sys_dept sd ON sd.ID = sdi.DEPT_ID
|
|
LEFT JOIN epdc_admin_img edi ON edi.REFERENCE_ID = sdi.DEPT_ID
|
|
WHERE sd.del_flag = '0'
|
|
AND sdi.DEL_FLAG = '0'
|
|
AND edi.DEL_FLAG = '0'
|
|
<if test="typeKey != null and typeKey !=''">
|
|
AND sd.type_key = #{typeKey}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="frontPagePersonInfoStatisticsList"
|
|
resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenFrontPagePersonInfoStatisticsResultDTO">
|
|
SELECT
|
|
sum(if(LIVE_TYPE='0',PERSON_NUM,0)) as permanentResidenceNum,
|
|
sum(if(LIVE_TYPE='1',PERSON_NUM,0)) as floatingPopulationNum,
|
|
sum(if(LIVE_TYPE='2',PERSON_NUM,0)) as overseasPopulationNum
|
|
FROM esua_epdc_analysis.epdc_screen_person_live_statistics
|
|
WHERE DEL_FLAG = '0'
|
|
</select>
|
|
|
|
<select id="frontPageHouseTypeStatistics"
|
|
resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenFrontPageHouseTypeStatisticsResultDTO">
|
|
SELECT
|
|
sum(if(HOUSE_TYPE ='0',HOUSE_NUM ,0)) as aloneLiveNum,
|
|
sum(if(HOUSE_TYPE ='1',HOUSE_NUM ,0)) as rentNum,
|
|
sum(if(HOUSE_TYPE ='2',HOUSE_NUM ,0)) as dormitoryNum,
|
|
sum(if(HOUSE_TYPE ='3',HOUSE_NUM ,0)) as vacantNum,
|
|
sum(if(HOUSE_TYPE ='4',HOUSE_NUM ,0)) as otherNum
|
|
FROM esua_epdc_analysis.epdc_screen_house_type_statistics
|
|
WHERE DEL_FLAG = '0'
|
|
</select>
|
|
|
|
<select id="epidemicVaccinationStatistics"
|
|
resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenEpidemicVaccinationStatisticsResultDTO">
|
|
SELECT
|
|
SUM(VACCINATION_COMPLETED_NUM) as vaccinationCompletedNum,
|
|
SUM(ONE_SHOT_NUM) as oneShotNum,
|
|
SUM(TWO_SHOTS_NUM) as twoShotsNum,
|
|
SUM(NOT_VACCINATED_NUM) as notVaccinatedNum
|
|
FROM esua_epdc_analysis.epdc_screen_vaccination_statistics
|
|
WHERE DEL_FLAG = '0'
|
|
</select>
|
|
|
|
<select id="epidemicCommunityVaccinationStatisticsList"
|
|
resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenEpidemicCommunityVaccinationStatisticsResultDTO">
|
|
SELECT
|
|
DEPT_ID,
|
|
DEPT_NAME,
|
|
COMMUNITY_TOTAL_NUM AS communityNum,
|
|
VACCINATION_COMPLETED_NUM,
|
|
ONE_SHOT_NUM,
|
|
TWO_SHOTS_NUM,
|
|
NOT_VACCINATED_NUM,
|
|
BEING_VACCINATED_NUM,
|
|
LONGITUDE,
|
|
LATITUDE
|
|
FROM esua_epdc_analysis.epdc_screen_vaccination_statistics
|
|
WHERE DEL_FLAG = '0'
|
|
ORDER BY
|
|
<if test="orderType == 0">
|
|
VACCINATION_COMPLETED_NUM DESC,
|
|
</if>
|
|
<if test="orderType == 1">
|
|
ONE_SHOT_NUM DESC,
|
|
</if>
|
|
<if test="orderType == 2">
|
|
TWO_SHOTS_NUM DESC,
|
|
</if>
|
|
<if test="orderType == 3">
|
|
NOT_VACCINATED_NUM DESC,
|
|
</if>
|
|
DEPT_NAME
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<select id="epidemicCompanyVaccinationStatisticsList"
|
|
resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenEpidemicCompanyVaccinationStatisticsResultDTO">
|
|
SELECT
|
|
COMPANY,
|
|
SUM(VACCINATION_NUM) AS vaccinationNum
|
|
FROM esua_epdc_analysis.epdc_screen_vaccination_company_statistics
|
|
WHERE DEL_FLAG = '0'
|
|
GROUP BY
|
|
COMPANY
|
|
ORDER BY vaccinationNum DESC
|
|
</select>
|
|
|
|
<select id="vaccinationAgeVaccinationStatistics"
|
|
resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenVaccinationAgeVaccinationStatisticsResultDTO">
|
|
SELECT
|
|
SUM(AGE_EIGHTEEN_THIRTY) AS ageEighteenThirty,
|
|
SUM(AGE_THIRTY_ONE_FORTY) AS ageThirtyOneForty,
|
|
SUM(AGE_FORTY_ONE_FIFTY) AS ageFortyOneFifty,
|
|
SUM(AGE_FIFTY_ONE_SIXTY) AS ageFiftyOneSixty,
|
|
SUM(AGE_OVER_SIXTY) AS ageOverSixty
|
|
FROM esua_epdc_analysis.epdc_screen_vaccination_age_statistics
|
|
WHERE DEL_FLAG = '0'
|
|
AND STATISTIC_TYPE = #{statisticType}
|
|
</select>
|
|
|
|
<select id="vaccinationPersonVaccinationStatistics"
|
|
resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.EpdcScreenVaccinationPersonVaccinationStatisticsResultDTO">
|
|
SELECT
|
|
SUM(PERMANENT_RESIDENCE_NUM) AS permanentResidenceNum,
|
|
SUM(FLOATING_POPULATION_NUM) AS floatingPopulationNum,
|
|
SUM(FOREIGN_POPULATION_NUM) AS foreignPopulationNum
|
|
FROM esua_epdc_analysis.epdc_screen_vaccination_person_statistics
|
|
WHERE DEL_FLAG = '0'
|
|
AND STATISTIC_TYPE = #{statisticType}
|
|
</select>
|
|
</mapper>
|
|
|