修正年度位移导出标语到空值问题#604

master
李一帆 2025-04-09 18:03:58 +08:00
parent 269c5f15cc
commit 177eea3568
3 changed files with 22 additions and 22 deletions

View File

@ -53,10 +53,10 @@ public interface OsmoticPressRMapper extends BaseMapper<OsmoticPressR> {
<script>
select to_char(t.tm,'YYYY-MM-DD') as tm,t.rz
from public.st_rsvr_r t
where to_char(t.tm, 'HH24:MI:SS') = '08:00:00' and t.stcd = #{stcd}
where t.stcd = #{stcd}
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>

View File

@ -23,15 +23,14 @@ public interface OsmoticShiftRMapper extends BaseMapper<OsmoticShiftR> {
@Select("""
<script>
select t.station_code as stationCode,to_char(t.tm,'YYYY-MM-DD') as tm,t.x,t.y,t.h
from public.osmotic_shift_r t
where to_char(t.tm, 'HH24:MI:SS') = '08:00:00'
and t.station_code in
from public.osmotic_shift_r t
where t.station_code in
<foreach collection="obj.stationCodes" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</foreach>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>

View File

@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Collectors;
/**
@ -199,9 +200,9 @@ public class OsmoticShiftRService extends ServiceImpl<OsmoticShiftRMapper, Osmot
max.put("t1", "最大值");
for(int i = 0;i < stationCodes.size();i++){
String code = stationCodes.get(i);
max.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().get().getMaxValue());
max.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().get().getMaxValue());
max.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().get().getMaxValue());
max.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxValue());
max.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxValue());
max.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxValue());
}
list.add(max);
@ -210,9 +211,9 @@ public class OsmoticShiftRService extends ServiceImpl<OsmoticShiftRMapper, Osmot
maxTm.put("t1", "日期");
for(int i = 0;i < stationCodes.size();i++){
String code = stationCodes.get(i);
maxTm.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().get().getMaxTm());
maxTm.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().get().getMaxTm());
maxTm.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().get().getMaxTm());
maxTm.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxTm());
maxTm.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxTm());
maxTm.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxTm());
}
list.add(maxTm);
@ -221,9 +222,9 @@ public class OsmoticShiftRService extends ServiceImpl<OsmoticShiftRMapper, Osmot
min.put("t1", "最小值");
for(int i = 0;i < stationCodes.size();i++){
String code = stationCodes.get(i);
min.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().get().getMinValue());
min.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().get().getMinValue());
min.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().get().getMinValue());
min.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinValue());
min.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinValue());
min.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinValue());
}
list.add(min);
@ -232,9 +233,9 @@ public class OsmoticShiftRService extends ServiceImpl<OsmoticShiftRMapper, Osmot
minTm.put("t1", "日期");
for(int i = 0;i < stationCodes.size();i++){
String code = stationCodes.get(i);
minTm.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().get().getMinTm());
minTm.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().get().getMinTm());
minTm.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().get().getMinTm());
minTm.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinTm());
minTm.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinTm());
minTm.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinTm());
}
list.add(minTm);
@ -243,9 +244,9 @@ public class OsmoticShiftRService extends ServiceImpl<OsmoticShiftRMapper, Osmot
diff.put("t1", "年变幅");
for(int i = 0;i < stationCodes.size();i++){
String code = stationCodes.get(i);
diff.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().get().getDiff());
diff.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().get().getDiff());
diff.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().get().getDiff());
diff.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getDiff());
diff.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getDiff());
diff.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getDiff());
}
list.add(diff);