监测类数据实时表
parent
b54a565182
commit
b6ed506d69
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.model.StRcvReal;
|
||||||
|
import com.gunshi.project.xyt.model.StRcvRealAutoDao;
|
||||||
|
import com.gunshi.project.xyt.so.StRcvRealSo;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测类数据实时表
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Tag(name = "统一接收-监测类数据实时表")
|
||||||
|
@RequestMapping("/rcv/real")
|
||||||
|
public class StRcvRealController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StRcvRealAutoDao dao;
|
||||||
|
|
||||||
|
@PostMapping("/page")
|
||||||
|
@Operation(summary = "分页查询")
|
||||||
|
public R<Page<StRcvReal>> page(@RequestBody StRcvRealSo so) {
|
||||||
|
if (StringUtils.isNotEmpty(so.getStcd())) {
|
||||||
|
StRcvReal entity = dao.getById(so.getStcd());
|
||||||
|
List<StRcvReal> list = List.of(entity);
|
||||||
|
return R.ok(new Page<StRcvReal>(1, 1, 1).setRecords(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<StRcvReal> query = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotEmpty(so.getStnm())) {
|
||||||
|
query.like(StRcvReal::getStnm, so.getStnm());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(so.getSttp())) {
|
||||||
|
query.eq(StRcvReal::getSttp, so.getSttp());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(so.getProtocolId())) {
|
||||||
|
query.eq(StRcvReal::getProtocolId, so.getProtocolId());
|
||||||
|
}
|
||||||
|
query.orderByDesc(StRcvReal::getTm);
|
||||||
|
|
||||||
|
return R.ok(dao.page(so.getPageSo().toPage(), query));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测类数据实时表对象
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("ST_RCV_REAL")
|
||||||
|
public class StRcvReal {
|
||||||
|
@TableId("STCD")
|
||||||
|
@Schema(description = "测站编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@TableField("TM")
|
||||||
|
@Schema(description = "采集时间")
|
||||||
|
private Date tm;
|
||||||
|
|
||||||
|
@TableField("STNM")
|
||||||
|
@Schema(description = "测站名称")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@TableField("STTP")
|
||||||
|
@Schema(description = "测站类别")
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
@TableField("DATA")
|
||||||
|
@Schema(description = "最近数据")
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
@TableField("PROTOCOL_ID")
|
||||||
|
@Schema(description = "协议ID")
|
||||||
|
private String protocolId;
|
||||||
|
|
||||||
|
@TableField("PROTOCOL_NAME")
|
||||||
|
@Schema(description = "协议名称")
|
||||||
|
private String protocolName;
|
||||||
|
}
|
||||||
|
|
@ -36,7 +36,7 @@ public class StRsvrR {
|
||||||
@TableField("RZ")
|
@TableField("RZ")
|
||||||
private BigDecimal rz;
|
private BigDecimal rz;
|
||||||
|
|
||||||
@Schema(description = "库水水势")
|
@Schema(description = "库水水势,4=落,5=涨,6=平")
|
||||||
@TableField("WRPTM")
|
@TableField("RWPTN")
|
||||||
private String rwptn;
|
private String rwptn;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class ProtocolInfoService {
|
||||||
|
|
||||||
LambdaQueryWrapper<BzProtocolInfo> query = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BzProtocolInfo> query = new LambdaQueryWrapper<>();
|
||||||
if (StringUtils.isNotEmpty(so.getName())) {
|
if (StringUtils.isNotEmpty(so.getName())) {
|
||||||
query.like(StringUtils.isNotEmpty(so.getName()), BzProtocolInfo::getName, so.getName());
|
query.like(BzProtocolInfo::getName, so.getName());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(so.getIp())) {
|
if (StringUtils.isNotEmpty(so.getIp())) {
|
||||||
query.like(BzProtocolInfo::getIp, so.getIp());
|
query.like(BzProtocolInfo::getIp, so.getIp());
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.gunshi.project.xyt.so;
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测类数据实时表查询对象
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "监测类数据实时表查询对象")
|
||||||
|
public class StRcvRealSo {
|
||||||
|
@Schema(description = "分页参数")
|
||||||
|
@NotNull
|
||||||
|
private PageSo pageSo;
|
||||||
|
|
||||||
|
@Schema(description = "测站编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "测站名称")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "测站类别")
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
@Schema(description = "协议ID")
|
||||||
|
private String protocolId;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue