修改了一些查询规则,从按站点类型的sttp改为从表st_stbprp_b_elem的elem字段进行匹配
parent
50fb447c68
commit
b0112145c4
|
|
@ -24,19 +24,10 @@ public class RealRainController {
|
|||
@Autowired
|
||||
private RealRainService realRainService;
|
||||
|
||||
|
||||
@Post(path="/list", summary = "实时雨情-降雨信息-查询接口")
|
||||
public R<List<RealRainListVo>> getRealRainList(@RequestBody RealRainBaseSo realRainBaseSo) {
|
||||
List<RealRainListVo> list = realRainService.getRealRainList(realRainBaseSo);
|
||||
//按RealRainListVo.drp倒序排列,null的排在最后面
|
||||
list.sort((o1, o2) -> {
|
||||
if (o1.getDrp() == null) {
|
||||
return 1;
|
||||
}
|
||||
if (o2.getDrp() == null) {
|
||||
return -1;
|
||||
}
|
||||
return o2.getDrp().compareTo(o1.getDrp());
|
||||
});
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.gunshi.project.hsz.entity.vo.AttRiverNowDataVo;
|
|||
import com.gunshi.project.hsz.entity.vo.AttRvBaseVo;
|
||||
import com.gunshi.project.hsz.entity.vo.AttRvMonitorDetailVo;
|
||||
import com.gunshi.project.hsz.entity.vo.AttRvMonitorVo;
|
||||
import com.gunshi.project.hsz.model.StZqR;
|
||||
import com.gunshi.project.hsz.model.StZqrlB;
|
||||
import com.gunshi.project.hsz.service.RiverWaterService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
|
@ -46,9 +47,9 @@ public class RiverWaterController {
|
|||
return R.ok(riverWaterService.list());
|
||||
}
|
||||
|
||||
@Get(path = "/zqrl", summary = "某个站点的水位流量关系曲线")
|
||||
public R<List<StZqrlB>> zqrl(@Schema(name = "stcd") @RequestParam("stcd") String stcd) {
|
||||
return R.ok(riverWaterService.zqrl(stcd));
|
||||
@Get(path = "/zqrl", summary = "水位流量关系")
|
||||
public R<List<StZqR>> zqrl(@Schema(name = "stcd") @RequestParam("stcd") String stcd) {
|
||||
return R.ok(riverWaterService.zqr(stcd));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,12 @@ public interface AttResBaseMapper extends BaseMapper<AttResBase> {
|
|||
case when s.des_flood_lev is not null and m.rz-s.des_flood_lev > 0 then 1 else 0 end as desState,
|
||||
case when s.fl_low_lim_lev is not null and m.rz-s.fl_low_lim_lev > 0 then 1 else 0 end as flState
|
||||
from public.st_stbprp_b t
|
||||
join public.att_res_base s on t.stcd = s.stcd
|
||||
left join public.att_res_base s on 1=1
|
||||
left join public.st_addvcd_d sad on t.adcd = sad.adcd
|
||||
left join public.st_rsvr_r_real m on t.stcd = m.stcd
|
||||
left join public.st_pptn_r_real sprr on t.stcd = sprr.stcd
|
||||
where t.sttp = 'RR'
|
||||
join public.st_stbprp_b_elem stbe on t.stcd = stbe.stcd
|
||||
where stbe.elem = 'rz'
|
||||
order by _order asc nulls last
|
||||
</script>
|
||||
""")
|
||||
|
|
@ -287,7 +288,8 @@ public interface AttResBaseMapper extends BaseMapper<AttResBase> {
|
|||
left join public.alarm_set srb on t.stcd = srb.stcd
|
||||
left join public.st_pptn_r_real sprr on t.stcd = sprr.stcd
|
||||
left join public.att_res_base arb on 1=1
|
||||
where t.stcd in ('123','61610700')
|
||||
left join public.st_stbprp_b_elem stbe on t.stcd = stbe.stcd
|
||||
where stbe.elem = 'z'
|
||||
""")
|
||||
//TODO 站点需要更改
|
||||
List<AttRvBaseVo> queryWaterListUpAndLow();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
package com.gunshi.project.hsz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.model.StZqR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface StZqRMapper extends BaseMapper<StZqR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.gunshi.project.hsz.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.hsz.validate.markers.Delete;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 水位-流量 关系表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:34:26
|
||||
*/
|
||||
@Schema(description="水位-流量 关系表")
|
||||
@Data
|
||||
@TableName("public.st_zq_r")
|
||||
public class StZqR {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@TableField(value="stcd")
|
||||
@Schema(description="测站编码")
|
||||
@Size(max = 20,message = "测站编码最大长度要小于 8")
|
||||
@NotBlank(message = "测站编码不能为空")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 水位
|
||||
*/
|
||||
@TableField(value="z")
|
||||
@Schema(description="水位")
|
||||
// @Size(max = 0,message = "水位最大长度要小于 0")
|
||||
@NotNull(message = "水位不能为空",groups = {Insert.class, Update.class, Delete.class})
|
||||
private BigDecimal z;
|
||||
|
||||
/**
|
||||
* 流量
|
||||
*/
|
||||
@TableField(value="q")
|
||||
@Schema(description="流量")
|
||||
// @Size(max = 0,message = "流量最大长度要小于 0")
|
||||
@NotNull(message = "流量不能为空",groups = {Insert.class, Update.class, Delete.class})
|
||||
private BigDecimal q;
|
||||
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
@TableField(value="moditime")
|
||||
@Schema(description="时间戳")
|
||||
// @Size(max = 0,message = "时间戳最大长度要小于 0")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private LocalDateTime moditime;
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ public class RealRainService {
|
|||
public List<RealRainListVo> getRealRainList(RealRainBaseSo realRainBaseSo) {
|
||||
List<RealRainListVo> result = realRainMapper.getRealRainList(realRainBaseSo.getStm(), realRainBaseSo.getEtm());
|
||||
|
||||
result.sort(Comparator.comparing(RealRainListVo::getDrp, Comparator.nullsFirst(Double::compareTo)).reversed().thenComparing(RealRainListVo::getStcd));
|
||||
// result.sort(Comparator.comparing(RealRainListVo::getDrp, Comparator.nullsFirst(Double::compareTo)).reversed().thenComparing(RealRainListVo::getStcd));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.gunshi.project.hsz.entity.so.DataQueryCommonSo;
|
||||
import com.gunshi.project.hsz.entity.vo.*;
|
||||
import com.gunshi.project.hsz.mapper.AttResBaseMapper;
|
||||
import com.gunshi.project.hsz.mapper.StZqRMapper;
|
||||
import com.gunshi.project.hsz.mapper.StZqrlBMapper;
|
||||
import com.gunshi.project.hsz.model.*;
|
||||
import com.gunshi.project.hsz.util.DataHandleUtil;
|
||||
|
|
@ -48,6 +49,11 @@ public class RiverWaterService {
|
|||
@Resource
|
||||
private StRiverRRealService stRiverRRealService;
|
||||
|
||||
@Resource
|
||||
private StZqRMapper stZqRMapper;//水位-流量关系
|
||||
|
||||
|
||||
|
||||
public List<AttRvBaseVo> list() {
|
||||
List<AttRvBaseVo> attRvBaseVos = attRvBaseMapper.queryWaterListUpAndLow();
|
||||
if(CollectionUtils.isEmpty(attRvBaseVos)){
|
||||
|
|
@ -199,4 +205,10 @@ public class RiverWaterService {
|
|||
vo.setWaterPromiseGap(z.subtract(vo.getWaterPromise()));
|
||||
return vo;
|
||||
}
|
||||
|
||||
public List<StZqR> zqr(String stcd){
|
||||
LambdaQueryWrapper<StZqR> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(StZqR::getStcd, stcd).orderByAsc(StZqR::getZ);
|
||||
return stZqRMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class StQxWarnRService extends ServiceImpl<StQxWarnRMapper, StQxWarnR> {
|
|||
}
|
||||
}
|
||||
|
||||
vo.setQxWarn(queryQxWarn());
|
||||
// vo.setQxWarn(queryQxWarn());
|
||||
|
||||
List<OsmoticWarnVo> warnVos = baseMapper.queryOsmoticWarn(dateTimeRangeSo);
|
||||
vo.setPressWarn(warnVos.stream().filter(o -> o.getType() == 1).collect(Collectors.toList()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue