Browse Source

fixbug:堤防

release-sy-tdsql
“lyd” 1 month ago
parent
commit
2c6c6c096c
  1. 3
      shuili-system/src/main/java/com/kms/yxgh/common/dto/CountDateDto.java
  2. 1
      shuili-system/src/main/java/com/kms/yxgh/common/enums/DfYhV2StatusEnum.java
  3. 17
      shuili-system/src/main/java/com/kms/yxgh/common/enums/StaticIndexEnum.java
  4. 8
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingProblemV2Mapper.java
  5. 2
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingRecordV2Mapper.java
  6. 2
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhV2Mapper.java

3
shuili-system/src/main/java/com/kms/yxgh/common/dto/CountDateDto.java

@ -4,7 +4,6 @@ import lombok.Data;
@Data
public class CountDateDto {
private String level;
private String myData;
private String myDate;
private String mySum;
}

1
shuili-system/src/main/java/com/kms/yxgh/common/enums/DfYhV2StatusEnum.java

@ -13,6 +13,7 @@ public enum DfYhV2StatusEnum {
YES_UNDER("已养护", "6");
private final String name;
private final String value;

17
shuili-system/src/main/java/com/kms/yxgh/common/enums/StaticIndexEnum.java

@ -45,22 +45,22 @@ public enum StaticIndexEnum {
DF_QX_DJ_LX_SUM("零星", sp -> {
DfCheckingProblemV2Mapper mapper = SpringUtils.getBean(DfCheckingProblemV2Mapper.class);
List<CountDateDto> list = mapper.countLevel(sp, PatrolMaintenanceCategory.DJ_LX);
return levelGroup(list);
return dataGroup(list);
}, "个", "0"),
DF_QX_DJ_YB_SUM("一般", sp -> {
DfCheckingProblemV2Mapper mapper = SpringUtils.getBean(DfCheckingProblemV2Mapper.class);
List<CountDateDto> list = mapper.countLevel(sp, PatrolMaintenanceCategory.DJ_YB);
return levelGroup(list);
return dataGroup(list);
}, "个", "0"),
DF_QX_DJ_JD_SUM("较大", sp -> {
DfCheckingProblemV2Mapper mapper = SpringUtils.getBean(DfCheckingProblemV2Mapper.class);
List<CountDateDto> list = mapper.countLevel(sp, PatrolMaintenanceCategory.DJ_JD);
return levelGroup(list);
return dataGroup(list);
}, "个", "0"),
DF_QX_DJ_ZD_SUM("重大", sp -> {
DfCheckingProblemV2Mapper mapper = SpringUtils.getBean(DfCheckingProblemV2Mapper.class);
List<CountDateDto> list = mapper.countLevel(sp, PatrolMaintenanceCategory.DJ_ZD);
return levelGroup(list);
return dataGroup(list);
}, "个", "0"),
@ -127,20 +127,13 @@ public enum StaticIndexEnum {
}
private static Map<String, String> levelGroup(List<CountDateDto> list) {
if (CollectionUtil.isEmpty(list) && list.isEmpty()) {
return Collections.emptyMap();
}
return list.stream()
.collect(Collectors.toMap(CountDateDto::getLevel, CountDateDto::getMySum));
}
public static Map<String, String> dataGroup(List<CountDateDto> list) {
if (CollectionUtil.isEmpty(list) && list.isEmpty()) {
return Collections.emptyMap();
}
return list.stream()
.collect(Collectors.toMap(CountDateDto::getMyData, CountDateDto::getMySum));
.collect(Collectors.toMap(CountDateDto::getMyDate, CountDateDto::getMySum));
}

8
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingProblemV2Mapper.java

@ -35,7 +35,7 @@ public interface DfCheckingProblemV2Mapper extends BaseMapper<DfCheckingProblemV
@Select("<script> " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myData,count(*) as mySum from bs_sgc_df_xcqx where 1=1 " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_df_xcqx where 1=1 " +
"<if test='data.startTime != null'> and create_time &gt;= #{data.startTime} </if> " +
"<if test='data.endTime != null'> and create_time &lt;= #{data.endTime} </if> " +
"<if test='data.code != null and data.code != \"\"'>" +
@ -50,7 +50,7 @@ public interface DfCheckingProblemV2Mapper extends BaseMapper<DfCheckingProblemV
@Select("<script> " +
"select problem_level as level,count(*) as mySum from bs_sgc_df_xcqx where 1=1 " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_df_xcqx where 1=1 " +
"<if test='data.startTime != null'> and create_time &gt;= #{data.startTime} </if> " +
"<if test='data.endTime != null'> and create_time &lt;= #{data.endTime} </if> " +
"<if test='data.code != null and data.code != \"\"'>" +
@ -59,13 +59,13 @@ public interface DfCheckingProblemV2Mapper extends BaseMapper<DfCheckingProblemV
"<if test='category != null'>" +
"and category = #{category.value} " +
"</if>" +
"group by problem_level " +
"group by DATE_FORMAT(create_time, '%Y-%m-%d') " +
"</script>")
List<CountDateDto> countLevel(@Param("data") ObjectStatisticQueDto sp, @Param("category") PatrolMaintenanceCategory category);
@Select("<script> " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myData,count(*) as mySum from bs_sgc_df_xcqx where 1=1 " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_df_xcqx where 1=1 " +
"<if test='data.startTime != null'> and xm.create_time &gt;= #{data.startTime} </if> " +
"<if test='data.endTime != null'> and xm.create_time &lt;= #{data.endTime} </if> " +
"<if test='data.code != null and data.code != \"\"'>" +

2
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingRecordV2Mapper.java

@ -40,7 +40,7 @@ public interface DfCheckingRecordV2Mapper extends BaseMapper<DfCheckingRecord> {
@Select("<script> " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myData,count(*) as mySum from bs_sgc_df_xsxcjl where 1=1 " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_df_xsxcjl where 1=1 " +
"<if test='data.startTime != null' > and create_time &gt;= #{data.startTime} </if> " +
"<if test='data.endTime != null'> and create_time &lt;= #{data.endTime} </if> " +
"<if test='data.code != null and data.code != \"\"'>" +

2
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhV2Mapper.java

@ -41,7 +41,7 @@ public interface DfYhV2Mapper extends BaseMapper<DfYhV2> {
@Select("<script> " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myData,count(*) as mySum from bs_sgc_df_xcyj where 1=1 " +
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_df_xcyj where 1=1 " +
"<if test='data.startTime != null'> and create_time &gt;= #{data.startTime} </if> " +
"<if test='data.endTime != null'> and create_time &lt;= #{data.endTime} </if> " +
"<if test='data.code != null and data.code != \"\"'>" +

Loading…
Cancel
Save