1、水肥机分页查询功能实现;
2、气象站分页查询功能实现;
3、墒情站分页查询功能实现;
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | |
| | | VoManure selectOne(Long id) ; |
| | | /** |
| | | * 根据指定条件查询记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long totalCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoManure> selectSome(Map<?, ?> params); |
| | | |
| | | |
| | | int updateByPrimaryKeySelective(PrStManure record); |
| | | |
| | | int updateByPrimaryKey(PrStManure record); |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | |
| | | VoSoil selectOne(Long id) ; |
| | | /** |
| | | * 根据指定条件查询记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long totalCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoSoil> selectSome(Map<?, ?> params); |
| | | |
| | | int updateByPrimaryKeySelective(PrStSoil record); |
| | | |
| | | int updateByPrimaryKey(PrStSoil record); |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoWeather; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | PrStWeather selectByPrimaryKey(Long id); |
| | | |
| | | |
| | | VoWeather selectOne(Long id) ; |
| | | /** |
| | | * 根据指定条件查询记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long totalCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoWeather> selectSome(Map<?, ?> params); |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStWeather record); |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @JsonPropertyOrder({ "id", "fboxId", "no", "name", "lng", "lat", "remark"}) |
| | | @Schema(title = "水肥机值对象") |
| | | public class VoManure implements BaseEntity { |
| | | private static final long serialVersionUID = 202506241715001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @Schema(title = "水肥机ID") |
| | | public Long id; |
| | | |
| | | /** |
| | | * FBox序列号 |
| | | */ |
| | | @Schema(title = "FBox序列号") |
| | | public String fboxId ; |
| | | |
| | | /** |
| | | * 水肥站编号 |
| | | */ |
| | | @Schema(title = "编号") |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * 水肥站名称 |
| | | */ |
| | | @Schema(title = "名称") |
| | | public String name; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @Schema(title = "经度") |
| | | public Double lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @Schema(title = "纬度") |
| | | public Double lat; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(title = "备注") |
| | | public String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @JsonPropertyOrder({ "id", "fboxId", "no", "name", "lng", "lat", "remark"}) |
| | | @Schema(title = "墒情站值对象") |
| | | public class VoSoil implements BaseEntity { |
| | | private static final long serialVersionUID = 202506241715002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @Schema(title = "墒情站ID") |
| | | public Long id; |
| | | |
| | | /** |
| | | * FBox序列号 |
| | | */ |
| | | @Schema(title = "FBox序列号") |
| | | public String fboxId ; |
| | | |
| | | /** |
| | | * 水肥站编号 |
| | | */ |
| | | @Schema(title = "编号") |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * 水肥站名称 |
| | | */ |
| | | @Schema(title = "名称") |
| | | public String name; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @Schema(title = "经度") |
| | | public Double lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @Schema(title = "纬度") |
| | | public Double lat; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(title = "备注") |
| | | public String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @JsonPropertyOrder({ "id", "fboxId", "no", "name", "lng", "lat", "remark"}) |
| | | @Schema(title = "气象站值对象") |
| | | public class VoWeather implements BaseEntity { |
| | | private static final long serialVersionUID = 202506241715003L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @Schema(title = "气象站ID") |
| | | public Long id; |
| | | |
| | | /** |
| | | * FBox序列号 |
| | | */ |
| | | @Schema(title = "FBox序列号") |
| | | public String fboxId ; |
| | | |
| | | /** |
| | | * 水肥站编号 |
| | | */ |
| | | @Schema(title = "编号") |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * 水肥站名称 |
| | | */ |
| | | @Schema(title = "名称") |
| | | public String name; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @Schema(title = "经度") |
| | | public Double lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @Schema(title = "纬度") |
| | | public Double lat; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(title = "备注") |
| | | public String remark; |
| | | |
| | | } |
| | |
| | | from pr_st_manure |
| | | where deleted != 1 ; |
| | | </select> |
| | | |
| | | <select id="selectOne" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voPr.VoManure"> |
| | | <!--@mbg.generated--> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_manure tb |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--根据指定条件查询总数--> |
| | | <select id="totalCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM pr_st_manure tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据指定条件查询--> |
| | | <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voPr.VoManure"> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_manure tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY tb.id DESC |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_st_manure |
| | |
| | | from pr_st_soil |
| | | where deleted != 1 ; |
| | | </select> |
| | | |
| | | <select id="selectOne" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voPr.VoSoil"> |
| | | <!--@mbg.generated--> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_soil tb |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <!--根据指定条件查询总数--> |
| | | <select id="totalCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM pr_st_soil tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据指定条件查询--> |
| | | <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voPr.VoSoil"> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_soil tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY tb.id DESC |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_st_soil |
| | |
| | | from pr_st_weather |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectOne" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voPr.VoWeather"> |
| | | <!--@mbg.generated--> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_weather tb |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <!--根据指定条件查询总数--> |
| | | <select id="totalCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM pr_st_weather tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据指定条件查询--> |
| | | <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voPr.VoWeather"> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_weather tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY tb.id DESC |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <select id="selectAllSimple" resultType="com.dy.pipIrrGlobal.voPr.VoMqttSimple"> |
| | | <!--@mbg.generated--> |
| | | select |
| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoManure; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询水肥机记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页水肥机记录", description = "返回一页水肥机数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页水肥机数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoManure.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoManure>>> some(QueryVo vo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectSome(vo)); |
| | | } catch (Exception e) { |
| | | log.error("获取水肥机记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得到一套水肥机数据 |
| | |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一套水肥机数据(BaseResponse.content:{})", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = PrStManure.class))} |
| | | schema = @Schema(implementation = VoManure.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<PrStManure> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); |
| | | public BaseResponse<VoManure> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectOne(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrStManureMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * |
| | | * @param queryVo 查询值对象 |
| | | * @return 记录列表 |
| | | */ |
| | | public QueryResultVo<List<VoManure>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = dao.totalCount(params); |
| | | |
| | | QueryResultVo<List<VoManure>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = dao.selectSome(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 得到一个实体 |
| | | * @param id 实体ID |
| | | * @return 实体 |
| | | */ |
| | | public PrStManure selectById(Long id){ |
| | | return this.dao.selectById(id) ; |
| | | public VoManure selectOne(Long id){ |
| | | return this.dao.selectOne(id) ; |
| | | } |
| | | /** |
| | | * 保存(添加)视频监控点 |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:21 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "水肥机查询条件") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "水肥机名称") |
| | | public String name; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.soil; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:21 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "墒情站查询条件") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "墒情站名称") |
| | | public String name; |
| | | } |
| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询墒情站记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页墒情站记录", description = "返回一页墒情站数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页墒情站数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoSoil.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoSoil>>> some(QueryVo vo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectSome(vo)); |
| | | } catch (Exception e) { |
| | | log.error("获取墒情站记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得到一套墒情站数据 |
| | |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一套墒情站数据(BaseResponse.content:{})", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = PrStSoil.class))} |
| | | schema = @Schema(implementation = VoSoil.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<PrStSoil> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); |
| | | public BaseResponse<VoSoil> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectOne(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.dy.pipIrrProject.mqtt.soil; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrStSoilMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | public List<VoMqttSimple> allSimple(){ |
| | | return this.dao.selectAllSimple() ; |
| | | } |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * |
| | | * @param queryVo 查询值对象 |
| | | * @return 记录列表 |
| | | */ |
| | | public QueryResultVo<List<VoSoil>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = dao.totalCount(params); |
| | | |
| | | QueryResultVo<List<VoSoil>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = dao.selectSome(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 得到一个实体 |
| | | * @param id 实体ID |
| | | * @return 实体 |
| | | */ |
| | | public PrStSoil selectById(Long id){ |
| | | return this.dao.selectById(id) ; |
| | | public VoSoil selectOne(Long id){ |
| | | return this.dao.selectOne(id) ; |
| | | } |
| | | /** |
| | | * 保存(添加)视频监控点 |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.weather; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:21 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "气象站查询条件") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "气象站名称") |
| | | public String name; |
| | | } |
| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.pipIrrGlobal.voPr.VoWeather; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询气象站记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页气象站记录", description = "返回一页气象站数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页气象站数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoWeather.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoWeather>>> some(QueryVo vo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectSome(vo)); |
| | | } catch (Exception e) { |
| | | log.error("获取气象站记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得到一套气象站数据 |
| | |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一套气象站数据(BaseResponse.content:{})", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = PrStWeather.class))} |
| | | schema = @Schema(implementation = VoWeather.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<PrStWeather> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); |
| | | public BaseResponse<VoWeather> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectOne(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.dy.pipIrrProject.mqtt.weather; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrStWeatherMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoWeather; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | public List<VoMqttSimple> allSimple(){ |
| | | return this.dao.selectAllSimple() ; |
| | | } |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * |
| | | * @param queryVo 查询值对象 |
| | | * @return 记录列表 |
| | | */ |
| | | public QueryResultVo<List<VoWeather>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = dao.totalCount(params); |
| | | |
| | | QueryResultVo<List<VoWeather>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = dao.selectSome(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 得到一个实体 |
| | | * @param id 实体ID |
| | | * @return 实体 |
| | | */ |
| | | public PrStWeather selectById(Long id){ |
| | | return this.dao.selectById(id) ; |
| | | public VoWeather selectOne(Long id){ |
| | | return this.dao.selectOne(id) ; |
| | | } |
| | | /** |
| | | * 保存(添加)视频监控点 |