diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java index 5459eca..021d494 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java @@ -25,6 +25,6 @@ * 累计告警天数 */ @ApiModelProperty(value = "累计告警天数") - private Integer count; + private Integer countDays; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java index 5459eca..021d494 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java @@ -25,6 +25,6 @@ * 累计告警天数 */ @ApiModelProperty(value = "累计告警天数") - private Integer count; + private Integer countDays; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index cea3398..6db0ce6 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -25,6 +25,8 @@ import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; @@ -207,13 +209,17 @@ List warnMonthAlarmsResponseInfoList = monitoringWarnRecordService.selectWarnMonthListTotal(request.getProjectCode()); LocalDate now = LocalDate.now(); int currentYear = now.getYear(); + List stringx = new ArrayList<>(); + List stringy = new ArrayList<>(); warnMonthAlarmsResponseInfoList.stream().filter(info -> info.getWarnYear() == currentYear).collect(Collectors.toList()); if(warnMonthAlarmsResponseInfoList.isEmpty()){ - throw new InnerAuthException("该项目下没有告警信息1"); + warnMonthAlarmsResponse.setXAxis(stringx); + warnMonthAlarmsResponse.setYAxis(stringy); + return warnMonthAlarmsResponse; } warnMonthAlarmsResponse.setWarnListInfo(warnMonthAlarmsResponseInfoList); warnMonthAlarmsResponse.setXAxis(warnMonthAlarmsResponseInfoList.stream() - .map(WarnMonthAlarmsResponseInfo::getWarnMonth) + .map(info -> info.getWarnMonth() + "月") .collect(Collectors.toList())); warnMonthAlarmsResponse.setYAxis(warnMonthAlarmsResponseInfoList.stream() .map(WarnMonthAlarmsResponseInfo::getWarnNumber) @@ -231,11 +237,13 @@ sortedEntries.sort(Map.Entry.comparingByValue(Comparator.reverseOrder())); if (sortedEntries.size() >= 2) { long sumOfTopTwo = sortedEntries.get(0).getValue() + sortedEntries.get(1).getValue(); - double percentage = ((double) sumOfTopTwo / totalSnCount) * 100; - warnMonthAlarmsResponse.setDeviceCountProportion(percentage); + BigDecimal percentage = new BigDecimal(((double) sumOfTopTwo) / totalSnCount) + .multiply(BigDecimal.valueOf(100)) + .setScale(2, RoundingMode.HALF_UP); + warnMonthAlarmsResponse.setDeviceCountProportion(percentage.doubleValue()); warnMonthAlarmsResponse.setWarnDeviceCount(sumOfTopTwo); - warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(0).getKey()); - warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(1).getKey()); + warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(1).getKey()); + warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(0).getKey()); } else { warnMonthAlarmsResponse.setDeviceCountProportion(100D); warnMonthAlarmsResponse.setWarnDeviceCount(sortedEntries.get(0).getValue()); @@ -254,50 +262,48 @@ List listWarinTotalDays=this.listWarinTotalDays(warnMonitoringRequest); //累计站点个数 - long uniqueSnCount = listWarinTotalDays.stream().map(WarnMonitoringResponseInfo::getSn).distinct().count(); + long totalCount = listWarinTotalDays.stream().map(WarnMonitoringResponseInfo::getSn).distinct().count(); //告警超过15天的站点 - long count1 = listWarinTotalDays.stream().filter(info -> info.getCount() > 15).map(WarnMonitoringResponseInfo::getSn).distinct().count(); - + long count1 = listWarinTotalDays.stream().filter(info -> info.getCountDays() > 15).map(WarnMonitoringResponseInfo::getSn).distinct().count(); warnMonitoringResponse.setWarnmoitoringExceedDay(count1); - warnMonitoringResponse.setWarnmoitoringCountDay(uniqueSnCount); + warnMonitoringResponse.setWarnmoitoringCountDay(totalCount); warnMonitoringResponse.setProjectCode(request.getProjectCode()); warnMonitoringResponse.setWarnmoitoringListInfo(listWarinTotalDays); //累计告警天数统计,并计算百分比 Map durationToSnCount = new HashMap<>(); - listWarinTotalDays.stream() - .collect(Collectors.groupingBy(WarnMonitoringResponseInfo::getSn, - Collectors.mapping(WarnMonitoringResponseInfo::getCount, - Collectors.toList()))) - .forEach((sn, days) -> { - days.stream() - .forEach(day -> { - String key; - if (day <= 1) { - key = "无告警"; - } else if (day >=2 && day <= 3) { - key = "2-3天"; - } else if (day >=4 && day <= 6) { - key = "4-6天"; - } else if (day >=7 && day <= 15) { - key = "7-15天"; - } else { - key = ">15天"; - } - durationToSnCount.merge(key, 1L, Long::sum); - }); - }); + List allDurationRanges = Arrays.asList("无告警", "2-3天", "4-6天", "7-15天", ">15天"); + allDurationRanges.forEach(range -> durationToSnCount.put(range, 0L)); + listWarinTotalDays.forEach(info -> { + int day = info.getCountDays(); + String key; + if (day <= 1) { + key = "无告警"; + } else if (day >= 2 && day <= 3) { + key = "2-3天"; + } else if (day >= 4 && day <= 6) { + key = "4-6天"; + } else if (day >= 7 && day <= 15) { + key = "7-15天"; + } else { + key = ">15天"; + } + durationToSnCount.merge(key, 1L, Long::sum); + }); List warnMonitoringResponseDaysInfoList = new ArrayList(); // 计算百分比并添加到结果列表中 durationToSnCount.forEach((durationRange, count) -> { - double percentage = (double) count / uniqueSnCount * 100; - warnMonitoringResponseDaysInfoList.add(new WarnMonitoringResponseDaysInfo(durationRange,percentage)); + BigDecimal percentage = new BigDecimal(((double) count) / totalCount) + .multiply(BigDecimal.valueOf(100)) + .setScale(2, RoundingMode.HALF_UP); + warnMonitoringResponseDaysInfoList.add(new WarnMonitoringResponseDaysInfo(durationRange,percentage.doubleValue())); }); warnMonitoringResponse.setWarnmoitoringDaysListInfo(warnMonitoringResponseDaysInfoList); + System.out.println(warnMonitoringResponseDaysInfoList); return new WarnMonitoringResponse(); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java index 5459eca..021d494 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java @@ -25,6 +25,6 @@ * 累计告警天数 */ @ApiModelProperty(value = "累计告警天数") - private Integer count; + private Integer countDays; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index cea3398..6db0ce6 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -25,6 +25,8 @@ import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; @@ -207,13 +209,17 @@ List warnMonthAlarmsResponseInfoList = monitoringWarnRecordService.selectWarnMonthListTotal(request.getProjectCode()); LocalDate now = LocalDate.now(); int currentYear = now.getYear(); + List stringx = new ArrayList<>(); + List stringy = new ArrayList<>(); warnMonthAlarmsResponseInfoList.stream().filter(info -> info.getWarnYear() == currentYear).collect(Collectors.toList()); if(warnMonthAlarmsResponseInfoList.isEmpty()){ - throw new InnerAuthException("该项目下没有告警信息1"); + warnMonthAlarmsResponse.setXAxis(stringx); + warnMonthAlarmsResponse.setYAxis(stringy); + return warnMonthAlarmsResponse; } warnMonthAlarmsResponse.setWarnListInfo(warnMonthAlarmsResponseInfoList); warnMonthAlarmsResponse.setXAxis(warnMonthAlarmsResponseInfoList.stream() - .map(WarnMonthAlarmsResponseInfo::getWarnMonth) + .map(info -> info.getWarnMonth() + "月") .collect(Collectors.toList())); warnMonthAlarmsResponse.setYAxis(warnMonthAlarmsResponseInfoList.stream() .map(WarnMonthAlarmsResponseInfo::getWarnNumber) @@ -231,11 +237,13 @@ sortedEntries.sort(Map.Entry.comparingByValue(Comparator.reverseOrder())); if (sortedEntries.size() >= 2) { long sumOfTopTwo = sortedEntries.get(0).getValue() + sortedEntries.get(1).getValue(); - double percentage = ((double) sumOfTopTwo / totalSnCount) * 100; - warnMonthAlarmsResponse.setDeviceCountProportion(percentage); + BigDecimal percentage = new BigDecimal(((double) sumOfTopTwo) / totalSnCount) + .multiply(BigDecimal.valueOf(100)) + .setScale(2, RoundingMode.HALF_UP); + warnMonthAlarmsResponse.setDeviceCountProportion(percentage.doubleValue()); warnMonthAlarmsResponse.setWarnDeviceCount(sumOfTopTwo); - warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(0).getKey()); - warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(1).getKey()); + warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(1).getKey()); + warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(0).getKey()); } else { warnMonthAlarmsResponse.setDeviceCountProportion(100D); warnMonthAlarmsResponse.setWarnDeviceCount(sortedEntries.get(0).getValue()); @@ -254,50 +262,48 @@ List listWarinTotalDays=this.listWarinTotalDays(warnMonitoringRequest); //累计站点个数 - long uniqueSnCount = listWarinTotalDays.stream().map(WarnMonitoringResponseInfo::getSn).distinct().count(); + long totalCount = listWarinTotalDays.stream().map(WarnMonitoringResponseInfo::getSn).distinct().count(); //告警超过15天的站点 - long count1 = listWarinTotalDays.stream().filter(info -> info.getCount() > 15).map(WarnMonitoringResponseInfo::getSn).distinct().count(); - + long count1 = listWarinTotalDays.stream().filter(info -> info.getCountDays() > 15).map(WarnMonitoringResponseInfo::getSn).distinct().count(); warnMonitoringResponse.setWarnmoitoringExceedDay(count1); - warnMonitoringResponse.setWarnmoitoringCountDay(uniqueSnCount); + warnMonitoringResponse.setWarnmoitoringCountDay(totalCount); warnMonitoringResponse.setProjectCode(request.getProjectCode()); warnMonitoringResponse.setWarnmoitoringListInfo(listWarinTotalDays); //累计告警天数统计,并计算百分比 Map durationToSnCount = new HashMap<>(); - listWarinTotalDays.stream() - .collect(Collectors.groupingBy(WarnMonitoringResponseInfo::getSn, - Collectors.mapping(WarnMonitoringResponseInfo::getCount, - Collectors.toList()))) - .forEach((sn, days) -> { - days.stream() - .forEach(day -> { - String key; - if (day <= 1) { - key = "无告警"; - } else if (day >=2 && day <= 3) { - key = "2-3天"; - } else if (day >=4 && day <= 6) { - key = "4-6天"; - } else if (day >=7 && day <= 15) { - key = "7-15天"; - } else { - key = ">15天"; - } - durationToSnCount.merge(key, 1L, Long::sum); - }); - }); + List allDurationRanges = Arrays.asList("无告警", "2-3天", "4-6天", "7-15天", ">15天"); + allDurationRanges.forEach(range -> durationToSnCount.put(range, 0L)); + listWarinTotalDays.forEach(info -> { + int day = info.getCountDays(); + String key; + if (day <= 1) { + key = "无告警"; + } else if (day >= 2 && day <= 3) { + key = "2-3天"; + } else if (day >= 4 && day <= 6) { + key = "4-6天"; + } else if (day >= 7 && day <= 15) { + key = "7-15天"; + } else { + key = ">15天"; + } + durationToSnCount.merge(key, 1L, Long::sum); + }); List warnMonitoringResponseDaysInfoList = new ArrayList(); // 计算百分比并添加到结果列表中 durationToSnCount.forEach((durationRange, count) -> { - double percentage = (double) count / uniqueSnCount * 100; - warnMonitoringResponseDaysInfoList.add(new WarnMonitoringResponseDaysInfo(durationRange,percentage)); + BigDecimal percentage = new BigDecimal(((double) count) / totalCount) + .multiply(BigDecimal.valueOf(100)) + .setScale(2, RoundingMode.HALF_UP); + warnMonitoringResponseDaysInfoList.add(new WarnMonitoringResponseDaysInfo(durationRange,percentage.doubleValue())); }); warnMonitoringResponse.setWarnmoitoringDaysListInfo(warnMonitoringResponseDaysInfoList); + System.out.println(warnMonitoringResponseDaysInfoList); return new WarnMonitoringResponse(); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml index d3eca33..66bb289 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml @@ -88,18 +88,19 @@ @@ -114,7 +115,7 @@ INNER JOIN ter_monitoring_warn_record dm ON di.sn = dm.sn WHERE - di.sn = #{sn} AND dm.yesnoant = 1 AND DATE(dm.date) BETWEEN #{startTime,jdbcType=TIMESTAMP} AND #{endTime,jdbcType=TIMESTAMP} + di.sn = #{sn} AND DATE(dm.date) BETWEEN #{startTime,jdbcType=TIMESTAMP} AND #{endTime,jdbcType=TIMESTAMP} GROUP BY di.sn, di.first_warn_datetime diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java index 5459eca..021d494 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonitoringResponseInfo.java @@ -25,6 +25,6 @@ * 累计告警天数 */ @ApiModelProperty(value = "累计告警天数") - private Integer count; + private Integer countDays; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index cea3398..6db0ce6 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -25,6 +25,8 @@ import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; @@ -207,13 +209,17 @@ List warnMonthAlarmsResponseInfoList = monitoringWarnRecordService.selectWarnMonthListTotal(request.getProjectCode()); LocalDate now = LocalDate.now(); int currentYear = now.getYear(); + List stringx = new ArrayList<>(); + List stringy = new ArrayList<>(); warnMonthAlarmsResponseInfoList.stream().filter(info -> info.getWarnYear() == currentYear).collect(Collectors.toList()); if(warnMonthAlarmsResponseInfoList.isEmpty()){ - throw new InnerAuthException("该项目下没有告警信息1"); + warnMonthAlarmsResponse.setXAxis(stringx); + warnMonthAlarmsResponse.setYAxis(stringy); + return warnMonthAlarmsResponse; } warnMonthAlarmsResponse.setWarnListInfo(warnMonthAlarmsResponseInfoList); warnMonthAlarmsResponse.setXAxis(warnMonthAlarmsResponseInfoList.stream() - .map(WarnMonthAlarmsResponseInfo::getWarnMonth) + .map(info -> info.getWarnMonth() + "月") .collect(Collectors.toList())); warnMonthAlarmsResponse.setYAxis(warnMonthAlarmsResponseInfoList.stream() .map(WarnMonthAlarmsResponseInfo::getWarnNumber) @@ -231,11 +237,13 @@ sortedEntries.sort(Map.Entry.comparingByValue(Comparator.reverseOrder())); if (sortedEntries.size() >= 2) { long sumOfTopTwo = sortedEntries.get(0).getValue() + sortedEntries.get(1).getValue(); - double percentage = ((double) sumOfTopTwo / totalSnCount) * 100; - warnMonthAlarmsResponse.setDeviceCountProportion(percentage); + BigDecimal percentage = new BigDecimal(((double) sumOfTopTwo) / totalSnCount) + .multiply(BigDecimal.valueOf(100)) + .setScale(2, RoundingMode.HALF_UP); + warnMonthAlarmsResponse.setDeviceCountProportion(percentage.doubleValue()); warnMonthAlarmsResponse.setWarnDeviceCount(sumOfTopTwo); - warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(0).getKey()); - warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(1).getKey()); + warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(1).getKey()); + warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(0).getKey()); } else { warnMonthAlarmsResponse.setDeviceCountProportion(100D); warnMonthAlarmsResponse.setWarnDeviceCount(sortedEntries.get(0).getValue()); @@ -254,50 +262,48 @@ List listWarinTotalDays=this.listWarinTotalDays(warnMonitoringRequest); //累计站点个数 - long uniqueSnCount = listWarinTotalDays.stream().map(WarnMonitoringResponseInfo::getSn).distinct().count(); + long totalCount = listWarinTotalDays.stream().map(WarnMonitoringResponseInfo::getSn).distinct().count(); //告警超过15天的站点 - long count1 = listWarinTotalDays.stream().filter(info -> info.getCount() > 15).map(WarnMonitoringResponseInfo::getSn).distinct().count(); - + long count1 = listWarinTotalDays.stream().filter(info -> info.getCountDays() > 15).map(WarnMonitoringResponseInfo::getSn).distinct().count(); warnMonitoringResponse.setWarnmoitoringExceedDay(count1); - warnMonitoringResponse.setWarnmoitoringCountDay(uniqueSnCount); + warnMonitoringResponse.setWarnmoitoringCountDay(totalCount); warnMonitoringResponse.setProjectCode(request.getProjectCode()); warnMonitoringResponse.setWarnmoitoringListInfo(listWarinTotalDays); //累计告警天数统计,并计算百分比 Map durationToSnCount = new HashMap<>(); - listWarinTotalDays.stream() - .collect(Collectors.groupingBy(WarnMonitoringResponseInfo::getSn, - Collectors.mapping(WarnMonitoringResponseInfo::getCount, - Collectors.toList()))) - .forEach((sn, days) -> { - days.stream() - .forEach(day -> { - String key; - if (day <= 1) { - key = "无告警"; - } else if (day >=2 && day <= 3) { - key = "2-3天"; - } else if (day >=4 && day <= 6) { - key = "4-6天"; - } else if (day >=7 && day <= 15) { - key = "7-15天"; - } else { - key = ">15天"; - } - durationToSnCount.merge(key, 1L, Long::sum); - }); - }); + List allDurationRanges = Arrays.asList("无告警", "2-3天", "4-6天", "7-15天", ">15天"); + allDurationRanges.forEach(range -> durationToSnCount.put(range, 0L)); + listWarinTotalDays.forEach(info -> { + int day = info.getCountDays(); + String key; + if (day <= 1) { + key = "无告警"; + } else if (day >= 2 && day <= 3) { + key = "2-3天"; + } else if (day >= 4 && day <= 6) { + key = "4-6天"; + } else if (day >= 7 && day <= 15) { + key = "7-15天"; + } else { + key = ">15天"; + } + durationToSnCount.merge(key, 1L, Long::sum); + }); List warnMonitoringResponseDaysInfoList = new ArrayList(); // 计算百分比并添加到结果列表中 durationToSnCount.forEach((durationRange, count) -> { - double percentage = (double) count / uniqueSnCount * 100; - warnMonitoringResponseDaysInfoList.add(new WarnMonitoringResponseDaysInfo(durationRange,percentage)); + BigDecimal percentage = new BigDecimal(((double) count) / totalCount) + .multiply(BigDecimal.valueOf(100)) + .setScale(2, RoundingMode.HALF_UP); + warnMonitoringResponseDaysInfoList.add(new WarnMonitoringResponseDaysInfo(durationRange,percentage.doubleValue())); }); warnMonitoringResponse.setWarnmoitoringDaysListInfo(warnMonitoringResponseDaysInfoList); + System.out.println(warnMonitoringResponseDaysInfoList); return new WarnMonitoringResponse(); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml index d3eca33..66bb289 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataMapper.xml @@ -88,18 +88,19 @@ @@ -114,7 +115,7 @@ INNER JOIN ter_monitoring_warn_record dm ON di.sn = dm.sn WHERE - di.sn = #{sn} AND dm.yesnoant = 1 AND DATE(dm.date) BETWEEN #{startTime,jdbcType=TIMESTAMP} AND #{endTime,jdbcType=TIMESTAMP} + di.sn = #{sn} AND DATE(dm.date) BETWEEN #{startTime,jdbcType=TIMESTAMP} AND #{endTime,jdbcType=TIMESTAMP} GROUP BY di.sn, di.first_warn_datetime diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml index 81779d6..19e03eb 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml @@ -121,9 +121,9 @@ YEAR(t.date), MONTH(t.date) ORDER BY - di.project_code DESC, - YEAR(t.date) DESC, - MONTH(t.date) DESC; + di.project_code ASC, + YEAR(t.date) ASC, + MONTH(t.date) ASC;