河道水情监测详细数据
parent
4c09e9770b
commit
d2354d86b8
|
|
@ -119,6 +119,15 @@ public interface AttResBaseMapper extends BaseMapper<AttResBase> {
|
||||||
""")
|
""")
|
||||||
BigDecimal queryMaxRzByStcdAndTime(@Param("stcd") String stcd, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
BigDecimal queryMaxRzByStcdAndTime(@Param("stcd") String stcd, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select
|
||||||
|
max(t.z) from public.st_river_r t
|
||||||
|
where t.stcd = #{stcd} and t.tm <![CDATA[>=]]> #{startTime} and t.tm <![CDATA[<=]]> #{endTime}
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
BigDecimal queryRiverMaxRz(@Param("stcd") String stcd, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||||
|
|
||||||
@Select("""
|
@Select("""
|
||||||
<script>
|
<script>
|
||||||
select stcd,stnm from st_stbprp_b where res_code = #{resCode}
|
select stcd,stnm from st_stbprp_b where res_code = #{resCode}
|
||||||
|
|
|
||||||
|
|
@ -130,13 +130,11 @@ public class RiverWaterService {
|
||||||
//最新水位时间往前推24小时水位
|
//最新水位时间往前推24小时水位
|
||||||
LocalDateTime now = LocalDateTime.ofInstant(tm.toInstant(), ZoneId.systemDefault());
|
LocalDateTime now = LocalDateTime.ofInstant(tm.toInstant(), ZoneId.systemDefault());
|
||||||
LocalDateTime dateTime = now.minusDays(1);
|
LocalDateTime dateTime = now.minusDays(1);
|
||||||
BigDecimal oldRz = attRvBaseMapper.oldRz(stcd,2,Date.from(dateTime.atZone(ZoneId.systemDefault()).toInstant()));
|
BigDecimal oldRz = attRvBaseMapper.oldRz(stcd,1,Date.from(dateTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
|
|
||||||
if(oldRz == null){
|
if(oldRz != null){
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
vo.setRzDiff(rz.subtract(oldRz));
|
vo.setRzDiff(rz.subtract(oldRz));
|
||||||
|
}
|
||||||
//本年最高水位
|
//本年最高水位
|
||||||
BigDecimal maxYearRz = queryYearRzByStcdAndTime(stcd);
|
BigDecimal maxYearRz = queryYearRzByStcdAndTime(stcd);
|
||||||
vo.setMaxRz(maxYearRz);
|
vo.setMaxRz(maxYearRz);
|
||||||
|
|
@ -157,7 +155,7 @@ public class RiverWaterService {
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
endTime = now;
|
endTime = now;
|
||||||
return attRvBaseMapper.queryMaxRzByStcdAndTime(stcd,Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()));
|
return attRvBaseMapper.queryRiverMaxRz(stcd,Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
}
|
}
|
||||||
return new BigDecimal(0);
|
return new BigDecimal(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue