Merge remote-tracking branch 'origin/master'
2 文件已重命名
12个文件已修改
6个文件已添加
| | |
| | | |
| | | 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) ; |
| | | } |
| | | /** |
| | | * ä¿åï¼æ·»å ï¼è§é¢çæ§ç¹ |