| | |
| | | */ |
| | | List<VoManure> selectSome(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param manureId |
| | | * @return |
| | | */ |
| | | List<VoManure> selectSomeByManureId(@Param("manureId") Long manureId); |
| | | |
| | | int updateByPrimaryKeySelective(RmManureLast record); |
| | | |
| | | int updateByPrimaryKey(RmManureLast record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoSoil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | RmSoilHistory selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long selectCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoSoil> selectSome(Map<?, ?> params); |
| | | |
| | | |
| | | int updateByPrimaryKeySelective(RmSoilHistory record); |
| | | |
| | | int updateByPrimaryKey(RmSoilHistory record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoSoil; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | List<RmSoilLast> selectRmSoilLast(@Param("stSoilId") Long stSoilId) ; |
| | | |
| | | /** |
| | | * 根据指定条件查询记录数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long selectCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoSoil> selectSome(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param soilId |
| | | * @return |
| | | */ |
| | | List<VoSoil> selectSomeBySoilId(@Param("soilId") Long soilId); |
| | | |
| | | int updateByPrimaryKeySelective(RmSoilLast record); |
| | | |
| | | int updateByPrimaryKey(RmSoilLast record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoWeather; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | RmWeatherHistory selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long selectCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoWeather> selectSome(Map<?, ?> params); |
| | | |
| | | int updateByPrimaryKeySelective(RmWeatherHistory record); |
| | | |
| | | int updateByPrimaryKey(RmWeatherHistory record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoWeather; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | List<RmWeatherLast> selectRmWeatherLast(@Param("stWeatherId") Long stWeatherId) ; |
| | | |
| | | /** |
| | | * 根据指定条件查询记录数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long selectCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoWeather> selectSome(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件查询记录 |
| | | * @param weatherId |
| | | * @return |
| | | */ |
| | | List<VoWeather> selectSomeByWeatherId(@Param("weatherId") Long weatherId); |
| | | |
| | | int updateByPrimaryKeySelective(RmWeatherLast record); |
| | | |
| | | int updateByPrimaryKey(RmWeatherLast record); |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 9:03 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoSoil { |
| | | public static final long serialVersionUID = 202506260903001L; |
| | | |
| | | /** |
| | | * 记录ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 墒情站ID |
| | | */ |
| | | @Schema(description = "墒情站ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long soilId; |
| | | |
| | | /** |
| | | * 墒情站名称 |
| | | */ |
| | | @Schema(description = "墒情站名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Long soilName; |
| | | |
| | | |
| | | /** |
| | | * 数据上报时间(年月日时分秒) |
| | | */ |
| | | @Schema(description = "数据接收日期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | |
| | | /** |
| | | * 土壤湿度1 |
| | | */ |
| | | @Schema(description = "土壤湿度1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilHumidity1; |
| | | |
| | | /** |
| | | * 土壤湿度2 |
| | | */ |
| | | @Schema(description = "土壤湿度2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilHumidity2; |
| | | |
| | | /** |
| | | * 土壤湿度3 |
| | | */ |
| | | @Schema(description = "土壤湿度3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilHumidity3; |
| | | |
| | | /** |
| | | * 土壤湿度4 |
| | | */ |
| | | @Schema(description = "土壤湿度4", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilHumidity4; |
| | | |
| | | /** |
| | | * 土壤湿度5 |
| | | */ |
| | | @Schema(description = "土壤湿度5", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilHumidity5; |
| | | |
| | | /** |
| | | * 土壤温度1 |
| | | */ |
| | | @Schema(description = "土壤温度1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilTemperature1; |
| | | |
| | | /** |
| | | * 土壤温度2 |
| | | */ |
| | | @Schema(description = "土壤温度2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilTemperature2; |
| | | |
| | | /** |
| | | * 土壤温度3 |
| | | */ |
| | | @Schema(description = "土壤温度3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilTemperature3; |
| | | |
| | | /** |
| | | * 土壤温度4 |
| | | */ |
| | | @Schema(description = "土壤温度4", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilTemperature4; |
| | | |
| | | /** |
| | | * 土壤温度5 |
| | | */ |
| | | @Schema(description = "土壤温度5", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilTemperature5; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 9:16 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoWeather { |
| | | public static final long serialVersionUID = 202506260903001L; |
| | | |
| | | /** |
| | | * 记录ID |
| | | */ |
| | | @JSONField(serializeUsing = ObjectWriterImplToString.class) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 气象站ID |
| | | */ |
| | | @Schema(description = "气象站ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing = ObjectWriterImplToString.class) |
| | | public Long weatherId; |
| | | |
| | | /** |
| | | * 气象站名称 |
| | | */ |
| | | @Schema(description = "气象站名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Long weatherName; |
| | | |
| | | |
| | | /** |
| | | * 数据上报时间(年月日时分秒) |
| | | */ |
| | | @Schema(description = "数据接收日期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 空气温度 |
| | | */ |
| | | @Schema(description = "空气温度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern = "0.00") |
| | | public Double airTemperature; |
| | | |
| | | /** |
| | | * 空气湿度 |
| | | */ |
| | | @Schema(description = "空气湿度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern = "0.00") |
| | | public Double airHumidity; |
| | | |
| | | /** |
| | | * 紫外线 |
| | | */ |
| | | @Schema(description = "紫外线", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer ultraviolet; |
| | | |
| | | /** |
| | | * 光照强度 |
| | | */ |
| | | @Schema(description = "光照强度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer lightIntensity; |
| | | |
| | | /** |
| | | * 雨量 |
| | | */ |
| | | @Schema(description = "雨量", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern = "0.00") |
| | | public Double rainfall; |
| | | |
| | | /** |
| | | * 风速 |
| | | */ |
| | | @Schema(description = "风速", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern = "0.00") |
| | | public Double windSpeed; |
| | | |
| | | /** |
| | | * 风向 |
| | | */ |
| | | @Schema(description = "风向", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer windDirection; |
| | | /** |
| | | 风向名称 |
| | | 方位名称 角度范围 中心角度 |
| | | 北(N) 348.75°~11.25° 0° |
| | | 东北(NE) 11.25°~33.75° 22.5° |
| | | 东(E) 33.75°~56.25° 45° |
| | | 东南(SE) 56.25°~78.75° 67.5° |
| | | 南(S) 78.75°~101.25° 90° |
| | | 西南(SW) 101.25°~123.75° 112.5° |
| | | 西(W) 123.75°~146.25° 135° |
| | | 西北(NW) 146.25°~168.75° 157.5° |
| | | 北(N) 168.75°~191.25° 180° |
| | | |
| | | 四舍五入后 |
| | | 方位名称 角度范围 中心角度 |
| | | 北(N) 349°~11° 0° |
| | | 东北(NE) 11°~34° 22.5° |
| | | 东(E) 34°~56° 45° |
| | | 东南(SE) 56°~79° 67.5° |
| | | 南(S) 79°~101° 90° |
| | | 西南(SW) 101°~124° 112.5° |
| | | 西(W) 124°~146° 135° |
| | | 西北(NW) 146°~169° 157.5° |
| | | 北(N) 169°~191° 180° |
| | | */ |
| | | @Schema(description = "风向", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String windDirectionStr; |
| | | public String getWindDirectionStr() { |
| | | String str = "" ; |
| | | if (windDirection != null) { |
| | | if (windDirection >= 349 || windDirection < 11) { |
| | | str = "北" ; |
| | | }else if(windDirection >= 11 && windDirection < 34){ |
| | | str = "东北" ; |
| | | }else if(windDirection >= 34 && windDirection < 56){ |
| | | str = "东" ; |
| | | }else if(windDirection >= 56 && windDirection < 79){ |
| | | str = "东南" ; |
| | | }else if(windDirection >= 79 && windDirection < 101){ |
| | | str = "南" ; |
| | | }else if(windDirection >= 101 && windDirection < 124){ |
| | | str = "西南" ; |
| | | }else if(windDirection >= 124 && windDirection < 146){ |
| | | str = "西" ; |
| | | }else if(windDirection >= 146 && windDirection < 169){ |
| | | str = "西北" ; |
| | | } |
| | | } |
| | | if(str != null && !str.equals("")){ |
| | | str = str + "(" + windDirection + ")" ; |
| | | }else{ |
| | | str = "" + windDirection ; |
| | | } |
| | | return str ; |
| | | } |
| | | |
| | | } |
| | |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND htb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND htb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | |
| | | </select> |
| | | |
| | | |
| | | <!--根据指定条件查询历史记录数量--> |
| | | <!--根据指定条件查询记录数量--> |
| | | <select id="selectCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件查询历史记录--> |
| | | <!--根据指定条件查询记录--> |
| | | <select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoManure"> |
| | | SELECT |
| | | <include refid="Base_Column_List" />, |
| | |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取记录--> |
| | | <select id="selectSomeByManureId" resultType="com.dy.pipIrrGlobal.voRm.VoManure"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_manure_last |
| | | <where> |
| | | <if test="manureId != null"> |
| | | and manure_id = #{manureId} |
| | | </if> |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | |
| | | from rm_soil_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <!--根据指定条件查询历史记录数量--> |
| | | <select id="selectCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM rm_soil_history htb |
| | | INNER JOIN pr_st_soil mtb ON mtb.id = htb.soil_id |
| | | <where> |
| | | <if test="soilId != null"> |
| | | AND htb.soil_id = #{soilId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND htb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件查询历史记录--> |
| | | <select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoSoil"> |
| | | SELECT |
| | | <include refid="Base_Column_List" />, |
| | | mtb.`name` AS soilName |
| | | FROM rm_soil_history htb |
| | | INNER JOIN pr_st_soil mtb ON mtb.id = htb.soil_id |
| | | <where> |
| | | <if test="soilId != null"> |
| | | AND htb.soil_id = #{soilId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND htb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY htb.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 rm_soil_history |
| | |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | <!--根据指定条件查询记录数量--> |
| | | <select id="selectCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM rm_soil_last ltb |
| | | INNER JOIN pr_st_soil mtb ON mtb.id = ltb.soil_id |
| | | <where> |
| | | <if test="soilId != null"> |
| | | AND ltb.soil_id = #{soilId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件查询记录--> |
| | | <select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoSoil"> |
| | | SELECT |
| | | <include refid="Base_Column_List" />, |
| | | mtb.`name` AS soilName |
| | | FROM rm_soil_last ltb |
| | | INNER JOIN pr_st_soil mtb ON mtb.id = ltb.soil_id |
| | | <where> |
| | | <if test="soilId != null"> |
| | | AND ltb.soil_id = #{soilId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ltb.soil_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="selectSomeBySoilId" resultType="com.dy.pipIrrGlobal.voRm.VoSoil"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_soil_last |
| | | <where> |
| | | <if test="soilId != null"> |
| | | and soil_id = #{soilId} |
| | | </if> |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_soil_last |
| | |
| | | from rm_weather_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <!--根据指定条件查询历史记录数量--> |
| | | <select id="selectCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM rm_weather_history htb |
| | | INNER JOIN pr_st_weather mtb ON mtb.id = htb.weather_id |
| | | <where> |
| | | <if test="weatherId != null"> |
| | | AND htb.weather_id = #{weatherId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND htb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件查询历史记录--> |
| | | <select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoWeather"> |
| | | SELECT |
| | | <include refid="Base_Column_List" />, |
| | | mtb.`name` AS weatherName |
| | | FROM rm_weather_history htb |
| | | INNER JOIN pr_st_weather mtb ON mtb.id = htb.weather_id |
| | | <where> |
| | | <if test="weatherId != null"> |
| | | AND htb.weather_id = #{weatherId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND htb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY htb.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 rm_weather_history |
| | |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | <!--根据指定条件查询记录数量--> |
| | | <select id="selectCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM rm_weather_last ltb |
| | | INNER JOIN pr_st_weather mtb ON mtb.id = ltb.weather_id |
| | | <where> |
| | | <if test="weatherId != null"> |
| | | AND ltb.weather_id = #{weatherId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件查询记录--> |
| | | <select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoWeather"> |
| | | SELECT |
| | | <include refid="Base_Column_List" />, |
| | | mtb.`name` AS weatherName |
| | | FROM rm_weather_last ltb |
| | | INNER JOIN pr_st_weather mtb ON mtb.id = ltb.weather_id |
| | | <where> |
| | | <if test="weatherId != null"> |
| | | AND ltb.weather_id = #{weatherId} |
| | | </if> |
| | | <if test = "no != null"> |
| | | AND mtb.no = #{no} |
| | | </if> |
| | | <if test = "name != null and name !=''"> |
| | | AND mtb.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ltb.weather_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="selectSomeByWeatherId" resultType="com.dy.pipIrrGlobal.voRm.VoWeather"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_weather_last |
| | | <where> |
| | | <if test="weatherId != null"> |
| | | and weather_id = #{weatherId} |
| | | </if> |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_weather_last |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * 根据指定条件查询最新记录 |
| | | * @param manureId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "history") |
| | | @GetMapping(path = "oneLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoManure>>> selectHistory(ManureQo qo){ |
| | | public BaseResponse<VoManure> oneLast(Long manureId){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.selectHistory(qo)); |
| | | return BaseResponseUtils.buildSuccess(sv.oneLast(manureId)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param manureId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "oneHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoManure>>> oneHistory(Long manureId){ |
| | | try { |
| | | |
| | | return BaseResponseUtils.buildSuccess(sv.oneHistory(manureId)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "last") |
| | | @GetMapping(path = "someLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoManure>>> selectLast(ManureQo qo){ |
| | | public BaseResponse<QueryResultVo<List<VoManure>>> someLast(ManureQo qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.selectLast(qo)); |
| | | return BaseResponseUtils.buildSuccess(sv.someLast(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "someHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoManure>>> someHistory(ManureQo qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.someHistory(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | |
| | | * 水肥机ID |
| | | */ |
| | | @Schema(description = "水肥机ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long manureId; |
| | | public Long manureId; |
| | | |
| | | /** |
| | | * 水肥站编号 |
| | |
| | | @Autowired |
| | | private RmManureLastMapper rmManureLastDao ; |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoManure>> selectHistory(ManureQo qo) { |
| | | qo.completionTime(); |
| | | public VoManure oneLast(Long manureId) { |
| | | List<VoManure> list = this.rmManureLastDao.selectSomeByManureId(manureId) ; |
| | | if(list != null && list.size() > 0) { |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | public QueryResultVo<List<VoManure>> oneHistory(Long manureId) { |
| | | ManureQo qo = new ManureQo() ; |
| | | qo.manureId = manureId ; |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmManureHistoryDao.selectCount(params); |
| | | |
| | |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoManure>> selectLast(ManureQo qo) { |
| | | public QueryResultVo<List<VoManure>> someLast(ManureQo qo) { |
| | | qo.completionTime(); |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | |
| | | rsVo.obj = rmManureLastDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoManure>> someHistory(ManureQo qo) { |
| | | qo.completionTime(); |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmManureHistoryDao.selectCount(params); |
| | | |
| | | QueryResultVo<List<VoManure>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmManureHistoryDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.mqttSd1.soil; |
| | | |
| | | 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.pipIrrGlobal.voRm.VoSoil; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 09:31 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "墒情数据查询", description = "墒情数据查询") |
| | | @RestController("rmSoilCtrl") |
| | | @RequestMapping(path = "soil") |
| | | @RequiredArgsConstructor |
| | | public class SoilCtrl { |
| | | |
| | | private SoilSv sv; |
| | | |
| | | @Autowired |
| | | public void setSv(SoilSv sv){ |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询最新记录 |
| | | * @param soilId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "oneLast") |
| | | @SsoAop() |
| | | public BaseResponse<VoSoil> oneLast(Long soilId){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.oneLast(soilId)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param soilId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "oneHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoSoil>>> oneHistory(Long soilId){ |
| | | try { |
| | | |
| | | return BaseResponseUtils.buildSuccess(sv.oneHistory(soilId)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询最新记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "someLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoSoil>>> someLast(SoilQo qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.someLast(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "someHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoSoil>>> someHistory(SoilQo qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.someHistory(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.mqttSd1.soil; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 09:31 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class SoilQo extends QueryConditionVo { |
| | | /** |
| | | * 墒情站ID |
| | | */ |
| | | @Schema(description = "墒情站ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Long soilId; |
| | | |
| | | /** |
| | | * 墒情站编号 |
| | | */ |
| | | @Schema(description = "墒情站编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * 墒情站名称 |
| | | */ |
| | | @Schema(description = "墒情站名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String name; |
| | | /** |
| | | * 查询开始日期 |
| | | */ |
| | | @Schema(description = "查询开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String timeStart; |
| | | |
| | | /** |
| | | * 查询结束日期 |
| | | */ |
| | | @Schema(description = "查询结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String timeStop; |
| | | |
| | | |
| | | public void completionTime(){ |
| | | if(timeStart != null && !timeStart.trim().equals("")) { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | } |
| | | if(timeStop != null && !timeStop.trim().equals("")) { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.mqttSd1.soil; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmSoilHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmSoilLastMapper; |
| | | import com.dy.pipIrrGlobal.voRm.VoSoil; |
| | | import com.dy.pipIrrRemote.mqttSd1.soil.SoilQo; |
| | | import lombok.RequiredArgsConstructor; |
| | | 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 java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 09:31 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("rmSoilSv") |
| | | @RequiredArgsConstructor |
| | | public class SoilSv { |
| | | |
| | | @Autowired |
| | | private RmSoilHistoryMapper rmSoilHistoryDao ; |
| | | @Autowired |
| | | private RmSoilLastMapper rmSoilLastDao ; |
| | | |
| | | public VoSoil oneLast(Long soilId) { |
| | | List<VoSoil> list = this.rmSoilLastDao.selectSomeBySoilId(soilId) ; |
| | | if(list != null && list.size() > 0) { |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | public QueryResultVo<List<VoSoil>> oneHistory(Long soilId) { |
| | | SoilQo qo = new SoilQo() ; |
| | | qo.soilId = soilId ; |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmSoilHistoryDao.selectCount(params); |
| | | |
| | | QueryResultVo<List<VoSoil>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmSoilHistoryDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询最新记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoSoil>> someLast(SoilQo qo) { |
| | | qo.completionTime(); |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmSoilLastDao.selectCount(params); |
| | | |
| | | QueryResultVo<List<VoSoil>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmSoilLastDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoSoil>> someHistory(SoilQo qo) { |
| | | qo.completionTime(); |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmSoilHistoryDao.selectCount(params); |
| | | |
| | | QueryResultVo<List<VoSoil>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmSoilHistoryDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.mqttSd1.weather; |
| | | |
| | | 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.pipIrrGlobal.voRm.VoWeather; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 09:33 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "气象数据查询", description = "气象数据查询") |
| | | @RestController("rmWeatherCtrl") |
| | | @RequestMapping(path = "weather") |
| | | @RequiredArgsConstructor |
| | | public class WeatherCtrl { |
| | | |
| | | private WeatherSv sv; |
| | | |
| | | @Autowired |
| | | public void setSv(WeatherSv sv){ |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询最新记录 |
| | | * @param weatherId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "oneLast") |
| | | @SsoAop() |
| | | public BaseResponse<VoWeather> oneLast(Long weatherId){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.oneLast(weatherId)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param weatherId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "oneHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoWeather>>> oneHistory(Long weatherId){ |
| | | try { |
| | | |
| | | return BaseResponseUtils.buildSuccess(sv.oneHistory(weatherId)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询最新记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "someLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoWeather>>> someLast(WeatherQo qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.someLast(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "someHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoWeather>>> someHistory(WeatherQo qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.someHistory(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.mqttSd1.weather; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 09:33 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class WeatherQo extends QueryConditionVo { |
| | | /** |
| | | * 气象站ID |
| | | */ |
| | | @Schema(description = "气象站ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Long weatherId; |
| | | |
| | | /** |
| | | * 气象站编号 |
| | | */ |
| | | @Schema(description = "气象站编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * 气象站名称 |
| | | */ |
| | | @Schema(description = "气象站名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String name; |
| | | /** |
| | | * 查询开始日期 |
| | | */ |
| | | @Schema(description = "查询开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String timeStart; |
| | | |
| | | /** |
| | | * 查询结束日期 |
| | | */ |
| | | @Schema(description = "查询结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String timeStop; |
| | | |
| | | |
| | | public void completionTime(){ |
| | | if(timeStart != null && !timeStart.trim().equals("")) { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | } |
| | | if(timeStop != null && !timeStop.trim().equals("")) { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.mqttSd1.weather; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmWeatherHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmWeatherLastMapper; |
| | | import com.dy.pipIrrGlobal.voRm.VoWeather; |
| | | import lombok.RequiredArgsConstructor; |
| | | 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 java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/26 09:33 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("rmWeatherSv") |
| | | @RequiredArgsConstructor |
| | | public class WeatherSv { |
| | | |
| | | @Autowired |
| | | private RmWeatherHistoryMapper rmWeatherHistoryDao ; |
| | | @Autowired |
| | | private RmWeatherLastMapper rmWeatherLastDao ; |
| | | |
| | | public VoWeather oneLast(Long weatherId) { |
| | | List<VoWeather> list = this.rmWeatherLastDao.selectSomeByWeatherId(weatherId) ; |
| | | if(list != null && list.size() > 0) { |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | public QueryResultVo<List<VoWeather>> oneHistory(Long weatherId) { |
| | | WeatherQo qo = new WeatherQo() ; |
| | | qo.weatherId = weatherId ; |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmWeatherHistoryDao.selectCount(params); |
| | | |
| | | QueryResultVo<List<VoWeather>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmWeatherHistoryDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询最新记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoWeather>> someLast(WeatherQo qo) { |
| | | qo.completionTime(); |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmWeatherLastDao.selectCount(params); |
| | | |
| | | QueryResultVo<List<VoWeather>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmWeatherLastDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件查询历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoWeather>> someHistory(WeatherQo qo) { |
| | | qo.completionTime(); |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmWeatherHistoryDao.selectCount(params); |
| | | |
| | | QueryResultVo<List<VoWeather>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmWeatherHistoryDao.selectSome(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | } |