Commit d06593e4 authored by 麻笑宇's avatar 麻笑宇

监督管理 / 施工单位施工总量排名

下钻代码提交
parent 61d7824e
......@@ -94,5 +94,7 @@ public interface JGStatisticsMapper {
Long getNoticeCountTopChart(@Param("dpFilterParamForDetailDto") DPFilterParamForDetailDto dpFilterParamForDetailDto);
Page<Map<String, Object>> noticeCountTopPage(@Param("page") Page<Map<String, Object>> page, @Param("dpFilterParamForDetailDto") DPFilterParamForDetailDto dpFilterParamForDetailDto);
Page<Map<String, Object>> noticeCountTopPageNew(@Param("page") Page<Map<String, Object>> page, @Param("dpFilterParamForDetailDto") DPFilterParamForDetailDto dpFilterParamForDetailDto);
List<Map<String, Object>> noticeCountTopPageByUseUnitCode(@Param("unitCodeList") List<String> unitCodeList, @Param("dpFilterParamForDetailDto") DPFilterParamForDetailDto dpFilterParamForDetailDto);
}
......@@ -2292,7 +2292,17 @@
) T
</select>
<select id="noticeCountTopPage" resultType="java.util.Map">
<select id="noticeCountTopPageNew" resultType="java.util.Map">
SELECT
tbei.use_unit_code AS useUnitCode
FROM
tz_base_enterprise_info tbei
where tbei.unit_type LIKE'%安装改造维修单位%' and tbei.org_code LIKE CONCAT (#{dpFilterParamForDetailDto.orgCode},'%')
<if test="dpFilterParamForDetailDto.companyName != null and dpFilterParamForDetailDto.companyName != ''">
and tbei.use_unit like concat('%',#{dpFilterParamForDetailDto.companyName},'%')
</if>
</select>
<select id="noticeCountTopPageByUseUnitCode" resultType="java.util.Map">
SELECT
tbei.use_unit_code AS useUnitCode,
tbei.unit_type AS unitType,
......@@ -2308,86 +2318,86 @@
IFNULL ( T.num, '0' ) AS installCount
FROM
tz_base_enterprise_info tbei
LEFT JOIN ( SELECT * FROM tz_base_unit_licence GROUP BY unit_code ORDER BY expiry_date DESC ) AS l ON l.unit_code = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS userCount
FROM
tz_base_enterprise_info tbei
INNER JOIN tzs_user_info ui ON tbei.use_unit_code = ui.unit_code
WHERE
tbei.unit_type LIKE'%安装改造维修单位%'
GROUP BY
tbei.use_unit_code
) u ON u."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS equipCount
FROM
tz_base_enterprise_info tbei
INNER JOIN idx_biz_jg_use_info jui ON tbei.use_unit_code = jui.USE_UNIT_CREDIT_CODE
LEFT JOIN idx_biz_jg_other_info joi ON joi.RECORD = jui.RECORD
AND joi.SUPERVISORY_CODE IS NOT NULL
AND joi.SUPERVISORY_CODE != ''
AND joi.SUPERVISORY_CODE != 'null'
WHERE
tbei.unit_type LIKE'%安装改造维修单位%'
GROUP BY
tbei.use_unit_code
) e ON e."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT T
.num AS num,
T.install_unit_credit_code
FROM
(
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_installation_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_maintain_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_reform_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_transfer_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code
) T
) T ON T.install_unit_credit_code = tbei.use_unit_code
where tbei.unit_type LIKE'%安装改造维修单位%' and tbei.org_code LIKE CONCAT (#{dpFilterParamForDetailDto.orgCode},'%')
<if test="dpFilterParamForDetailDto.companyName != null and dpFilterParamForDetailDto.companyName != ''">
and tbei.use_unit like concat('%',#{dpFilterParamForDetailDto.companyName},'%')
</if>
LEFT JOIN ( SELECT * FROM tz_base_unit_licence GROUP BY unit_code ORDER BY expiry_date DESC ) AS l ON l.unit_code = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS userCount
FROM
tz_base_enterprise_info tbei
INNER JOIN tzs_user_info ui ON tbei.use_unit_code = ui.unit_code
WHERE
tbei.unit_type LIKE'%安装改造维修单位%'
GROUP BY
tbei.use_unit_code
) u ON u."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS equipCount
FROM
tz_base_enterprise_info tbei
INNER JOIN idx_biz_jg_use_info jui ON tbei.use_unit_code = jui.USE_UNIT_CREDIT_CODE
LEFT JOIN idx_biz_jg_other_info joi ON joi.RECORD = jui.RECORD
AND joi.SUPERVISORY_CODE IS NOT NULL
AND joi.SUPERVISORY_CODE != ''
AND joi.SUPERVISORY_CODE != 'null'
WHERE
tbei.unit_type LIKE'%安装改造维修单位%'
GROUP BY
tbei.use_unit_code
) e ON e."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT T
.num AS num,
T.install_unit_credit_code
FROM
(
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_installation_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_maintain_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_reform_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_transfer_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code
) T
) T ON T.install_unit_credit_code = tbei.use_unit_code
where tbei.use_unit_code IN
<foreach collection="unitCodeList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper>
......@@ -1736,7 +1736,16 @@ public class JGDPStatisticsServiceImpl {
public Page<Map<String, Object>> noticeCountTopPage(Page<Map<String, Object>> page, DPFilterParamForDetailDto dpFilterParamForDetailDto) {
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamForDetailDto.getCityCode());
dpFilterParamForDetailDto.setOrgCode(orgCode);
return jgStatisticsMapper.noticeCountTopPage(page,dpFilterParamForDetailDto);
Page<Map<String, Object>> returnPage = jgStatisticsMapper.noticeCountTopPageNew(page,dpFilterParamForDetailDto);
List<String> unitCodeList = new ArrayList<>();
for (int i = 0; i < returnPage.getRecords().size(); i++){
unitCodeList.add(returnPage.getRecords().get(i).get("useUnitCode").toString());
}
if (CollectionUtils.isEmpty(unitCodeList)){
return page;
}
returnPage.setRecords(jgStatisticsMapper.noticeCountTopPageByUseUnitCode(unitCodeList, dpFilterParamForDetailDto));
return returnPage;
}
public List<Map<String, Object>> noticeCountTopType(DPFilterParamForDetailDto dpFilterParamForDetailDto) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment