fix: 优化首页监测数据查询
This commit is contained in:
parent
f1651fb18e
commit
d255e2403c
@ -12,7 +12,9 @@ public class WtrvVo {
|
|||||||
|
|
||||||
private Date tm;
|
private Date tm;
|
||||||
|
|
||||||
private Boolean isIoWtrv;
|
// private Boolean isIoWtrv;
|
||||||
|
|
||||||
|
private Boolean ioWtrv;
|
||||||
|
|
||||||
private Boolean hasRstcdWtvt;
|
private Boolean hasRstcdWtvt;
|
||||||
|
|
||||||
|
|||||||
@ -214,7 +214,7 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
|||||||
List<Map<String, Object>> iwtDataVoList = new ArrayList<>();
|
List<Map<String, Object>> iwtDataVoList = new ArrayList<>();
|
||||||
List<Map<String, Object>> dwtDataVoList = new ArrayList<>();
|
List<Map<String, Object>> dwtDataVoList = new ArrayList<>();
|
||||||
List<Map<String, Object>> wtvtDataVoList = new ArrayList<>();
|
List<Map<String, Object>> wtvtDataVoList = new ArrayList<>();
|
||||||
// List<Map<String, Object>> hydropwDataVoList = new ArrayList<>();
|
List<Map<String, Object>> hydropwDataVoList = new ArrayList<>();
|
||||||
List<Map<String, Object>> pptnDataVoList = new ArrayList<>();
|
List<Map<String, Object>> pptnDataVoList = new ArrayList<>();
|
||||||
List<Map<String, Object>> tmpDataVoList = new ArrayList<>();
|
List<Map<String, Object>> tmpDataVoList = new ArrayList<>();
|
||||||
List<Map<String, Object>> wtnpDataVoList;
|
List<Map<String, Object>> wtnpDataVoList;
|
||||||
@ -241,17 +241,17 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
|||||||
.filter(it -> getDateValueIgnoreCase(it, "tm") != null)
|
.filter(it -> getDateValueIgnoreCase(it, "tm") != null)
|
||||||
.collect(Collectors.toMap(it -> getDateValueIgnoreCase(it, "tm"), Function.identity()));
|
.collect(Collectors.toMap(it -> getDateValueIgnoreCase(it, "tm"), Function.identity()));
|
||||||
|
|
||||||
// hydropwDataVoList.addAll(this.alongDetailMapper.getHydropwDataList(wtrvInfo.getStcd(), startTime, endTime));
|
hydropwDataVoList.addAll(this.alongDetailMapper.getHydropwDataList(wtrvInfo.getStcd(), startTime, endTime));
|
||||||
// Map<Date, Map<String, Object>> hydropwDataMap = hydropwDataVoList.stream()
|
Map<Date, Map<String, Object>> hydropwDataMap = hydropwDataVoList.stream()
|
||||||
// .collect(Collectors.toMap(it -> (Date) it.get("tm"), Function.identity()));
|
.collect(Collectors.toMap(it -> (Date) it.get("tm"), Function.identity()));
|
||||||
|
|
||||||
// pptnDataVoList.addAll(this.alongDetailMapper.getPptnDataList(wtrvInfo.getStcd(), startTime, endTime));
|
pptnDataVoList.addAll(this.alongDetailMapper.getPptnDataList(wtrvInfo.getStcd(), startTime, endTime));
|
||||||
// Map<Date, Map<String, Object>> pptnDataMap = pptnDataVoList.stream()
|
Map<Date, Map<String, Object>> pptnDataMap = pptnDataVoList.stream()
|
||||||
// .collect(Collectors.toMap(it -> (Date) it.get("tm"), Function.identity()));
|
.collect(Collectors.toMap(it -> (Date) it.get("tm"), Function.identity()));
|
||||||
|
|
||||||
// tmpDataVoList.addAll(this.alongDetailMapper.getTmpDataList(wtrvInfo.getStcd(), startTime, endTime));
|
tmpDataVoList.addAll(this.alongDetailMapper.getTmpDataList(wtrvInfo.getStcd(), startTime, endTime));
|
||||||
// Map<Date, Map<String, Object>> tmpDataMap = tmpDataVoList.stream()
|
Map<Date, Map<String, Object>> tmpDataMap = tmpDataVoList.stream()
|
||||||
// .collect(Collectors.toMap(it -> (Date) it.get("tm"), Function.identity()));
|
.collect(Collectors.toMap(it -> (Date) it.get("tm"), Function.identity()));
|
||||||
|
|
||||||
Map<Integer, BigDecimal> wtnpDataMap = new HashMap<>();
|
Map<Integer, BigDecimal> wtnpDataMap = new HashMap<>();
|
||||||
if (StrUtil.isNotBlank(wtrvInfo.getRstcd())) {
|
if (StrUtil.isNotBlank(wtrvInfo.getRstcd())) {
|
||||||
@ -275,9 +275,9 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
|||||||
vo.put("rstcd", wtrvInfo.getRstcd());
|
vo.put("rstcd", wtrvInfo.getRstcd());
|
||||||
vo.put("type", wtrvInfo.getType());
|
vo.put("type", wtrvInfo.getType());
|
||||||
vo.put("natureTmp", wtnpDataMap.get(it.getMon()));
|
vo.put("natureTmp", wtnpDataMap.get(it.getMon()));
|
||||||
// vo.put("hydropwDataVo", hydropwDataMap.get(it.getTm()));
|
vo.put("hydropwDataVo", hydropwDataMap.get(it.getTm()));
|
||||||
// vo.put("pptnDataVo", pptnDataMap.get(it.getTm()));
|
vo.put("pptnDataVo", pptnDataMap.get(it.getTm()));
|
||||||
// vo.put("tmpDataVo", tmpDataMap.get(it.getTm()));
|
vo.put("tmpDataVo", tmpDataMap.get(it.getTm()));
|
||||||
|
|
||||||
if (wtrvInfo.getType() == 1) {
|
if (wtrvInfo.getType() == 1) {
|
||||||
Map<String, Object> iwtVo = new HashMap<>();
|
Map<String, Object> iwtVo = new HashMap<>();
|
||||||
|
|||||||
@ -491,7 +491,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
@Override
|
@Override
|
||||||
public WtrvVo getFlagByStcd(String stcd) {
|
public WtrvVo getFlagByStcd(String stcd) {
|
||||||
String sql = "SELECT wt.STCD AS stcd, " +
|
String sql = "SELECT wt.STCD AS stcd, " +
|
||||||
"CASE WHEN rel.ENG_IWT_CODE IS NOT NULL OR rel.ENG_DWT_CODE IS NOT NULL THEN 1 ELSE 0 END AS isIoWtrv, " +
|
"CASE WHEN rel.ENG_IWT_CODE IS NOT NULL OR rel.ENG_DWT_CODE IS NOT NULL THEN 1 ELSE 0 END AS ioWtrv, " +
|
||||||
"CASE WHEN EXISTS ( " +
|
"CASE WHEN EXISTS ( " +
|
||||||
" SELECT 1 FROM SD_WT_B_H vt " +
|
" SELECT 1 FROM SD_WT_B_H vt " +
|
||||||
" WHERE vt.RSTCD = wt.RSTCD " +
|
" WHERE vt.RSTCD = wt.RSTCD " +
|
||||||
@ -2305,7 +2305,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
private WtrvVo buildDefaultWtrvVo(String stcd) {
|
private WtrvVo buildDefaultWtrvVo(String stcd) {
|
||||||
WtrvVo vo = new WtrvVo();
|
WtrvVo vo = new WtrvVo();
|
||||||
vo.setStcd(stcd);
|
vo.setStcd(stcd);
|
||||||
vo.setIsIoWtrv(false);
|
vo.setIoWtrv(false);
|
||||||
vo.setHasRstcdWtvt(false);
|
vo.setHasRstcdWtvt(false);
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user