Browse Source

add:水闸统计

master_tdsql
“lyd” 2 months ago
parent
commit
ff0cfc7af0
  1. 4
      shuili-admin/src/main/resources/application.yml
  2. 24
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfRecordMapper.java
  3. 6
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfRecordService.java
  4. 8
      shuili-system/src/main/java/com/kms/yxgh/sz/controller/SzRecordController.java

4
shuili-admin/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring:
profiles:
# include: dev,druid-dev
# include: sy,druid-sy
include: sy,druid-sy
# include: zhishiku,druid-zhishiku
include: test,druid-test
# include: test,druid-test

24
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfRecordMapper.java

@ -30,10 +30,13 @@ public interface DfRecordMapper extends BaseMapper<DfRecord> {
"select count(*) from bs_sgc_df_xsjhjlz where RECORD_ID " +
"in ( "+
"select jl.id from bs_sgc_df_xsjhjl as jl "+
"left join att_dike_base base on base.dike_code=jl.dike_code"+
"left join att_dike_base base on base.dike_code=jl.dike_code "+
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'> "+
" and df.adcd like concat(#{dto.adcdQx}, '%') "+
" and base.adcd like concat(#{dto.adcdQx}, '%') "+
"</if> "+
"<if test='dto.handleStatus != null and dto.handleStatus != \"\"'> " +
"where jl.handle_status=#{dto.handleStatus} "+
"</if> " +
"group by jl.DIKE_CODE,jl.id "+
") "+
"<if test='dto.patrolStart != null and dto.patrolEnd != \"\"'> "+
@ -43,15 +46,13 @@ public interface DfRecordMapper extends BaseMapper<DfRecord> {
"<if test='dto.problem != null and dto.problem != \"\"'> " +
"AND status=#{dto.problem} "+
"</if> " +
"<if test='dto.handleStatus != null and dto.handleStatus != \"\"'> " +
"AND handle_status=#{dto.handleStatus} "+
"</if> " +
"</script>")
int dfNumber(@Param("dto") DfYhHiddenDangerQueDto dto);
@Select("<script>" +
"select adb.adcd,lz.status as problem,count(1) as count from bs_sgc_df_xsjhjlz as lz "+
"select base.adcd,lz.status as problem,count(1) as count from bs_sgc_df_xsjhjlz as lz "+
"left join bs_sgc_df_xsjhjl hj on hj.id=lz.RECORD_ID "+
"left join att_dike_base base on base.dike_code=hj.dike_code "+
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'> "+
@ -70,14 +71,15 @@ public interface DfRecordMapper extends BaseMapper<DfRecord> {
List<DfYhHiddenDangerModel> yhNumberData(@Param("dto") DfYhHiddenDangerQueDto dto);
@Select("<script>" +
"select base.adcd,lz.handle_status,count(1) as count from bs_sgc_df_xsjhjlz as lz "+
"select base.adcd,hj.handle_status,count(1) as count from bs_sgc_df_xsjhjlz as lz "+
"left join bs_sgc_df_xsjhjl hj on hj.id=lz.RECORD_ID "+
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'> "+
"left join att_dike_base base on base.dike_code=hj.dike_code and base.adcd like concat(#{dto.adcdQx}, '%') "+
"</if>"+
"<if test='dto.handleStatus != null and dto.handleStatus != \"\"'> " +
"AND hj.handle_status=#{dto.handleStatus} "+
"</if> " +
"left join att_dike_base base on base.dike_code=hj.dike_code "+
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'> "+
" and base.adcd like concat(#{dto.adcdQx}, '%') "+
"</if>"+
"where 1=1 "+
"<if test='dto.patrolStart != null and dto.patrolEnd != \"\"'> "+
"AND (DATE_FORMAT(lz.create_time, '%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(#{dto.patrolStart} , '%Y-%m-%d %H:%i:%s') "+
@ -86,7 +88,7 @@ public interface DfRecordMapper extends BaseMapper<DfRecord> {
"<if test='dto.problem != null and dto.problem != \"\"'> "+
"AND lz.status=#{dto.problem} "+
"</if> " +
"group by base.adcd ,lz.handle_status "+
"group by base.adcd ,hj.handle_status "+
"</script>")
List<DfYhHiddenDangerModel> clfNumberData(@Param("dto") DfYhHiddenDangerQueDto dto);

6
shuili-system/src/main/java/com/kms/yxgh/df/service/DfRecordService.java

@ -103,10 +103,12 @@ public class DfRecordService extends BaseService<DfRecordMapper, DfRecord> {
// 处理数量数据
dto.setHandleStatus("2");
List<DfYhHiddenDangerModel> clModel = baseMapper.clfNumberData(dto);
if (!CollectionUtil.isEmpty(clModel)) {
list.addAll(clModel);
if (CollectionUtil.isEmpty(clModel)) {
return dfYhCharHiddenDangerDto;
}
list.addAll(clModel);
Map<String, List<DfYhHiddenDangerModel>> groupingByList = list.stream()
.filter(s -> !StringUtils.isEmpty(s.getAdcd())) // 过滤掉空字符串
.collect(Collectors.groupingBy(DfYhHiddenDangerModel::getAdcd));
if (!CollectionUtil.isEmpty(groupingByList)) {

8
shuili-system/src/main/java/com/kms/yxgh/sz/controller/SzRecordController.java

@ -41,9 +41,9 @@ public class SzRecordController {
/**
* 查询水闸巡视检查记录列表
*/
@PostMapping("/szStatistics")
@PostMapping("/statistics")
@ApiOperation("水闸巡视检查统计图")
public Response<SzCharInfoDto> szStatistics(@RequestBody SzCharInfoQueDto dto) {
public Response<SzCharInfoDto> statistics(@RequestBody SzCharInfoQueDto dto) {
return Response.ok(szRecordService.szStatistics(dto));
}
@ -51,9 +51,9 @@ public class SzRecordController {
/**
* 查询水闸巡视检查记录列表
*/
@PostMapping("/szStatistics")
@PostMapping("/hiddenDanger")
@ApiOperation("水闸巡视检查统计图")
public Response<SzCharItemDto> szHiddenDanger(@RequestBody SzCharInfoItemQueDto dto) {
public Response<SzCharItemDto> hiddenDanger(@RequestBody SzCharInfoItemQueDto dto) {
return Response.ok(szRecordService.szHiddenDanger(dto));
}

Loading…
Cancel
Save