diff --git a/src/main/java/com/gunshi/project/xyt/controller/BasicDataController.java b/src/main/java/com/gunshi/project/xyt/controller/BasicDataController.java index e21c063..eb200c8 100644 --- a/src/main/java/com/gunshi/project/xyt/controller/BasicDataController.java +++ b/src/main/java/com/gunshi/project/xyt/controller/BasicDataController.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.gunshi.core.annotation.Get; import com.gunshi.core.annotation.Post; import com.gunshi.core.result.R; -import com.gunshi.project.xyt.entity.basedata.AddvcdSearch; import com.gunshi.project.xyt.entity.basedata.CheckStringSearch; import com.gunshi.project.xyt.entity.basedata.GeneralSearch; import com.gunshi.project.xyt.entity.basedata.StAddvcdTreeVo; @@ -12,17 +11,28 @@ import com.gunshi.project.xyt.entity.basedata.StCameraAreaTreeVo; import com.gunshi.project.xyt.entity.basedata.StCameraAreaVo; import com.gunshi.project.xyt.entity.basedata.StCameraSearch; import com.gunshi.project.xyt.entity.basedata.StCameraVo; +import com.gunshi.project.xyt.entity.basedata.StSpgPztbVo; +import com.gunshi.project.xyt.entity.basedata.StSpgSpprmpVo; +import com.gunshi.project.xyt.entity.basedata.StStbprpVo; +import com.gunshi.project.xyt.entity.basedata.StcdSearch; import com.gunshi.project.xyt.entity.basedata.SysDictVo; import com.gunshi.project.xyt.model.StAddvcdD; import com.gunshi.project.xyt.model.StCameraAreaB; import com.gunshi.project.xyt.model.StCameraB; +import com.gunshi.project.xyt.model.StMoncrB; +import com.gunshi.project.xyt.model.StSpgPztb; +import com.gunshi.project.xyt.model.StSpgSpprmp; +import com.gunshi.project.xyt.model.StStbprpB; import com.gunshi.project.xyt.model.SysDictB; import com.gunshi.project.xyt.service.StAdcdService; import com.gunshi.project.xyt.service.StCameraAreaService; import com.gunshi.project.xyt.service.StCameraService; +import com.gunshi.project.xyt.service.StMoncrService; +import com.gunshi.project.xyt.service.StSpgPztbService; +import com.gunshi.project.xyt.service.StSpgSpprmpService; +import com.gunshi.project.xyt.service.StStbprpService; import com.gunshi.project.xyt.service.SysDictService; import com.gunshi.project.xyt.validate.markers.Update; -import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.tags.Tag; @@ -53,6 +63,12 @@ public class BasicDataController { private final StAdcdService stAdcdService; private final StCameraAreaService stCameraAreaService; private final StCameraService stCameraService; + private final StStbprpService stStbprpService; + private final StMoncrService stMoncrService; + //渗压设备 + private final StSpgPztbService stSpgPztbService; + //渗流设备 + private final StSpgSpprmpService stSpgSpprmpService; @Post(path = "/dict/search/query", summary = "查询字典接口") @@ -102,10 +118,19 @@ public class BasicDataController { @Post(path = "/adcd/search/query", summary = "查询行政区划列表接口") - public R> queryAddvcdList(@Validated @RequestBody AddvcdSearch search) { + public R> queryAddvcdList(@Validated @RequestBody GeneralSearch search) { return R.ok(stAdcdService.queryBySearch(search)); } + @Get(path = "/adcd/search/query", summary = "查询单个行政区划接口") + public R queryAddvcdById( + @RequestParam(name="adcd") + @Parameter(in = ParameterIn.QUERY, name="adcd",description = "完整行政区划编码") + String adcd + ){ + return R.ok(stAdcdService.queryByAddvcd(adcd)); + } + @Get(path = "/adcd/search/tree", summary = "查询行政区划树接口") public R> queryAddvcdTree( @RequestParam(required = false, name="adcd") @@ -149,7 +174,6 @@ public class BasicDataController { } @Post(path = "/camera/area/search/check", summary = "检查视频区域名称是否存在接口") - @Operation(summary = "检查视频区域名称是否存在接口") public R checkCameraAreaName(@RequestBody @Validated CheckStringSearch checkStringSearch) { try { stCameraAreaService.checkAreaName(checkStringSearch); @@ -160,25 +184,140 @@ public class BasicDataController { } @Post(path = "/camera/search/query", summary = "查询视频列表接口") - @Operation(summary = "查询视频列表接口") public R> queryCameraList(@Validated @RequestBody StCameraSearch search) { return R.ok(stCameraService.queryBySearch(search)); } @Post(path = "/camera/manage/insert", summary = "新增视频接口") - @Operation(summary = "新增视频接口") public R insertCamera(@Validated @RequestBody StCameraB obj) { stCameraService.insert(obj); return R.ok(true); } @Post(path = "/camera/manage/update", summary = "更新视频接口") - @Operation(summary = "更新视频接口") public R updateCamera(@Validated({Update.class}) @RequestBody StCameraB obj) { stCameraService.update(obj); return R.ok(true); } + @Post(path = "/stcd/search/query", summary = "测站列表查询接口-结果集带分页信息") + public R> queryStcdList(@Validated @RequestBody StcdSearch search) { + return R.ok(stStbprpService.queryBySearch(search)); + } + @Get(path = "/stcd/search/query", summary = "单个测站查询接口") + public R queryStcdById( + @RequestParam(name="stcd") + @Parameter(in = ParameterIn.QUERY, name="stcd",description = "测站编码") + String stcd + ) { + return R.ok(stStbprpService.queryByStcd(stcd)); + } + + @Post(path = "/stcd/search/querySelect", summary = "测站列表查询接口-下拉菜单查询使用,不带分页信息") + public R> queryStcdSelect(@Validated @RequestBody StcdSearch search) { + return R.ok(stStbprpService.queryListBySearch(search)); + } + + @Post(path = "/stcd/search/check", summary = "检查测站编码是否存在接口") + public R checkStcdExist(@RequestBody @Validated CheckStringSearch checkStringSearch) { + try { + stStbprpService.checkExist(checkStringSearch); + } catch (IllegalArgumentException e) { + return R.error(417, e.getMessage()); + } + return R.ok(); + } + + @Post(path = "/stcd/manage/insert", summary = "新增测站接口") + public R insertStcd(@Validated @RequestBody StStbprpB obj) { + stStbprpService.insert(obj); + return R.ok(true); + } + + @Post(path = "/stcd/manage/update", summary = "更新测站接口") + public R updateStcd(@Validated @RequestBody StStbprpB obj) { + stStbprpService.update(obj); + return R.ok(true); + } + + @Post(path = "/monct/manage/insert", summary = "新增监测断面接口") + public R insertMonCr(@Validated @RequestBody StMoncrB obj) { + stMoncrService.insert(obj); + return R.ok(true); + } + + @Post(path = "/monct/manage/check", summary = "检查监测断面编码是否存在接口") + public R checkMonCrCode(@Validated @RequestBody CheckStringSearch obj) { + stMoncrService.checkCode(obj); + return R.ok(true); + } + + @Post(path = "/monct/manage/update", summary = "更新监测断面接口") + public R updateMonCr(@Validated @RequestBody StMoncrB obj) { + stMoncrService.update(obj); + return R.ok(true); + } + + @Post(path = "/monct/search/query", summary = "查询监测断面列表接口") + public R> queryMonCrList(@Validated @RequestBody GeneralSearch search) { + return R.ok(stMoncrService.queryBySearch(search)); + } + + //渗压设备 + @Post(path = "/pztb/search/query", summary = "查询渗压设备列表接口") + public R> queryStSpgPztbList(@Validated @RequestBody GeneralSearch search) { + return R.ok(stSpgPztbService.queryBySearch(search)); + } + + @Post(path = "/pztb/search/check", summary = "检查渗压设备编码是否存在接口") + public R checkStSpgPztbList(@Validated @RequestBody CheckStringSearch search) { + try { + stSpgPztbService.checkCode(search); + } catch (IllegalArgumentException e) { + return R.error(417, e.getMessage()); + } + return R.ok(); + } + + @Post(path = "/pztb/manage/insert", summary = "新增渗压设备接口") + public R insertStSpgPztb(@Validated @RequestBody StSpgPztb obj) { + stSpgPztbService.insert(obj); + return R.ok(true); + } + + @Post(path = "/pztb/manage/update", summary = "更新渗压设备接口") + public R updateStSpgPztb(@Validated(Update.class) @RequestBody StSpgPztb obj) { + stSpgPztbService.update(obj); + return R.ok(true); + } + + //渗流 + @Post(path = "/spprmp/search/query", summary = "查询渗流设备列表接口") + public R> queryStSpgSpprmpList(@Validated @RequestBody GeneralSearch search) { + return R.ok(stSpgSpprmpService.queryBySearch(search)); + } + + @Post(path = "/spprmp/search/check", summary = "检查渗流设备编码是否存在接口") + public R checkStSpgSpprmp(@Validated @RequestBody CheckStringSearch search) { + try { + stSpgSpprmpService.checkCode(search); + } catch (IllegalArgumentException e) { + return R.error(417, e.getMessage()); + } + return R.ok(); + } + + @Post(path = "/spprmp/manage/insert", summary = "新增渗流设备接口") + public R insertStSpgSpprmp(@Validated @RequestBody StSpgSpprmp obj) { + stSpgSpprmpService.insert(obj); + return R.ok(true); + } + + @Post(path = "/spprmp/manage/update", summary = "更新渗流设备接口") + public R updateStSpgSpprmp(@Validated(Update.class) @RequestBody StSpgSpprmp obj) { + stSpgSpprmpService.update(obj); + return R.ok(true); + } } diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/AddvcdSearch.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/AddvcdSearch.java deleted file mode 100644 index ce619ab..0000000 --- a/src/main/java/com/gunshi/project/xyt/entity/basedata/AddvcdSearch.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.gunshi.project.xyt.entity.basedata; - -import com.gunshi.db.dto.PageSo; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; -import lombok.Data; - -import java.io.Serializable; - -/** - * @author Sun Lejun - * @version 1.0 - * @date 2024/1/25 - */ - -@Data -@Schema(description = "行政区划查询对象") -public class AddvcdSearch { - @Schema(description="关键词:名称/编码") - private String keyword; - - @NotNull(message = "分页参数不能为空") - @Schema(description = "分页参数") - private PageSo pageSo; -} diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/CheckStringSearch.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/CheckStringSearch.java index 8ac6757..7e5beaf 100644 --- a/src/main/java/com/gunshi/project/xyt/entity/basedata/CheckStringSearch.java +++ b/src/main/java/com/gunshi/project/xyt/entity/basedata/CheckStringSearch.java @@ -16,6 +16,6 @@ public class CheckStringSearch { @Schema(description="编码/名称/关键词") @NotBlank(message = "关键词不能为空") private String keyword; - @Schema(description="修改时候传入当前对象id,用来排除自己") + @Schema(description="修改时候传入当前对象id,用来排除自己 数值类型") private Long id; } diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/GeneralSearch.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/GeneralSearch.java index 9abea30..a292fb9 100644 --- a/src/main/java/com/gunshi/project/xyt/entity/basedata/GeneralSearch.java +++ b/src/main/java/com/gunshi/project/xyt/entity/basedata/GeneralSearch.java @@ -1,5 +1,6 @@ package com.gunshi.project.xyt.entity.basedata; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.gunshi.db.dto.PageSo; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -20,4 +21,20 @@ public class GeneralSearch { @NotNull(message = "分页参数不能为空") @Schema(description = "分页参数") private PageSo pageSo; + + @JsonIgnore + public void setPage(int page){ + if (pageSo == null){ + pageSo = new PageSo(); + } + pageSo.setPageNumber(page); + } + + @JsonIgnore + public void setPageSize(int pageSize){ + if (pageSo == null){ + pageSo = new PageSo(); + } + pageSo.setPageSize(pageSize); + } } diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/StCameraSearch.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/StCameraSearch.java index 6b867de..c3b779b 100644 --- a/src/main/java/com/gunshi/project/xyt/entity/basedata/StCameraSearch.java +++ b/src/main/java/com/gunshi/project/xyt/entity/basedata/StCameraSearch.java @@ -2,13 +2,10 @@ package com.gunshi.project.xyt.entity.basedata; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import com.gunshi.db.dto.PageSo; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; import lombok.Data; - -import java.io.Serializable; +import lombok.EqualsAndHashCode; +import lombok.ToString; /** * @author Sun Lejun @@ -17,18 +14,13 @@ import java.io.Serializable; */ +@EqualsAndHashCode(callSuper = true) @Data +@ToString(callSuper = true) @Schema(description = "视频点查询对象") -public class StCameraSearch { - @Schema(description="关键词:名称") - @Size(max = 20, message = "关键词长度不能超过20") - private String keyword; - +public class StCameraSearch extends GeneralSearch { @Schema(description="监控点类型 传枚举ID") @JsonSerialize(using = ToStringSerializer.class) private Long camType; - @NotNull(message = "分页参数不能为空") - @Schema(description = "分页参数") - private PageSo pageSo; } diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/StSpgPztbVo.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/StSpgPztbVo.java new file mode 100644 index 0000000..b8dcc06 --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/entity/basedata/StSpgPztbVo.java @@ -0,0 +1,25 @@ +package com.gunshi.project.xyt.entity.basedata; + +import com.gunshi.project.xyt.model.StSpgPztb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@EqualsAndHashCode(callSuper = true) +@Data +@ToString(callSuper = true) +@Schema(description="渗压设备信息表") +public class StSpgPztbVo extends StSpgPztb { + @Schema(description="所在断面名称") + private String crNm; + @Schema(description="所在断面编码") + private String crCd; + +} diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/StSpgSpprmpVo.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/StSpgSpprmpVo.java new file mode 100644 index 0000000..12be1fb --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/entity/basedata/StSpgSpprmpVo.java @@ -0,0 +1,26 @@ +package com.gunshi.project.xyt.entity.basedata; + +import com.gunshi.project.xyt.model.StSpgSpprmp; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@EqualsAndHashCode(callSuper = true) +@Data +@ToString(callSuper = true) +@Schema(description="渗流设备信息表") +public class StSpgSpprmpVo extends StSpgSpprmp { + @Schema(description="所在断面名称") + private String crNm; + @Schema(description="所在断面编码") + private String crCd; + @Schema(description="公式名称") + private String formulaName; +} diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/StStbprpVo.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/StStbprpVo.java new file mode 100644 index 0000000..2193958 --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/entity/basedata/StStbprpVo.java @@ -0,0 +1,23 @@ +package com.gunshi.project.xyt.entity.basedata; + +import com.gunshi.project.xyt.model.StStbprpB; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.io.Serializable; + +/** + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class StStbprpVo extends StStbprpB implements Serializable { + @Schema(description="归属协议名称") + private String protocolName; +} diff --git a/src/main/java/com/gunshi/project/xyt/entity/basedata/StcdSearch.java b/src/main/java/com/gunshi/project/xyt/entity/basedata/StcdSearch.java new file mode 100644 index 0000000..a9e2916 --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/entity/basedata/StcdSearch.java @@ -0,0 +1,21 @@ +package com.gunshi.project.xyt.entity.basedata; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@EqualsAndHashCode(callSuper = true) +@Data +@ToString(callSuper = true) +@Schema(description = "监测站点查询对象") +public class StcdSearch extends GeneralSearch { + @Schema(description="归属协议") + private Long protocols; +} diff --git a/src/main/java/com/gunshi/project/xyt/mapper/StMoncrBMapper.java b/src/main/java/com/gunshi/project/xyt/mapper/StMoncrBMapper.java index 39b91fc..e85a14d 100644 --- a/src/main/java/com/gunshi/project/xyt/mapper/StMoncrBMapper.java +++ b/src/main/java/com/gunshi/project/xyt/mapper/StMoncrBMapper.java @@ -1,12 +1,18 @@ package com.gunshi.project.xyt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; import com.gunshi.project.xyt.model.StMoncrB; + import java.util.List; + import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper public interface StMoncrBMapper extends BaseMapper { int batchInsert(@Param("list") List list); + + Page queryBySearch(Page page, @Param("obj") GeneralSearch search); } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/mapper/StSpgPztbMapper.java b/src/main/java/com/gunshi/project/xyt/mapper/StSpgPztbMapper.java index c06b30a..c11b384 100644 --- a/src/main/java/com/gunshi/project/xyt/mapper/StSpgPztbMapper.java +++ b/src/main/java/com/gunshi/project/xyt/mapper/StSpgPztbMapper.java @@ -1,12 +1,27 @@ package com.gunshi.project.xyt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.CheckStringSearch; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; +import com.gunshi.project.xyt.entity.basedata.StSpgPztbVo; import com.gunshi.project.xyt.model.StSpgPztb; + import java.util.List; + import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper public interface StSpgPztbMapper extends BaseMapper { int batchInsert(@Param("list") List list); + + /** + * 校验编码是否存在 + * @param obj 校验对象 + * @return 是否存在 + */ + boolean checkCode(@Param("obj") CheckStringSearch obj); + + Page queryBySearch(Page page, @Param("obj") GeneralSearch search); } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/mapper/StSpgSpprmpMapper.java b/src/main/java/com/gunshi/project/xyt/mapper/StSpgSpprmpMapper.java index 9f944e5..73cfab9 100644 --- a/src/main/java/com/gunshi/project/xyt/mapper/StSpgSpprmpMapper.java +++ b/src/main/java/com/gunshi/project/xyt/mapper/StSpgSpprmpMapper.java @@ -1,12 +1,27 @@ package com.gunshi.project.xyt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.CheckStringSearch; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; +import com.gunshi.project.xyt.entity.basedata.StSpgSpprmpVo; import com.gunshi.project.xyt.model.StSpgSpprmp; + import java.util.List; + import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper public interface StSpgSpprmpMapper extends BaseMapper { int batchInsert(@Param("list") List list); + + /** + * 校验编码是否存在 + * @param obj 校验对象 + * @return 是否存在 + */ + boolean checkCode(@Param("obj")CheckStringSearch obj); + + Page queryBySearch(Page page, @Param("obj") GeneralSearch search); } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/mapper/StStbprpBMapper.java b/src/main/java/com/gunshi/project/xyt/mapper/StStbprpBMapper.java index c7a3385..7ff6b75 100644 --- a/src/main/java/com/gunshi/project/xyt/mapper/StStbprpBMapper.java +++ b/src/main/java/com/gunshi/project/xyt/mapper/StStbprpBMapper.java @@ -1,12 +1,32 @@ package com.gunshi.project.xyt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.StStbprpVo; +import com.gunshi.project.xyt.entity.basedata.StcdSearch; import com.gunshi.project.xyt.model.StStbprpB; + import java.util.List; + import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper public interface StStbprpBMapper extends BaseMapper { int batchInsert(@Param("list") List list); + + /** + * 根据站点编码/名称查询站点 + * @param page 分页对象 + * @param search 查询对象 + * @return 站点集合 + */ + Page queryBySearch(Page page, @Param("obj") StcdSearch search); + + /** + * 根据站点编码/名称查询站点 + * @param search 查询对象 + * @return 站点集合 + */ + List queryBySearch(@Param("obj") StcdSearch search); } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/model/StMoncrB.java b/src/main/java/com/gunshi/project/xyt/model/StMoncrB.java index ac86bec..f5d7ffe 100644 --- a/src/main/java/com/gunshi/project/xyt/model/StMoncrB.java +++ b/src/main/java/com/gunshi/project/xyt/model/StMoncrB.java @@ -7,10 +7,14 @@ 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.project.xyt.validate.markers.Update; import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serializable; import java.util.Date; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; /** @@ -26,6 +30,7 @@ public class StMoncrB implements Serializable { @TableId(value = "CR_ID", type = IdType.INPUT) @Schema(description="断面ID") @JsonSerialize(using = ToStringSerializer.class) + @NotNull(message = "断面ID不能为空", groups = {Update.class}) private Long crId; /** @@ -33,6 +38,8 @@ public class StMoncrB implements Serializable { */ @TableField(value = "CR_CD") @Schema(description="断面编号") + @Size(max = 50,message = "断面编号长度不能超过50") + @NotNull private String crCd; /** @@ -40,6 +47,8 @@ public class StMoncrB implements Serializable { */ @TableField(value = "CR_NM") @Schema(description="断面名称") + @Size(max = 200,message = "断面名称长度不能超过200") + @NotNull private String crNm; /** @@ -48,6 +57,7 @@ public class StMoncrB implements Serializable { @TableField(value = "CR_IMG_ID") @Schema(description="断面平面图 文件ID") @JsonSerialize(using = ToStringSerializer.class) + @NotNull private Long crImgId; /** @@ -62,6 +72,7 @@ public class StMoncrB implements Serializable { */ @TableField(value = "[STATUS]") @Schema(description="状态 1:启用 0:禁用") + @NotNull private Integer status; /** @@ -72,6 +83,14 @@ public class StMoncrB implements Serializable { @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date tm; + /** + * 备注/描述 + */ + @TableField(value = "COMMENTS") + @Schema(description = "备注/描述") + @Size(max = 200,message = "备注/描述长度不能超过200") + private String comments; + public static final String COL_CR_ID = "CR_ID"; public static final String COL_CR_CD = "CR_CD"; @@ -85,4 +104,6 @@ public class StMoncrB implements Serializable { public static final String COL_STATUS = "STATUS"; public static final String COL_TM = "TM"; + + public static final String COL_COMMENTS = "COMMENTS"; } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/model/StSpgPztb.java b/src/main/java/com/gunshi/project/xyt/model/StSpgPztb.java index 590f604..007e2b0 100644 --- a/src/main/java/com/gunshi/project/xyt/model/StSpgPztb.java +++ b/src/main/java/com/gunshi/project/xyt/model/StSpgPztb.java @@ -7,11 +7,15 @@ 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.project.xyt.validate.markers.Update; import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; /** @@ -27,6 +31,7 @@ public class StSpgPztb implements Serializable { @TableId(value = "ID", type = IdType.INPUT) @Schema(description="id") @JsonSerialize(using = ToStringSerializer.class) + @NotNull(message = "id不能为空", groups = {Update.class}) private Long id; /** @@ -34,6 +39,8 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "DEVICE_ID") @Schema(description="测站编码(MCU)") + @NotNull(message = "测站编码(MCU)不能为空") + @Size(max = 30,message = "测站编码(MCU)长度不能超过30") private String deviceId; /** @@ -41,6 +48,8 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "STATION_CODE") @Schema(description="测点编号") + @NotNull(message = "测点编号不能为空") + @Size(max = 50,message = "测点编号长度不能超过30") private String stationCode; /** @@ -48,6 +57,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "CHANNEL_NUM") @Schema(description="通道号") + @NotNull private Integer channelNum; /** @@ -55,6 +65,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "INSTALLATION_POSITION_X") @Schema(description="安装经度") + private BigDecimal installationPositionX; /** @@ -98,6 +109,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "INITIAL_READING") @Schema(description="初始读数") + @NotNull(message = "初始读数不能为空") private BigDecimal initialReading; /** @@ -105,6 +117,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "CALIBRATION_COEFFICIENT") @Schema(description="率定系数") + @NotNull(message = "率定系数不能为空") private BigDecimal calibrationCoefficient; /** @@ -112,6 +125,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "START_TEMPERATURE") @Schema(description="初始温度读数") + @NotNull(message = "初始温度读数不能为空") private BigDecimal startTemperature; /** @@ -119,6 +133,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "TEMPERATURE_K") @Schema(description="温度率定系数") + @NotNull(message = "温度率定系数不能为空") private BigDecimal temperatureK; /** @@ -126,6 +141,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "DAM_HEIGHT") @Schema(description="坝(堰)顶高程") + @NotNull(message = "坝(堰)顶高程不能为空") private BigDecimal damHeight; /** @@ -133,6 +149,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "DIST_FROM_OSMOSIS_METER_TO_BOTTOM") @Schema(description="渗压计到孔底距离") + @NotNull(message = "渗压计到孔底距离不能为空") private BigDecimal distFromOsmosisMeterToBottom; /** @@ -217,6 +234,7 @@ public class StSpgPztb implements Serializable { */ @TableField(value = "EMBEDDING_ELEVATION") @Schema(description="埋设高程") + @NotNull private BigDecimal embeddingElevation; /** @@ -405,6 +423,14 @@ public class StSpgPztb implements Serializable { @Schema(description="管低高程") private BigDecimal pipeBottomHeight; + /** + * 所在断面 + */ + @TableField(value = "CR_ID") + @Schema(description = "所在断面") + @NotNull + private Long crId; + public static final String COL_ID = "ID"; public static final String COL_DEVICE_ID = "DEVICE_ID"; @@ -512,4 +538,6 @@ public class StSpgPztb implements Serializable { public static final String COL_PIPE_TOP_HEIGHT = "PIPE_TOP_HEIGHT"; public static final String COL_PIPE_BOTTOM_HEIGHT = "PIPE_BOTTOM_HEIGHT"; + + public static final String COL_CR_ID = "CR_ID"; } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/model/StSpgSpprmp.java b/src/main/java/com/gunshi/project/xyt/model/StSpgSpprmp.java index c66be99..7956818 100644 --- a/src/main/java/com/gunshi/project/xyt/model/StSpgSpprmp.java +++ b/src/main/java/com/gunshi/project/xyt/model/StSpgSpprmp.java @@ -7,11 +7,15 @@ 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.project.xyt.validate.markers.Update; import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; /** @@ -27,6 +31,7 @@ public class StSpgSpprmp implements Serializable { @TableId(value = "ID", type = IdType.INPUT) @Schema(description="主键") @JsonSerialize(using = ToStringSerializer.class) + @NotNull(message = "主键不能为空", groups = {Update.class}) private Long id; /** @@ -34,6 +39,8 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "DEVICE_ID") @Schema(description="测站编码(MCU)") + @NotNull(message = "测站编码(MCU)不能为空") + @Size(max = 30,message = "测站编码(MCU)长度不能超过30") private String deviceId; /** @@ -41,6 +48,8 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "STATION_CODE") @Schema(description="测点编号") + @NotNull(message = "测点编号不能为空") + @Size(max = 50,message = "测点编号长度不能超过50") private String stationCode; /** @@ -48,6 +57,7 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "CHANNEL_NUM") @Schema(description="通道号") + @NotNull(message = "通道号不能为空") private Integer channelNum; /** @@ -55,6 +65,8 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "PROBE_SERIAL") @Schema(description="仪器编号") + @NotNull(message = "仪器编号不能为空") + @Size(max = 30,message = "仪器编号长度不能超过30") private String probeSerial; /** @@ -62,6 +74,7 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "READING0") @Schema(description="零位读数") + @NotNull(message = "零位读数不能为空") private BigDecimal reading0; /** @@ -167,6 +180,7 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "ZERO_POINT_HEIGHT") @Schema(description="零点高度") + @NotNull(message = "零点高度不能为空") private BigDecimal zeroPointHeight; /** @@ -255,7 +269,8 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "FORMULA") @Schema(description="公式") - private String formula; + @NotNull(message = "公式不能为空") + private Long formula; /** * 创建时间 @@ -277,6 +292,7 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "MAX_H") @Schema(description="最大堰上水头 m") + @NotNull(message = "最大堰上水头 不能为空") private BigDecimal maxH; /** @@ -340,6 +356,7 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "LINEAR_COEFFICIENTG") @Schema(description="直线系数G") + @NotNull(message = "直线系数G不能为空") private BigDecimal linearCoefficientg; /** @@ -347,6 +364,7 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "POLYNOMIAL_COEFFICIENTA") @Schema(description="多项式系数A") + @NotNull(message = "多项式系数A不能为空") private BigDecimal polynomialCoefficienta; /** @@ -354,6 +372,7 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "POLYNOMIAL_COEFFICIENTB") @Schema(description="多项式系数B") + @NotNull(message = "多项式系数B不能为空") private BigDecimal polynomialCoefficientb; /** @@ -361,8 +380,17 @@ public class StSpgSpprmp implements Serializable { */ @TableField(value = "POLYNOMIAL_COEFFICIENTC") @Schema(description="多项式系数C") + @NotNull(message = "多项式系数C不能为空") private BigDecimal polynomialCoefficientc; + /** + * 所在断面 + */ + @TableField(value = "CR_ID") + @Schema(description = "所在断面") + @NotNull(message = "所在断面不能为空") + private Long crId; + public static final String COL_ID = "ID"; public static final String COL_DEVICE_ID = "DEVICE_ID"; @@ -458,4 +486,6 @@ public class StSpgSpprmp implements Serializable { public static final String COL_POLYNOMIAL_COEFFICIENTB = "POLYNOMIAL_COEFFICIENTB"; public static final String COL_POLYNOMIAL_COEFFICIENTC = "POLYNOMIAL_COEFFICIENTC"; + + public static final String COL_CR_ID = "CR_ID"; } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/model/StStbprpB.java b/src/main/java/com/gunshi/project/xyt/model/StStbprpB.java index 47ead49..2d10488 100644 --- a/src/main/java/com/gunshi/project/xyt/model/StStbprpB.java +++ b/src/main/java/com/gunshi/project/xyt/model/StStbprpB.java @@ -8,11 +8,13 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; -import lombok.Data; /** * 监测点基本信息 @@ -26,6 +28,7 @@ public class StStbprpB implements Serializable { */ @TableId(value = "STCD", type = IdType.INPUT) @Schema(description="测站编码") + @NotNull(message = "测站编码不能为空") private String stcd; /** @@ -33,27 +36,29 @@ public class StStbprpB implements Serializable { */ @TableField(value = "STNM") @Schema(description="测站名称") + @NotNull(message = "测站名称不能为空") + @Size(max = 200,message = "测站名称长度不能超过200") private String stnm; /** * 河流名称 */ @TableField(value = "RVNM") - @Schema(description="河流名称") + @Schema(description="河流名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private String rvnm; /** * 水系名称 */ @TableField(value = "HNNM") - @Schema(description="水系名称") + @Schema(description="水系名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private String hnnm; /** * 流域名称 */ @TableField(value = "BSNM") - @Schema(description="流域名称") + @Schema(description="流域名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private String bsnm; /** @@ -61,6 +66,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "LGTD") @Schema(description="经度") + @NotNull(message = "经度不能为空") private BigDecimal lgtd; /** @@ -68,20 +74,22 @@ public class StStbprpB implements Serializable { */ @TableField(value = "LTTD") @Schema(description="纬度") + @NotNull(message = "纬度不能为空") private BigDecimal lttd; /** * 站址 */ @TableField(value = "STLC") - @Schema(description="站址") + @Schema(description="站址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Size(max = 200,message = "站址长度不能超过200") private String stlc; /** * 行政区划码 */ @TableField(value = "ADDVCD") - @Schema(description="行政区划码") + @Schema(description="行政区划码", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private String addvcd; /** @@ -89,6 +97,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "DTMNM") @Schema(description="基面名称") + @Size(max = 200,message = "基面名称长度不能超过200") private String dtmnm; /** @@ -109,7 +118,14 @@ public class StStbprpB implements Serializable { * 站类 */ @TableField(value = "STTP") - @Schema(description="站类") + @Schema(description=""" + 站类 气象站MM 蒸发站BB 堰闸水文站DD + 潮位站TT 泵站DP 墒情站SS + 雨量站PP 河道水文站ZQ 河道水位站ZZ + 水库水文站RR 地下水站ZG 分洪水位站ZB + """) + @NotNull(message = "站类不能为空") + @Size(max = 2,message = "站类长度不能超过2") private String sttp; /** @@ -123,14 +139,16 @@ public class StStbprpB implements Serializable { * 建站年月 */ @TableField(value = "ESSTYM") - @Schema(description="建站年月") + @Schema(description="建站年月 格式yyyyMMdd") + @Size(max = 6,message = "建站年月长度不能超过6") private String esstym; /** * 始报年月 */ @TableField(value = "BGFRYM") - @Schema(description="始报年月") + @Schema(description="始报年月 格式yyyyMMdd") + @Size(max = 6,message = "始报年月长度不能超过6") private String bgfrym; /** @@ -138,6 +156,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "ATCUNIT") @Schema(description="隶属行业单位") + @Size(max = 200,message = "隶属行业单位长度不能超过200") private String atcunit; /** @@ -145,6 +164,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "ADMAUTH") @Schema(description="信息管理单位") + @Size(max = 200,message = "信息管理单位长度不能超过200") private String admauth; /** @@ -152,6 +172,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "LOCALITY") @Schema(description="交换管理单位") + @Size(max = 200,message = "交换管理单位长度不能超过200") private String locality; /** @@ -159,6 +180,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "STBK") @Schema(description="测站岸别") + @Size(max = 1,message = "测站岸别长度不能超过1") private String stbk; /** @@ -201,6 +223,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "COMMENTS") @Schema(description="备注") + @Size(max = 200,message = "备注长度不能超过200") private String comments; /** @@ -216,6 +239,8 @@ public class StStbprpB implements Serializable { */ @TableField(value = "SRC") @Schema(description="站点来源") + @NotNull + @Size(max = 3,message = "站点来源长度不能超过3") private String src; /** @@ -265,6 +290,7 @@ public class StStbprpB implements Serializable { */ @TableField(value = "SIM") @Schema(description="SIM") + @Size(max = 20,message = "SIM长度不能超过20") private String sim; /** @@ -273,8 +299,16 @@ public class StStbprpB implements Serializable { @TableField(value = "PROTOCOLS") @Schema(description="归属协议") @JsonSerialize(using = ToStringSerializer.class) + @NotNull(message = "归属协议不能为空") private Long protocols; + /** + * 北斗卡号 + */ + @TableField(value = "BDNUM") + @Schema(description = "北斗卡号") + private String bdnum; + public static final String COL_STCD = "STCD"; public static final String COL_STNM = "STNM"; @@ -346,4 +380,6 @@ public class StStbprpB implements Serializable { public static final String COL_SIM = "SIM"; public static final String COL_PROTOCOLS = "PROTOCOLS"; + + public static final String COL_BDNUM="BDNUM"; } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/xyt/service/StAdcdService.java b/src/main/java/com/gunshi/project/xyt/service/StAdcdService.java index 3611b0c..963cb9e 100644 --- a/src/main/java/com/gunshi/project/xyt/service/StAdcdService.java +++ b/src/main/java/com/gunshi/project/xyt/service/StAdcdService.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; import com.gunshi.db.dao.BaseOrderDao; -import com.gunshi.project.xyt.entity.basedata.AddvcdSearch; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; import com.gunshi.project.xyt.entity.basedata.StAddvcdTreeVo; import com.gunshi.project.xyt.mapper.StAddvcdDMapper; import com.gunshi.project.xyt.model.StAddvcdD; @@ -39,17 +39,17 @@ public class StAdcdService extends BaseOrderDao { * @param addcd 区划编码 * @return 区划 */ - public StAddvcdD queryByAddcd(String addcd) { + public StAddvcdD queryByAddvcd(String addcd) { return this.getBaseMapper().selectById(addcd); } - public Page queryBySearch(AddvcdSearch addvcdSearch) { + public Page queryBySearch(GeneralSearch search) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.like(StAddvcdD.COL_ADDVCD, addvcdSearch.getKeyword()); + queryWrapper.like(StAddvcdD.COL_ADDVCD, search.getKeyword()); queryWrapper.or(); - queryWrapper.like(StAddvcdD.COL_ADDVNM, addvcdSearch.getKeyword()); + queryWrapper.like(StAddvcdD.COL_ADDVNM, search.getKeyword()); queryWrapper.orderByAsc(StAddvcdD.COL_SORT_ON); - return super.page(addvcdSearch.getPageSo().toPage(), queryWrapper); + return super.page(search.getPageSo().toPage(), queryWrapper); } /** diff --git a/src/main/java/com/gunshi/project/xyt/service/StMoncrService.java b/src/main/java/com/gunshi/project/xyt/service/StMoncrService.java new file mode 100644 index 0000000..ad8af58 --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/service/StMoncrService.java @@ -0,0 +1,91 @@ +package com.gunshi.project.xyt.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.CheckStringSearch; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; +import com.gunshi.project.xyt.mapper.StMoncrBMapper; +import com.gunshi.project.xyt.model.StMoncrB; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; + +/** + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@Service +@Slf4j +@Transactional(rollbackFor = Exception.class) +@Data +public class StMoncrService { + private final StMoncrBMapper stMoncrBMapper; + + + public Page queryBySearch(GeneralSearch search){ + Page page = search.getPageSo().toPage(); + return stMoncrBMapper.queryBySearch(page, search); + } + + /** + * 新增监测断面 + * @param stMoncrB 监测断面对象 + */ + public void insert(StMoncrB stMoncrB) { + CheckStringSearch checkStringSearch = new CheckStringSearch(); + checkStringSearch.setKeyword(stMoncrB.getCrCd()); + checkCode(checkStringSearch); + stMoncrB.setCrId(IdWorker.getId()); + stMoncrB.setSortOn(getMaxSortOn()); + stMoncrB.setTm(new Date()); + stMoncrBMapper.insert(stMoncrB); + } + + /** + * 更新监测断面 + * @param stMoncrB 监测断面对象 + */ + public void update(StMoncrB stMoncrB) { + CheckStringSearch checkStringSearch = new CheckStringSearch(); + checkStringSearch.setKeyword(stMoncrB.getCrCd()); + checkStringSearch.setId(stMoncrB.getCrId()); + checkCode(checkStringSearch); + stMoncrB.setTm(new Date()); + stMoncrBMapper.updateById(stMoncrB); + } + + public int getMaxSortOn(){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StMoncrB.COL_STATUS, 1); + queryWrapper.orderByDesc(StMoncrB.COL_SORT_ON); + StMoncrB stMoncrB = stMoncrBMapper.selectOne(queryWrapper, false); + if(stMoncrB == null){ + return 1; + }else { + return stMoncrB.getSortOn() + 1; + } + } + + /** + * 检查断面编码是否存在 + * @param search 查询对象 + */ + public void checkCode(CheckStringSearch search){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StMoncrB.COL_STATUS, 1); + queryWrapper.eq(StMoncrB.COL_CR_CD, search.getKeyword()); + if(search.getId() != null){ + queryWrapper.ne(StMoncrB.COL_CR_ID, search.getId()); + } + StMoncrB stMoncrB = stMoncrBMapper.selectOne(queryWrapper, false); + if(stMoncrB != null){ + throw new IllegalArgumentException("断面编码已存在"); + } + } +} diff --git a/src/main/java/com/gunshi/project/xyt/service/StSpgPztbService.java b/src/main/java/com/gunshi/project/xyt/service/StSpgPztbService.java new file mode 100644 index 0000000..63164b4 --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/service/StSpgPztbService.java @@ -0,0 +1,95 @@ +package com.gunshi.project.xyt.service; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.CheckStringSearch; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; +import com.gunshi.project.xyt.entity.basedata.StSpgPztbVo; +import com.gunshi.project.xyt.mapper.StSpgPztbMapper; +import com.gunshi.project.xyt.model.StSpgPztb; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; + +/** + * 渗压设备Service + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@Service +@Slf4j +@Transactional(rollbackFor = Exception.class) +@Data +public class StSpgPztbService { + private final StSpgPztbMapper stSpgPztbMapper; + + /** + * 按查询条件查询渗压设备信息表 + * @param search 查询条件 + * @return 渗压设备信息表列表 + */ + public Page queryBySearch(GeneralSearch search) { + Page page = search.getPageSo().toPage(); + return stSpgPztbMapper.queryBySearch(page, search); + } + + /** + * 新增渗压设备信息 + * @param stSpgPztb 渗压设备信息 + */ + public void insert(StSpgPztb stSpgPztb) { + + // 校验编码是否存在 + String deviceId = stSpgPztb.getDeviceId(); + CheckStringSearch checkStringSearch = new CheckStringSearch(); + checkStringSearch.setKeyword(deviceId); + checkCode(checkStringSearch); + String stationCode = stSpgPztb.getStationCode(); + checkStringSearch.setKeyword(stationCode); + checkCode(checkStringSearch); + + // 保存 + stSpgPztb.setId(IdWorker.getId()); + stSpgPztb.setModificationTime(new Date()); + stSpgPztb.setCreationTime(new Date()); + stSpgPztbMapper.insert(stSpgPztb); + } + + /** + * 修改渗压设备信息 + * @param stSpgPztb 渗压设备信息 + */ + public void update(StSpgPztb stSpgPztb) { + // 校验编码是否存在 + Long id = stSpgPztb.getId(); + String deviceId = stSpgPztb.getDeviceId(); + CheckStringSearch checkStringSearch = new CheckStringSearch(); + checkStringSearch.setKeyword(deviceId); + checkStringSearch.setId(id); + checkCode(checkStringSearch); + String stationCode = stSpgPztb.getStationCode(); + checkStringSearch.setKeyword(stationCode); + checkCode(checkStringSearch); + + // 更新 + stSpgPztb.setModificationTime(new Date()); + stSpgPztbMapper.updateById(stSpgPztb); + } + + + /** + * 检查编码是否存在 + * @param checkStringSearch 检查对象 + */ + public void checkCode(CheckStringSearch checkStringSearch) { + boolean b = stSpgPztbMapper.checkCode(checkStringSearch); + if (b) { + throw new IllegalArgumentException("编码已存在"); + } + } +} diff --git a/src/main/java/com/gunshi/project/xyt/service/StSpgSpprmpService.java b/src/main/java/com/gunshi/project/xyt/service/StSpgSpprmpService.java new file mode 100644 index 0000000..5638e79 --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/service/StSpgSpprmpService.java @@ -0,0 +1,95 @@ +package com.gunshi.project.xyt.service; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.CheckStringSearch; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; +import com.gunshi.project.xyt.entity.basedata.StSpgSpprmpVo; +import com.gunshi.project.xyt.mapper.StSpgSpprmpMapper; +import com.gunshi.project.xyt.model.StSpgSpprmp; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; + +/** + * 渗流设备 + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@Service +@Slf4j +@Transactional(rollbackFor = Exception.class) +@Data +public class StSpgSpprmpService { + private final StSpgSpprmpMapper stSpgSpprmpMapper; + + /** + * 按查询条件查询渗流设备信息表 + * @param search 查询条件 + * @return 渗流设备信息表列表 + */ + public Page queryBySearch(GeneralSearch search) { + Page page = search.getPageSo().toPage(); + return stSpgSpprmpMapper.queryBySearch(page, search); + } + + /** + * 新增渗流设备信息 + * @param stSpgSpprmp 渗流设备信息 + */ + public void insert(StSpgSpprmp stSpgSpprmp) { + + // 校验编码是否存在 + String deviceId = stSpgSpprmp.getDeviceId(); + CheckStringSearch checkStringSearch = new CheckStringSearch(); + checkStringSearch.setKeyword(deviceId); + checkCode(checkStringSearch); + String stationCode = stSpgSpprmp.getStationCode(); + checkStringSearch.setKeyword(stationCode); + checkCode(checkStringSearch); + + // 保存 + stSpgSpprmp.setId(IdWorker.getId()); + stSpgSpprmp.setModificationTime(new Date()); + stSpgSpprmp.setCreateTime(new Date()); + stSpgSpprmpMapper.insert(stSpgSpprmp); + } + + /** + * 修改渗流设备信息 + * @param stSpgSpprmp 渗流设备信息 + */ + public void update(StSpgSpprmp stSpgSpprmp) { + // 校验编码是否存在 + Long id = stSpgSpprmp.getId(); + String deviceId = stSpgSpprmp.getDeviceId(); + CheckStringSearch checkStringSearch = new CheckStringSearch(); + checkStringSearch.setKeyword(deviceId); + checkStringSearch.setId(id); + checkCode(checkStringSearch); + String stationCode = stSpgSpprmp.getStationCode(); + checkStringSearch.setKeyword(stationCode); + checkCode(checkStringSearch); + + // 更新 + stSpgSpprmp.setModificationTime(new Date()); + stSpgSpprmpMapper.updateById(stSpgSpprmp); + } + + + /** + * 检查编码是否存在 + * @param checkStringSearch 检查对象 + */ + public void checkCode(CheckStringSearch checkStringSearch) { + boolean b = stSpgSpprmpMapper.checkCode(checkStringSearch); + if (b) { + throw new IllegalArgumentException("编码已存在"); + } + } +} diff --git a/src/main/java/com/gunshi/project/xyt/service/StStbprpService.java b/src/main/java/com/gunshi/project/xyt/service/StStbprpService.java new file mode 100644 index 0000000..f331f7e --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/service/StStbprpService.java @@ -0,0 +1,73 @@ +package com.gunshi.project.xyt.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gunshi.project.xyt.entity.basedata.CheckStringSearch; +import com.gunshi.project.xyt.entity.basedata.StStbprpVo; +import com.gunshi.project.xyt.entity.basedata.StcdSearch; +import com.gunshi.project.xyt.mapper.StStbprpBMapper; +import com.gunshi.project.xyt.model.StStbprpB; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * @author Sun Lejun + * @version 1.0 + * @date 2024/1/26 + */ + +@Service +@Slf4j +@Transactional(rollbackFor = Exception.class) +@Data +public class StStbprpService { + private final StStbprpBMapper stStbprpBMapper; + + /** + * 根据站点编码查询站点信息 + * @param stcd 站点编码 + * @return 站点信息 + */ + public StStbprpB queryByStcd(String stcd) { + return stStbprpBMapper.selectById(stcd); + } + + /** + * 根据站点编码查询站点信息 + * @param search 查询对象 + * @return 站点列表 + */ + public Page queryBySearch(StcdSearch search){ + Page page = search.getPageSo().toPage(); + return stStbprpBMapper.queryBySearch(page, search); + } + + /** + * 根据站点编码查询站点信息 + * @param search 查询对象 + * @return 站点列表 + */ + public List queryListBySearch(StcdSearch search){ + return stStbprpBMapper.queryBySearch(search); + } + + public void insert(StStbprpB stStbprpB) { + stStbprpB.setModitime(new Date()); + stStbprpBMapper.insert(stStbprpB); + } + + public void update(StStbprpB stStbprpB) { + stStbprpB.setModitime(new Date()); + stStbprpBMapper.updateById(stStbprpB); + } + + public void checkExist(CheckStringSearch search) { + if (stStbprpBMapper.selectById(search.getKeyword()) != null) { + throw new IllegalArgumentException("站点编码已存在"); + } + } +} diff --git a/src/main/resources/mapper/StMoncrBMapper.xml b/src/main/resources/mapper/StMoncrBMapper.xml index 449accd..ee02267 100644 --- a/src/main/resources/mapper/StMoncrBMapper.xml +++ b/src/main/resources/mapper/StMoncrBMapper.xml @@ -11,20 +11,33 @@ + - CR_ID, CR_CD, CR_NM, CR_IMG_ID, SORT_ON, [STATUS], TM + CR_ID, CR_CD, CR_NM, CR_IMG_ID, SORT_ON, [STATUS], TM, COMMENTS insert into dbo.ST_MONCR_B - (CR_ID, CR_CD, CR_NM, CR_IMG_ID, SORT_ON, [STATUS], TM) + (CR_ID, CR_CD, CR_NM, CR_IMG_ID, SORT_ON, [STATUS], TM, COMMENTS) values (#{item.crId,jdbcType=BIGINT}, #{item.crCd,jdbcType=VARCHAR}, #{item.crNm,jdbcType=VARCHAR}, #{item.crImgId,jdbcType=BIGINT}, #{item.sortOn,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER}, - #{item.tm,jdbcType=TIMESTAMP}) + #{item.tm,jdbcType=TIMESTAMP}, #{item.comments,jdbcType=VARCHAR}) + + \ No newline at end of file diff --git a/src/main/resources/mapper/StSpgPztbMapper.xml b/src/main/resources/mapper/StSpgPztbMapper.xml index 420022c..2e5df75 100644 --- a/src/main/resources/mapper/StSpgPztbMapper.xml +++ b/src/main/resources/mapper/StSpgPztbMapper.xml @@ -58,6 +58,7 @@ + @@ -70,7 +71,7 @@ ZERO_PRESSURE_READINGS, EMBEDDING_FINISH_READING, EMBEDDING_DATE, AIR_TEMPERATURE, AIR_PRESSURE, WEATHER, HEADWATER_LEVEL, TAILWATER_LEVEL, TECHNICAL_DIRECTOR, CHECK_PERSONNEL, BURIED_PERSONNEL, SKETCH_MAP, [STATUS], MODIFICATION_TIME, CREATION_TIME, SUPERVISOR, - REMARK, PROJECT_NAME, PIPE_TOP_HEIGHT, PIPE_BOTTOM_HEIGHT + REMARK, PROJECT_NAME, PIPE_TOP_HEIGHT, PIPE_BOTTOM_HEIGHT, CR_ID @@ -84,7 +85,7 @@ END_READINGS, ZERO_PRESSURE_READINGS, EMBEDDING_FINISH_READING, EMBEDDING_DATE, AIR_TEMPERATURE, AIR_PRESSURE, WEATHER, HEADWATER_LEVEL, TAILWATER_LEVEL, TECHNICAL_DIRECTOR, CHECK_PERSONNEL, BURIED_PERSONNEL, SKETCH_MAP, [STATUS], MODIFICATION_TIME, CREATION_TIME, - SUPERVISOR, REMARK, PROJECT_NAME, PIPE_TOP_HEIGHT, PIPE_BOTTOM_HEIGHT) + SUPERVISOR, REMARK, PROJECT_NAME, PIPE_TOP_HEIGHT, PIPE_BOTTOM_HEIGHT, CR_ID) values (#{item.id,jdbcType=BIGINT}, #{item.deviceId,jdbcType=VARCHAR}, #{item.stationCode,jdbcType=VARCHAR}, @@ -108,8 +109,41 @@ #{item.checkPersonnel,jdbcType=VARCHAR}, #{item.buriedPersonnel,jdbcType=VARCHAR}, #{item.sketchMap,jdbcType=BIGINT}, #{item.status,jdbcType=INTEGER}, #{item.modificationTime,jdbcType=TIMESTAMP}, #{item.creationTime,jdbcType=TIMESTAMP}, #{item.supervisor,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, - #{item.projectName,jdbcType=VARCHAR}, #{item.pipeTopHeight,jdbcType=DECIMAL}, #{item.pipeBottomHeight,jdbcType=DECIMAL} - ) + #{item.projectName,jdbcType=VARCHAR}, #{item.pipeTopHeight,jdbcType=DECIMAL}, #{item.pipeBottomHeight,jdbcType=DECIMAL}, + #{item.crId,jdbcType=BIGINT}) + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/StSpgSpprmpMapper.xml b/src/main/resources/mapper/StSpgSpprmpMapper.xml index 727d473..f48079b 100644 --- a/src/main/resources/mapper/StSpgSpprmpMapper.xml +++ b/src/main/resources/mapper/StSpgSpprmpMapper.xml @@ -1,103 +1,227 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ID, DEVICE_ID, STATION_CODE, CHANNEL_NUM, PROBE_SERIAL, READING0, TEMPERATURE0, TEMPERATURE1, - DEVICE_MEASURE, DEVICE_MEASURE_AFTER, PROJECT_LOCATION, PROJECT_NAME, MANUFACTURER, - STATION_TYPE, STANK_TYPE, STANK_MATERIAL, STANK_TOP_TO_BOTTOM_DISTANCE, STANK_SIZE, - RULER_TYPE, RULER_POSITION, ZERO_POINT_HEIGHT, TEMPERATURE_MOD, MEASURE, SKETCH_MAP, - DIRECTOR, VERIFIER, [OPERATOR], SUPERVISOR, INSTALL_DATE, REMARK, MODIFICATION_TIME, - LATEST_REPORTING_TIME, FORMULA, CREATE_TIME, [STATUS], MAX_H, INSTALLATION_POSITION_X, - INSTALLATION_POSITION_Y, INSTALLATION_POSITION_Z, HEADWATER_LEVEL, TAILWATER_LEVEL, - AIR_TEMPERATURE, AIR_PRESSURE, WEATHER, LINEAR_COEFFICIENTG, POLYNOMIAL_COEFFICIENTA, - POLYNOMIAL_COEFFICIENTB, POLYNOMIAL_COEFFICIENTC - - - - insert into dbo.ST_SPG_SPPRMP - (ID, DEVICE_ID, STATION_CODE, CHANNEL_NUM, PROBE_SERIAL, READING0, TEMPERATURE0, - TEMPERATURE1, DEVICE_MEASURE, DEVICE_MEASURE_AFTER, PROJECT_LOCATION, PROJECT_NAME, - MANUFACTURER, STATION_TYPE, STANK_TYPE, STANK_MATERIAL, STANK_TOP_TO_BOTTOM_DISTANCE, - STANK_SIZE, RULER_TYPE, RULER_POSITION, ZERO_POINT_HEIGHT, TEMPERATURE_MOD, MEASURE, - SKETCH_MAP, DIRECTOR, VERIFIER, [OPERATOR], SUPERVISOR, INSTALL_DATE, REMARK, MODIFICATION_TIME, - LATEST_REPORTING_TIME, FORMULA, CREATE_TIME, [STATUS], MAX_H, INSTALLATION_POSITION_X, - INSTALLATION_POSITION_Y, INSTALLATION_POSITION_Z, HEADWATER_LEVEL, TAILWATER_LEVEL, - AIR_TEMPERATURE, AIR_PRESSURE, WEATHER, LINEAR_COEFFICIENTG, POLYNOMIAL_COEFFICIENTA, - POLYNOMIAL_COEFFICIENTB, POLYNOMIAL_COEFFICIENTC) - values - - (#{item.id,jdbcType=BIGINT}, #{item.deviceId,jdbcType=VARCHAR}, #{item.stationCode,jdbcType=VARCHAR}, - #{item.channelNum,jdbcType=INTEGER}, #{item.probeSerial,jdbcType=VARCHAR}, #{item.reading0,jdbcType=DECIMAL}, - #{item.temperature0,jdbcType=DECIMAL}, #{item.temperature1,jdbcType=DECIMAL}, #{item.deviceMeasure,jdbcType=DECIMAL}, - #{item.deviceMeasureAfter,jdbcType=DECIMAL}, #{item.projectLocation,jdbcType=VARCHAR}, - #{item.projectName,jdbcType=VARCHAR}, #{item.manufacturer,jdbcType=VARCHAR}, #{item.stationType,jdbcType=VARCHAR}, - #{item.stankType,jdbcType=VARCHAR}, #{item.stankMaterial,jdbcType=VARCHAR}, #{item.stankTopToBottomDistance,jdbcType=DECIMAL}, - #{item.stankSize,jdbcType=VARCHAR}, #{item.rulerType,jdbcType=VARCHAR}, #{item.rulerPosition,jdbcType=VARCHAR}, - #{item.zeroPointHeight,jdbcType=DECIMAL}, #{item.temperatureMod,jdbcType=DECIMAL}, - #{item.measure,jdbcType=DECIMAL}, #{item.sketchMap,jdbcType=BIGINT}, #{item.director,jdbcType=VARCHAR}, - #{item.verifier,jdbcType=VARCHAR}, #{item.operator,jdbcType=VARCHAR}, #{item.supervisor,jdbcType=VARCHAR}, - #{item.installDate,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR}, #{item.modificationTime,jdbcType=TIMESTAMP}, - #{item.latestReportingTime,jdbcType=TIMESTAMP}, #{item.formula,jdbcType=VARCHAR}, - #{item.createTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER}, #{item.maxH,jdbcType=DECIMAL}, - #{item.installationPositionX,jdbcType=DECIMAL}, #{item.installationPositionY,jdbcType=DECIMAL}, - #{item.installationPositionZ,jdbcType=DECIMAL}, #{item.headwaterLevel,jdbcType=DECIMAL}, - #{item.tailwaterLevel,jdbcType=DECIMAL}, #{item.airTemperature,jdbcType=DECIMAL}, - #{item.airPressure,jdbcType=DECIMAL}, #{item.weather,jdbcType=VARCHAR}, #{item.linearCoefficientg,jdbcType=DECIMAL}, - #{item.polynomialCoefficienta,jdbcType=DECIMAL}, #{item.polynomialCoefficientb,jdbcType=DECIMAL}, - #{item.polynomialCoefficientc,jdbcType=DECIMAL}) - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID, + DEVICE_ID, + STATION_CODE, + CHANNEL_NUM, + PROBE_SERIAL, + READING0, + TEMPERATURE0, + TEMPERATURE1, + DEVICE_MEASURE, + DEVICE_MEASURE_AFTER, + PROJECT_LOCATION, + PROJECT_NAME, + MANUFACTURER, + STATION_TYPE, + STANK_TYPE, + STANK_MATERIAL, + STANK_TOP_TO_BOTTOM_DISTANCE, + STANK_SIZE, + RULER_TYPE, + RULER_POSITION, + ZERO_POINT_HEIGHT, + TEMPERATURE_MOD, + MEASURE, + SKETCH_MAP, + DIRECTOR, + VERIFIER, + [OPERATOR], + SUPERVISOR, + INSTALL_DATE, + REMARK, + MODIFICATION_TIME, + LATEST_REPORTING_TIME, + FORMULA, + CREATE_TIME, + [STATUS], + MAX_H, + INSTALLATION_POSITION_X, + INSTALLATION_POSITION_Y, + INSTALLATION_POSITION_Z, + HEADWATER_LEVEL, + TAILWATER_LEVEL, + AIR_TEMPERATURE, + AIR_PRESSURE, + WEATHER, + LINEAR_COEFFICIENTG, + POLYNOMIAL_COEFFICIENTA, + POLYNOMIAL_COEFFICIENTB, + POLYNOMIAL_COEFFICIENTC, + CR_ID + + + + insert into dbo.ST_SPG_SPPRMP + (ID, DEVICE_ID, STATION_CODE, CHANNEL_NUM, PROBE_SERIAL, READING0, TEMPERATURE0, + TEMPERATURE1, DEVICE_MEASURE, DEVICE_MEASURE_AFTER, PROJECT_LOCATION, PROJECT_NAME, + MANUFACTURER, STATION_TYPE, STANK_TYPE, STANK_MATERIAL, STANK_TOP_TO_BOTTOM_DISTANCE, + STANK_SIZE, RULER_TYPE, RULER_POSITION, ZERO_POINT_HEIGHT, TEMPERATURE_MOD, MEASURE, + SKETCH_MAP, DIRECTOR, VERIFIER, [OPERATOR], SUPERVISOR, INSTALL_DATE, REMARK, MODIFICATION_TIME, + LATEST_REPORTING_TIME, FORMULA, CREATE_TIME, [STATUS], MAX_H, INSTALLATION_POSITION_X, + INSTALLATION_POSITION_Y, INSTALLATION_POSITION_Z, HEADWATER_LEVEL, TAILWATER_LEVEL, + AIR_TEMPERATURE, AIR_PRESSURE, WEATHER, LINEAR_COEFFICIENTG, POLYNOMIAL_COEFFICIENTA, + POLYNOMIAL_COEFFICIENTB, POLYNOMIAL_COEFFICIENTC, CR_ID) + values + + (#{item.id,jdbcType=BIGINT}, #{item.deviceId,jdbcType=VARCHAR}, #{item.stationCode,jdbcType=VARCHAR}, + #{item.channelNum,jdbcType=INTEGER}, #{item.probeSerial,jdbcType=VARCHAR}, + #{item.reading0,jdbcType=DECIMAL}, + #{item.temperature0,jdbcType=DECIMAL}, #{item.temperature1,jdbcType=DECIMAL}, + #{item.deviceMeasure,jdbcType=DECIMAL}, + #{item.deviceMeasureAfter,jdbcType=DECIMAL}, #{item.projectLocation,jdbcType=VARCHAR}, + #{item.projectName,jdbcType=VARCHAR}, #{item.manufacturer,jdbcType=VARCHAR}, + #{item.stationType,jdbcType=VARCHAR}, + #{item.stankType,jdbcType=VARCHAR}, #{item.stankMaterial,jdbcType=VARCHAR}, + #{item.stankTopToBottomDistance,jdbcType=DECIMAL}, + #{item.stankSize,jdbcType=VARCHAR}, #{item.rulerType,jdbcType=VARCHAR}, + #{item.rulerPosition,jdbcType=VARCHAR}, + #{item.zeroPointHeight,jdbcType=DECIMAL}, #{item.temperatureMod,jdbcType=DECIMAL}, + #{item.measure,jdbcType=DECIMAL}, #{item.sketchMap,jdbcType=BIGINT}, #{item.director,jdbcType=VARCHAR}, + #{item.verifier,jdbcType=VARCHAR}, #{item.operator,jdbcType=VARCHAR}, #{item.supervisor,jdbcType=VARCHAR}, + #{item.installDate,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR}, + #{item.modificationTime,jdbcType=TIMESTAMP}, + #{item.latestReportingTime,jdbcType=TIMESTAMP}, #{item.formula,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER}, #{item.maxH,jdbcType=DECIMAL}, + #{item.installationPositionX,jdbcType=DECIMAL}, #{item.installationPositionY,jdbcType=DECIMAL}, + #{item.installationPositionZ,jdbcType=DECIMAL}, #{item.headwaterLevel,jdbcType=DECIMAL}, + #{item.tailwaterLevel,jdbcType=DECIMAL}, #{item.airTemperature,jdbcType=DECIMAL}, + #{item.airPressure,jdbcType=DECIMAL}, #{item.weather,jdbcType=VARCHAR}, + #{item.linearCoefficientg,jdbcType=DECIMAL}, + #{item.polynomialCoefficienta,jdbcType=DECIMAL}, #{item.polynomialCoefficientb,jdbcType=DECIMAL}, + #{item.polynomialCoefficientc,jdbcType=DECIMAL}, #{item.crId,jdbcType=BIGINT}) + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/StStbprpBMapper.xml b/src/main/resources/mapper/StStbprpBMapper.xml index f081bdb..772809f 100644 --- a/src/main/resources/mapper/StStbprpBMapper.xml +++ b/src/main/resources/mapper/StStbprpBMapper.xml @@ -1,75 +1,160 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - STCD, STNM, RVNM, HNNM, BSNM, LGTD, LTTD, STLC, ADDVCD, DTMNM, DTMEL, DTPR, STTP, - FRGRD, ESSTYM, BGFRYM, ATCUNIT, ADMAUTH, LOCALITY, STBK, STAZT, DSTRVM, DRNA, PHCD, - USFL, COMMENTS, MODITIME, SRC, IRR_CODE, ENG_MAN_CODE, [TYPE], CHAN_CODE, RV_CODE, - BNCH, SIM, PROTOCOLS - - - - insert into dbo.ST_STBPRP_B - (STCD, STNM, RVNM, HNNM, BSNM, LGTD, LTTD, STLC, ADDVCD, DTMNM, DTMEL, DTPR, STTP, - FRGRD, ESSTYM, BGFRYM, ATCUNIT, ADMAUTH, LOCALITY, STBK, STAZT, DSTRVM, DRNA, PHCD, - USFL, COMMENTS, MODITIME, SRC, IRR_CODE, ENG_MAN_CODE, [TYPE], CHAN_CODE, RV_CODE, - BNCH, SIM, PROTOCOLS) - values - - (#{item.stcd,jdbcType=VARCHAR}, #{item.stnm,jdbcType=VARCHAR}, #{item.rvnm,jdbcType=VARCHAR}, - #{item.hnnm,jdbcType=VARCHAR}, #{item.bsnm,jdbcType=VARCHAR}, #{item.lgtd,jdbcType=DECIMAL}, - #{item.lttd,jdbcType=DECIMAL}, #{item.stlc,jdbcType=VARCHAR}, #{item.addvcd,jdbcType=VARCHAR}, - #{item.dtmnm,jdbcType=VARCHAR}, #{item.dtmel,jdbcType=DECIMAL}, #{item.dtpr,jdbcType=DECIMAL}, - #{item.sttp,jdbcType=VARCHAR}, #{item.frgrd,jdbcType=VARCHAR}, #{item.esstym,jdbcType=VARCHAR}, - #{item.bgfrym,jdbcType=VARCHAR}, #{item.atcunit,jdbcType=VARCHAR}, #{item.admauth,jdbcType=VARCHAR}, - #{item.locality,jdbcType=VARCHAR}, #{item.stbk,jdbcType=VARCHAR}, #{item.stazt,jdbcType=DECIMAL}, - #{item.dstrvm,jdbcType=DECIMAL}, #{item.drna,jdbcType=DECIMAL}, #{item.phcd,jdbcType=VARCHAR}, - #{item.usfl,jdbcType=VARCHAR}, #{item.comments,jdbcType=VARCHAR}, #{item.moditime,jdbcType=TIMESTAMP}, - #{item.src,jdbcType=VARCHAR}, #{item.irrCode,jdbcType=VARCHAR}, #{item.engManCode,jdbcType=VARCHAR}, - #{item.type,jdbcType=VARCHAR}, #{item.chanCode,jdbcType=VARCHAR}, #{item.rvCode,jdbcType=VARCHAR}, - #{item.bnch,jdbcType=VARCHAR}, #{item.sim,jdbcType=VARCHAR}, #{item.protocols,jdbcType=BIGINT} - ) - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + STCD, + STNM, + RVNM, + HNNM, + BSNM, + LGTD, + LTTD, + STLC, + ADDVCD, + DTMNM, + DTMEL, + DTPR, + STTP, + FRGRD, + ESSTYM, + BGFRYM, + ATCUNIT, + ADMAUTH, + LOCALITY, + STBK, + STAZT, + DSTRVM, + DRNA, + PHCD, + USFL, + COMMENTS, + MODITIME, + SRC, + IRR_CODE, + ENG_MAN_CODE, + [TYPE], + CHAN_CODE, + RV_CODE, + BNCH, + SIM, + PROTOCOLS, + BDNUM + + + + insert into dbo.ST_STBPRP_B + (STCD, STNM, RVNM, HNNM, BSNM, LGTD, LTTD, STLC, ADDVCD, DTMNM, DTMEL, DTPR, STTP, + FRGRD, ESSTYM, BGFRYM, ATCUNIT, ADMAUTH, LOCALITY, STBK, STAZT, DSTRVM, DRNA, PHCD, + USFL, COMMENTS, MODITIME, SRC, IRR_CODE, ENG_MAN_CODE, [TYPE], CHAN_CODE, RV_CODE, + BNCH, SIM, PROTOCOLS, BDNUM) + values + + (#{item.stcd,jdbcType=VARCHAR}, #{item.stnm,jdbcType=VARCHAR}, #{item.rvnm,jdbcType=VARCHAR}, + #{item.hnnm,jdbcType=VARCHAR}, #{item.bsnm,jdbcType=VARCHAR}, #{item.lgtd,jdbcType=DECIMAL}, + #{item.lttd,jdbcType=DECIMAL}, #{item.stlc,jdbcType=VARCHAR}, #{item.addvcd,jdbcType=VARCHAR}, + #{item.dtmnm,jdbcType=VARCHAR}, #{item.dtmel,jdbcType=DECIMAL}, #{item.dtpr,jdbcType=DECIMAL}, + #{item.sttp,jdbcType=VARCHAR}, #{item.frgrd,jdbcType=VARCHAR}, #{item.esstym,jdbcType=VARCHAR}, + #{item.bgfrym,jdbcType=VARCHAR}, #{item.atcunit,jdbcType=VARCHAR}, #{item.admauth,jdbcType=VARCHAR}, + #{item.locality,jdbcType=VARCHAR}, #{item.stbk,jdbcType=VARCHAR}, #{item.stazt,jdbcType=DECIMAL}, + #{item.dstrvm,jdbcType=DECIMAL}, #{item.drna,jdbcType=DECIMAL}, #{item.phcd,jdbcType=VARCHAR}, + #{item.usfl,jdbcType=VARCHAR}, #{item.comments,jdbcType=VARCHAR}, #{item.moditime,jdbcType=TIMESTAMP}, + #{item.src,jdbcType=VARCHAR}, #{item.irrCode,jdbcType=VARCHAR}, #{item.engManCode,jdbcType=VARCHAR}, + #{item.type,jdbcType=VARCHAR}, #{item.chanCode,jdbcType=VARCHAR}, #{item.rvCode,jdbcType=VARCHAR}, + #{item.bnch,jdbcType=VARCHAR}, #{item.sim,jdbcType=VARCHAR}, #{item.protocols,jdbcType=BIGINT}, + #{item.bdnum,jdbcType=VARCHAR}) + + + + \ No newline at end of file diff --git a/src/test/java/com/gunshi/project/xyt/service/StAdcdServiceTest.java b/src/test/java/com/gunshi/project/xyt/service/StAdcdServiceTest.java index ee9c9f5..b25ad12 100644 --- a/src/test/java/com/gunshi/project/xyt/service/StAdcdServiceTest.java +++ b/src/test/java/com/gunshi/project/xyt/service/StAdcdServiceTest.java @@ -1,7 +1,7 @@ package com.gunshi.project.xyt.service; import com.gunshi.project.xyt.Main; -import com.gunshi.project.xyt.entity.basedata.AddvcdSearch; +import com.gunshi.project.xyt.entity.basedata.GeneralSearch; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -9,8 +9,6 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ContextConfiguration; import ru.olegcherednik.jackson_utils.JacksonUtils; -import static org.junit.jupiter.api.Assertions.*; - @SpringBootTest @ContextConfiguration(classes = Main.class) @Slf4j @@ -20,23 +18,23 @@ class StAdcdServiceTest { @Test void queryBySearch() { - AddvcdSearch addvcdSearch = new AddvcdSearch(); + GeneralSearch addvcdSearch = new GeneralSearch(); addvcdSearch.setKeyword("麻城"); log.info("{}", JacksonUtils.writeValue(stAdcdService.queryBySearch(addvcdSearch))); } @Test void test(){ - System.out.println(stAdcdService.getParentAddvcd("420000000000000")); - System.out.println(stAdcdService.getParentAddvcd("421100000000000")); - System.out.println(stAdcdService.getParentAddvcd("421212000000000")); - System.out.println(stAdcdService.getParentAddvcd("421312101000000")); - System.out.println(stAdcdService.getParentAddvcd("421413102101000")); - System.out.println(stAdcdService.getParentAddvcd("421514112201123")); + log.info("{}",stAdcdService.getParentAddvcd("420000000000000")); + log.info("{}",stAdcdService.getParentAddvcd("421100000000000")); + log.info("{}",stAdcdService.getParentAddvcd("421212000000000")); + log.info("{}",stAdcdService.getParentAddvcd("421312101000000")); + log.info("{}",stAdcdService.getParentAddvcd("421413102101000")); + log.info("{}",stAdcdService.getParentAddvcd("421514112201123")); } @Test void queryTree() { - log.info("{}", JacksonUtils.writeValue(stAdcdService.queryTree("421181"))); + log.info("{}", JacksonUtils.writeValue(stAdcdService.queryTree("420116001"))); } } \ No newline at end of file