Commit 5ac98081 authored by 麻笑宇's avatar 麻笑宇

1.监管大屏新增施工情况列表(近30天)接口

2。监管大屏新增施工单位施工总量排名TOP10接口
parent a573b87f
......@@ -76,4 +76,8 @@ public interface DPStatisticsMapper {
Long constructionNoticeCount(@Param("orgCode") String orgCode);
Long changeCountByOrgCode(@Param("orgCode") String orgCode);
List<Map<String, Object>> selectNoticeList(@Param("orgCode") String orgCode, @Param("time") String time);
List<Map<String, Object>> selectNoticeCountTopTen(@Param("orgCode") String orgCode, @Param("time") String time);
}
......@@ -637,4 +637,101 @@
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
) T
</select>
<select id="selectNoticeList" resultType="java.util.Map">
SELECT
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.install_start_date AS constructionDate
FROM
tzs_jg_installation_notice T
WHERE
install_start_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' ) UNION ALL
SELECT
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.plan_date AS constructionDate
FROM
tzs_jg_maintain_notice T
WHERE
plan_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' ) UNION ALL
SELECT
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.plan_date AS constructionDate
FROM
tzs_jg_reform_notice T
WHERE
plan_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' ) UNION ALL
SELECT
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.plan_date AS constructionDate
FROM
tzs_jg_transfer_notice T
WHERE
plan_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</select>
<select id="selectNoticeCountTopTen" resultType="java.util.Map">
SELECT SUM( T.num ) AS count,
T.company
FROM
(
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_installation_notice T
WHERE
install_start_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{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
plan_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{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
plan_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{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
plan_date &gt;= #{time}
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
GROUP BY
T.install_unit_credit_code
) T
GROUP BY
T.install_unit_credit_code
ORDER BY
COUNT DESC
</select>
</mapper>
......@@ -268,4 +268,26 @@ public class JGDPStatisticsController {
}
return ResponseHelper.buildResponse(statisticsService.JGCenterMapCountForOverview(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右屏-施工情况列表(近30天)", notes = "监管大屏-右屏-施工情况列表(近30天)")
@PostMapping(value = "/noticeList")
public ResponseModel<List<Map<String, Object>>> noticeList(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.noticeList(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右屏-施工单位施工总量排名TOP10", notes = "大屏总览-右屏-施工单位施工总量排名TOP10")
@PostMapping(value = "/noticeCountTop")
public ResponseModel<List<Map<String, Object>>> noticeCountTop(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.noticeCountTop(dpFilterParamDto));
}
}
......@@ -1647,4 +1647,18 @@ public class JGDPStatisticsServiceImpl {
}).collect(Collectors.toList());
return result;
}
public List<Map<String, Object>> noticeList(DPFilterParamDto dpFilterParamDto) {
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
String time = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String,Object>> list = dpStatisticsMapper.selectNoticeList(orgCode,time);
return list;
}
public List<Map<String, Object>> noticeCountTop(DPFilterParamDto dpFilterParamDto) {
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
String time = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String,Object>> list = dpStatisticsMapper.selectNoticeCountTopTen(orgCode,time);
return list;
}
}
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