水肥、气象、墒情数据处理:最新数据、历史数据、墒情日数据
| | |
| | | |
| | | public String cd ;//功能码 |
| | | |
| | | public String deviceId ;//设备ID |
| | | public String deviceId ;//设备ID(FBox序列号) |
| | | |
| | | public String mqttResultSendWebUrl ;//Mqtt返回命令结果 发向目的地web URL |
| | | |
| | |
| | | public String commandId ;//命令ID |
| | | public String mqttResultSendWebUrl ;//Mtt返回命令结果 发向目的地web URL |
| | | |
| | | public String deviceId ;//设备ID |
| | | public String protocol;//协议 |
| | | public String deviceId ;//设备ID(FBox序列号) |
| | | public String protocol;//协议(名称+版本) |
| | | |
| | | public MqttTopic topic ;//消息主题 |
| | | public String metaData;//MQTT推送来的元数据 |
| | |
| | | @AllArgsConstructor |
| | | public class MqttTopic { |
| | | public String orgTag ;//组织标识 |
| | | public String protocol ;//协议名称 |
| | | public String devId ;//设备(FBox)ID |
| | | public String protocol ;//协议名称(名称+版本) |
| | | public String devId ;//设备ID(FBox序列号) |
| | | public String type;//数据(命令)类型 |
| | | public Integer no;//测站编号 |
| | | |
| | |
| | | @JSONField(name = "土壤湿度5") |
| | | public Float soilHumidity5 ; |
| | | |
| | | @JSONField(name = "土壤湿度1") |
| | | @JSONField(name = "土壤温度1") |
| | | public Float soilTemperature1 ; |
| | | |
| | | @JSONField(name = "土壤温度2") |
| | |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | List<VoManure> selectSome(Map<?, ?> params); |
| | | |
| | | List<PrStManure> selectStPoByFBoxIdAndNo(@Param("fbox_id")String fboxId, @Param("no")Integer no) ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStManure record); |
| | | |
| | |
| | | package com.dy.pipIrrGlobal.daoPr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | 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 org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | List<VoSoil> selectSome(Map<?, ?> params); |
| | | |
| | | List<PrStSoil> selectStPoByFBoxIdAndNo(@Param("fbox_id")String fboxId, @Param("no")Integer no) ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStSoil record); |
| | | |
| | | int updateByPrimaryKey(PrStSoil record); |
| | |
| | | package com.dy.pipIrrGlobal.daoPr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | 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 org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | List<VoWeather> selectSome(Map<?, ?> params); |
| | | |
| | | List<PrStWeather> selectStPoByFBoxIdAndNo(@Param("fbox_id")String fboxId, @Param("no")Integer no) ; |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStWeather record); |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureHistory; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:03 |
| | | * @Description |
| | | */ |
| | | public interface RmManureHistoryMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmManureHistory record); |
| | | |
| | | int insertSelective(RmManureHistory record); |
| | | |
| | | RmManureHistory selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(RmManureHistory record); |
| | | |
| | | int updateByPrimaryKey(RmManureHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureLast; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:03 |
| | | * @Description |
| | | */ |
| | | public interface RmManureLastMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmManureLast record); |
| | | |
| | | int insertSelective(RmManureLast record); |
| | | |
| | | RmManureLast selectByPrimaryKey(Long id); |
| | | |
| | | List<RmManureLast> selectRmManureLast(@Param("stManureId") Long stManureId) ; |
| | | |
| | | int updateByPrimaryKeySelective(RmManureLast record); |
| | | |
| | | int updateByPrimaryKey(RmManureLast record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilDay; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilLast; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | public interface RmSoilDayMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmSoilDay record); |
| | | |
| | | int insertSelective(RmSoilDay record); |
| | | |
| | | RmSoilDay selectByPrimaryKey(Long id); |
| | | |
| | | List<RmSoilDay> selectRmSoilDay(@Param("stSoilId") Long stSoilId, @Param("ymd") Integer ymd) ; |
| | | |
| | | int updateByPrimaryKeySelective(RmSoilDay record); |
| | | |
| | | int updateByPrimaryKey(RmSoilDay record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilHistory; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | public interface RmSoilHistoryMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmSoilHistory record); |
| | | |
| | | int insertSelective(RmSoilHistory record); |
| | | |
| | | RmSoilHistory selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(RmSoilHistory record); |
| | | |
| | | int updateByPrimaryKey(RmSoilHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilLast; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | public interface RmSoilLastMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmSoilLast record); |
| | | |
| | | int insertSelective(RmSoilLast record); |
| | | |
| | | RmSoilLast selectByPrimaryKey(Long id); |
| | | |
| | | List<RmSoilLast> selectRmSoilLast(@Param("stSoilId") Long stSoilId) ; |
| | | |
| | | int updateByPrimaryKeySelective(RmSoilLast record); |
| | | |
| | | int updateByPrimaryKey(RmSoilLast record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:39 |
| | | * @Description |
| | | */ |
| | | public interface RmWeatherHistoryMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmWeatherHistory record); |
| | | |
| | | int insertSelective(RmWeatherHistory record); |
| | | |
| | | RmWeatherHistory selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(RmWeatherHistory record); |
| | | |
| | | int updateByPrimaryKey(RmWeatherHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherLast; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:39 |
| | | * @Description |
| | | */ |
| | | public interface RmWeatherLastMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmWeatherLast record); |
| | | |
| | | int insertSelective(RmWeatherLast record); |
| | | |
| | | RmWeatherLast selectByPrimaryKey(Long id); |
| | | |
| | | List<RmWeatherLast> selectRmWeatherLast(@Param("stWeatherId") Long stWeatherId) ; |
| | | |
| | | int updateByPrimaryKeySelective(RmWeatherLast record); |
| | | |
| | | int updateByPrimaryKey(RmWeatherLast record); |
| | | } |
| | |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description 控制器日漏损水量历史数据 |
| | | */ |
| | | @TableName(value="rm_loss_history_history", autoResultMap = true) |
| | | @TableName(value="rm_loss_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description 控制器日漏损水量最新数据 |
| | | */ |
| | | @TableName(value="rm_loss_last_history", autoResultMap = true) |
| | | @TableName(value="rm_loss_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.ManureVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:03 |
| | | * @Description |
| | | */ |
| | | @TableName(value="rm_manure_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "水肥机历史数据") |
| | | public class RmManureHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202506251021001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 水肥机实体外键id |
| | | */ |
| | | @Schema(description = "水肥机实体外键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long manureId; |
| | | |
| | | /** |
| | | * 数据上报时间(年月日时分秒) |
| | | */ |
| | | @Schema(description = "数据接收日期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 搅拌1运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌1运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning1; |
| | | |
| | | /** |
| | | * 搅拌2运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌2运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning2; |
| | | |
| | | /** |
| | | * 搅拌3运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌3运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning3; |
| | | |
| | | /** |
| | | * 搅拌4运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌4运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning4; |
| | | |
| | | /** |
| | | * 注肥运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "注肥运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte injectRunning; |
| | | |
| | | /** |
| | | * 灌溉运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "灌溉运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte irrRunning; |
| | | |
| | | /** |
| | | * 报警(1:注肥泵有故障,0:注肥泵没有故障) |
| | | */ |
| | | @Schema(description = "报警(1:注肥泵有故障,0:注肥泵没有故障)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte alarm; |
| | | |
| | | /** |
| | | * 肥料流量(升) |
| | | */ |
| | | @Schema(description = "肥料流量(升)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double manureFlow; |
| | | |
| | | /** |
| | | * 注肥经过时间(秒) |
| | | */ |
| | | @Schema(description = "注肥经过时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer manureTime; |
| | | |
| | | /** |
| | | * 搅拌经过时间(秒) |
| | | */ |
| | | @Schema(description = "搅拌经过时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer stirTime; |
| | | |
| | | /** |
| | | * 搅拌设定时间(秒) |
| | | */ |
| | | @Schema(description = "搅拌设定时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer stirDuration; |
| | | |
| | | /** |
| | | * 注肥设定时间(秒) |
| | | */ |
| | | @Schema(description = "注肥设定时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer injectDuration; |
| | | |
| | | public void valueFrom(MqttSubMsg msg, ManureVo cdData) throws Exception{ |
| | | this.dt = new Date(); |
| | | this.stirRunning1 = cdData.stirRunning1 ; |
| | | this.stirRunning2 = cdData.stirRunning2 ; |
| | | this.stirRunning3 = cdData.stirRunning3 ; |
| | | this.stirRunning4 = cdData.stirRunning4 ; |
| | | this.injectRunning = cdData.injectRunning ; |
| | | this.irrRunning = cdData.irrRunning ; |
| | | this.alarm = cdData.alarm ; |
| | | this.manureFlow = cdData.manureFlow==null?null:(0.0D + cdData.manureFlow) ; |
| | | this.manureTime = cdData.manureTime ; |
| | | this.stirTime = cdData.stirTime ; |
| | | this.stirDuration = cdData.stirDuration ; |
| | | this.injectDuration = cdData.injectDuration ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.ManureVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:03 |
| | | * @Description |
| | | */ |
| | | @TableName(value="rm_manure_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "水肥机最新数据") |
| | | public class RmManureLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202506251021002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 历史数据表中最新记录的外键id |
| | | */ |
| | | @Schema(hidden=true) |
| | | @JSONField(serialize = false) |
| | | public Long lastHistoryId; |
| | | |
| | | /** |
| | | * 水肥机实体外键id |
| | | */ |
| | | @Schema(description = "水肥机实体外键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long manureId; |
| | | |
| | | /** |
| | | * 数据上报时间(年月日时分秒) |
| | | */ |
| | | @Schema(description = "数据接收日期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 搅拌1运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌1运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning1; |
| | | |
| | | /** |
| | | * 搅拌2运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌2运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning2; |
| | | |
| | | /** |
| | | * 搅拌3运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌3运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning3; |
| | | |
| | | /** |
| | | * 搅拌4运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "搅拌4运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte stirRunning4; |
| | | |
| | | /** |
| | | * 注肥运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "注肥运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte injectRunning; |
| | | |
| | | /** |
| | | * 灌溉运行状态(1运行,0停止) |
| | | */ |
| | | @Schema(description = "灌溉运行状态(1运行,0停止)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte irrRunning; |
| | | |
| | | /** |
| | | * 报警(1:注肥泵有故障,0:注肥泵没有故障) |
| | | */ |
| | | @Schema(description = "报警(1:注肥泵有故障,0:注肥泵没有故障)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte alarm; |
| | | |
| | | /** |
| | | * 肥料流量(升) |
| | | */ |
| | | @Schema(description = "肥料流量(升)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double manureFlow; |
| | | |
| | | /** |
| | | * 注肥经过时间(秒) |
| | | */ |
| | | @Schema(description = "注肥经过时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer manureTime; |
| | | |
| | | /** |
| | | * 搅拌经过时间(秒) |
| | | */ |
| | | @Schema(description = "搅拌经过时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer stirTime; |
| | | |
| | | /** |
| | | * 搅拌设定时间(秒) |
| | | */ |
| | | @Schema(description = "搅拌设定时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer stirDuration; |
| | | |
| | | /** |
| | | * 注肥设定时间(秒) |
| | | */ |
| | | @Schema(description = "注肥设定时间(秒)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer injectDuration; |
| | | |
| | | public void valueFrom(MqttSubMsg msg, ManureVo cdData) throws Exception{ |
| | | this.dt = new Date(); |
| | | this.stirRunning1 = cdData.stirRunning1 ; |
| | | this.stirRunning2 = cdData.stirRunning2 ; |
| | | this.stirRunning3 = cdData.stirRunning3 ; |
| | | this.stirRunning4 = cdData.stirRunning4 ; |
| | | this.injectRunning = cdData.injectRunning ; |
| | | this.irrRunning = cdData.irrRunning ; |
| | | this.alarm = cdData.alarm ; |
| | | this.manureFlow = cdData.manureFlow==null?null:(0.0D + cdData.manureFlow) ; |
| | | this.manureTime = cdData.manureTime ; |
| | | this.stirTime = cdData.stirTime ; |
| | | this.stirDuration = cdData.stirDuration ; |
| | | this.injectDuration = cdData.injectDuration ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.SoilVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.dy.common.util.DateTime; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | @TableName(value="rm_soil_day", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "墒情日平均数据") |
| | | public class RmSoilDay implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202506251022003L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | 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) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | public Date dt; |
| | | /** |
| | | * 数据日期(年月日) |
| | | */ |
| | | @Schema(hidden=true) |
| | | @JSONField(serialize = false) |
| | | public Integer ymd ; |
| | | |
| | | /** |
| | | * 日平均土壤湿度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; |
| | | |
| | | /** |
| | | * 日数据次数 |
| | | */ |
| | | @Schema(description = "日数据次数", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer times; |
| | | |
| | | /** |
| | | * 日累计土壤湿度1 |
| | | */ |
| | | @Schema(description = "日累计土壤湿度1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumHumidity1; |
| | | |
| | | /** |
| | | * 日累计土壤湿度2 |
| | | */ |
| | | @Schema(description = "日累计土壤湿度2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumHumidity2; |
| | | |
| | | /** |
| | | * 日累计土壤湿度3 |
| | | */ |
| | | @Schema(description = "日累计土壤湿度3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumHumidity3; |
| | | |
| | | /** |
| | | * 日累计土壤湿度4 |
| | | */ |
| | | @Schema(description = "日累计土壤湿度4", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumHumidity4; |
| | | |
| | | /** |
| | | * 日累计土壤湿度5 |
| | | */ |
| | | @Schema(description = "日累计土壤湿度5", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumHumidity5; |
| | | |
| | | /** |
| | | * 日累计土壤温度1 |
| | | */ |
| | | @Schema(description = "日累计土壤温度1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumTemperature1; |
| | | |
| | | /** |
| | | * 日累计土壤温度2 |
| | | */ |
| | | @Schema(description = "日累计土壤温度2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumTemperature2; |
| | | |
| | | /** |
| | | * 日累计土壤温度3 |
| | | */ |
| | | @Schema(description = "日累计土壤温度3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumTemperature3; |
| | | |
| | | /** |
| | | * 日累计土壤温度4 |
| | | */ |
| | | @Schema(description = "日累计土壤温度4", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumTemperature4; |
| | | |
| | | /** |
| | | * 日累计土壤温度5 |
| | | */ |
| | | @Schema(description = "日累计土壤温度5", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double soilSumTemperature5; |
| | | |
| | | public void valueFrom(MqttSubMsg msg, SoilVo cdData) throws Exception{ |
| | | this.dt = new Date(); |
| | | this.ymd = Integer.parseInt(DateTime.yyyyMMdd()) ; |
| | | this.soilSumHumidity1 = cdData.soilHumidity1==null?0.0D:(0.0D + cdData.soilHumidity1) ; |
| | | this.soilSumHumidity2 = cdData.soilHumidity2==null?0.0D:(0.0D + cdData.soilHumidity2) ; |
| | | this.soilSumHumidity3 = cdData.soilHumidity3==null?0.0D:(0.0D + cdData.soilHumidity3) ; |
| | | this.soilSumHumidity4 = cdData.soilHumidity4==null?0.0D:(0.0D + cdData.soilHumidity4) ; |
| | | this.soilSumHumidity5 = cdData.soilHumidity5==null?0.0D:(0.0D + cdData.soilHumidity5) ; |
| | | this.soilSumTemperature1 = cdData.soilTemperature1==null?0.0D:(0.0D + cdData.soilTemperature1) ; |
| | | this.soilSumTemperature2 = cdData.soilTemperature2==null?0.0D:(0.0D + cdData.soilTemperature2) ; |
| | | this.soilSumTemperature3 = cdData.soilTemperature3==null?0.0D:(0.0D + cdData.soilTemperature3) ; |
| | | this.soilSumTemperature4 = cdData.soilTemperature4==null?0.0D:(0.0D + cdData.soilTemperature4) ; |
| | | this.soilSumTemperature5 = cdData.soilTemperature5==null?0.0D:(0.0D + cdData.soilTemperature5) ; |
| | | this.times = 1 ; |
| | | this.soilHumidity1 = this.soilSumHumidity1 ; |
| | | this.soilHumidity2 = this.soilSumHumidity2 ; |
| | | this.soilHumidity3 = this.soilSumHumidity3 ; |
| | | this.soilHumidity4 = this.soilSumHumidity4 ; |
| | | this.soilHumidity5 = this.soilSumHumidity5 ; |
| | | this.soilTemperature1 = this.soilSumTemperature1 ; |
| | | this.soilTemperature2 = this.soilSumTemperature2 ; |
| | | this.soilTemperature3 = this.soilSumTemperature3 ; |
| | | this.soilTemperature4 = this.soilSumTemperature4 ; |
| | | this.soilTemperature5 = this.soilSumTemperature5 ; |
| | | } |
| | | |
| | | public void updateFrom(MqttSubMsg msg, SoilVo cdData) throws Exception{ |
| | | this.soilSumHumidity1 += cdData.soilHumidity1==null?0.0D:(0.0D + cdData.soilHumidity1) ; |
| | | this.soilSumHumidity2 += cdData.soilHumidity2==null?0.0D:(0.0D + cdData.soilHumidity2) ; |
| | | this.soilSumHumidity3 += cdData.soilHumidity3==null?0.0D:(0.0D + cdData.soilHumidity3) ; |
| | | this.soilSumHumidity4 += cdData.soilHumidity4==null?0.0D:(0.0D + cdData.soilHumidity4) ; |
| | | this.soilSumHumidity5 += cdData.soilHumidity5==null?0.0D:(0.0D + cdData.soilHumidity5) ; |
| | | this.soilSumTemperature1 += cdData.soilTemperature1==null?0.0D:(0.0D + cdData.soilTemperature1) ; |
| | | this.soilSumTemperature2 += cdData.soilTemperature2==null?0.0D:(0.0D + cdData.soilTemperature2) ; |
| | | this.soilSumTemperature3 += cdData.soilTemperature3==null?0.0D:(0.0D + cdData.soilTemperature3) ; |
| | | this.soilSumTemperature4 += cdData.soilTemperature4==null?0.0D:(0.0D + cdData.soilTemperature4) ; |
| | | this.soilSumTemperature5 += cdData.soilTemperature5==null?0.0D:(0.0D + cdData.soilTemperature5) ; |
| | | this.times = this.times + 1 ; |
| | | this.soilHumidity1 = this.soilSumHumidity1 / this.times ; |
| | | this.soilHumidity2 = this.soilSumHumidity2 / this.times ; |
| | | this.soilHumidity3 = this.soilSumHumidity3 / this.times ; |
| | | this.soilHumidity4 = this.soilSumHumidity4 / this.times ; |
| | | this.soilHumidity5 = this.soilSumHumidity5 / this.times ; |
| | | this.soilTemperature1 = this.soilSumTemperature1 / this.times ; |
| | | this.soilTemperature2 = this.soilSumTemperature2 / this.times ; |
| | | this.soilTemperature3 = this.soilSumTemperature3 / this.times ; |
| | | this.soilTemperature4 = this.soilSumTemperature4 / this.times ; |
| | | this.soilTemperature5 = this.soilSumTemperature5 / this.times ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.SoilVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | @TableName(value="rm_soil_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "墒情最新数据") |
| | | public class RmSoilHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202506251022002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | 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) |
| | | @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; |
| | | |
| | | public void valueFrom(MqttSubMsg msg, SoilVo cdData) throws Exception{ |
| | | this.dt = new Date(); |
| | | this.soilHumidity1 = cdData.soilHumidity1==null?null:(0.0D + cdData.soilHumidity1) ; |
| | | this.soilHumidity2 = cdData.soilHumidity2==null?null:(0.0D + cdData.soilHumidity2) ; |
| | | this.soilHumidity3 = cdData.soilHumidity3==null?null:(0.0D + cdData.soilHumidity3) ; |
| | | this.soilHumidity4 = cdData.soilHumidity4==null?null:(0.0D + cdData.soilHumidity4) ; |
| | | this.soilHumidity5 = cdData.soilHumidity5==null?null:(0.0D + cdData.soilHumidity5) ; |
| | | this.soilTemperature1 = cdData.soilTemperature1==null?null:(0.0D + cdData.soilTemperature1) ; |
| | | this.soilTemperature2 = cdData.soilTemperature2==null?null:(0.0D + cdData.soilTemperature2) ; |
| | | this.soilTemperature3 = cdData.soilTemperature3==null?null:(0.0D + cdData.soilTemperature3) ; |
| | | this.soilTemperature4 = cdData.soilTemperature4==null?null:(0.0D + cdData.soilTemperature4) ; |
| | | this.soilTemperature5 = cdData.soilTemperature5==null?null:(0.0D + cdData.soilTemperature5) ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.ManureVo; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.SoilVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | @TableName(value="rm_soil_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "墒情最新数据") |
| | | public class RmSoilLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202506251022001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 历史数据表中最新记录的外键id |
| | | */ |
| | | @Schema(hidden=true) |
| | | @JSONField(serialize = false) |
| | | public Long lastHistoryId; |
| | | |
| | | /** |
| | | * 墒情站实体外键id |
| | | */ |
| | | @Schema(description = "墒情站实体外键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long soilId; |
| | | |
| | | /** |
| | | * 数据上报时间(年月日时分秒) |
| | | */ |
| | | @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; |
| | | |
| | | public void valueFrom(MqttSubMsg msg, SoilVo cdData) throws Exception{ |
| | | this.dt = new Date(); |
| | | this.soilHumidity1 = cdData.soilHumidity1==null?null:(0.0D + cdData.soilHumidity1) ; |
| | | this.soilHumidity2 = cdData.soilHumidity2==null?null:(0.0D + cdData.soilHumidity2) ; |
| | | this.soilHumidity3 = cdData.soilHumidity3==null?null:(0.0D + cdData.soilHumidity3) ; |
| | | this.soilHumidity4 = cdData.soilHumidity4==null?null:(0.0D + cdData.soilHumidity4) ; |
| | | this.soilHumidity5 = cdData.soilHumidity5==null?null:(0.0D + cdData.soilHumidity5) ; |
| | | this.soilTemperature1 = cdData.soilTemperature1==null?null:(0.0D + cdData.soilTemperature1) ; |
| | | this.soilTemperature2 = cdData.soilTemperature2==null?null:(0.0D + cdData.soilTemperature2) ; |
| | | this.soilTemperature3 = cdData.soilTemperature3==null?null:(0.0D + cdData.soilTemperature3) ; |
| | | this.soilTemperature4 = cdData.soilTemperature4==null?null:(0.0D + cdData.soilTemperature4) ; |
| | | this.soilTemperature5 = cdData.soilTemperature5==null?null:(0.0D + cdData.soilTemperature5) ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.WeatherVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:39 |
| | | * @Description |
| | | */ |
| | | @TableName(value="rm_weather_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "气象历史数据") |
| | | public class RmWeatherHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202506251035002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | 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) |
| | | @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; |
| | | |
| | | public void valueFrom(MqttSubMsg msg, WeatherVo cdData) throws Exception{ |
| | | this.dt = new Date(); |
| | | this.airTemperature = cdData.airTemperature==null?null:(0.0D + cdData.airTemperature) ; |
| | | this.airHumidity = cdData.airHumidity==null?null:(0.0D + cdData.airHumidity) ; |
| | | this.ultraviolet = cdData.ultraviolet ; |
| | | this.lightIntensity = cdData.lightIntensity ; |
| | | this.rainfall = cdData.rainfall==null?null:(0.0D + cdData.rainfall) ; |
| | | this.windSpeed = cdData.windSpeed==null?null:(0.0D + cdData.windSpeed) ; |
| | | this.windDirection = cdData.windDirection ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.SoilVo; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.WeatherVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | @TableName(value="rm_weather_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "气象最新数据") |
| | | public class RmWeatherLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202506251035001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 历史数据表中最新记录的外键id |
| | | */ |
| | | @Schema(hidden=true) |
| | | @JSONField(serialize = false) |
| | | public Long lastHistoryId; |
| | | |
| | | /** |
| | | * 气象站实体外键id |
| | | */ |
| | | @Schema(description = "气象站实体外键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long weatherId; |
| | | |
| | | /** |
| | | * 数据上报时间(年月日时分秒) |
| | | */ |
| | | @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; |
| | | |
| | | |
| | | public void valueFrom(MqttSubMsg msg, WeatherVo cdData) throws Exception{ |
| | | this.dt = new Date(); |
| | | this.airTemperature = cdData.airTemperature==null?null:(0.0D + cdData.airTemperature) ; |
| | | this.airHumidity = cdData.airHumidity==null?null:(0.0D + cdData.airHumidity) ; |
| | | this.ultraviolet = cdData.ultraviolet ; |
| | | this.lightIntensity = cdData.lightIntensity ; |
| | | this.rainfall = cdData.rainfall==null?null:(0.0D + cdData.rainfall) ; |
| | | this.windSpeed = cdData.windSpeed==null?null:(0.0D + cdData.windSpeed) ; |
| | | this.windDirection = cdData.windDirection ; |
| | | } |
| | | } |
| | |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--根据FBox序列号得到实体列表--> |
| | | <select id="selectStPoByFBoxIdAndNo" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="part_Column_List" /> |
| | | FROM pr_st_manure |
| | | WHERE deleted = 0 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{fbox_id,jdbcType=INTEGER} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_st_manure |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--根据FBox序列号得到实体列表--> |
| | | <select id="selectStPoByFBoxIdAndNo" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="part_Column_List" /> |
| | | FROM pr_st_soil |
| | | WHERE deleted = 0 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{fbox_id,jdbcType=INTEGER} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_st_soil |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--根据FBox序列号得到实体列表--> |
| | | <select id="selectStPoByFBoxIdAndNo" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="part_Column_List" /> |
| | | FROM pr_st_weather |
| | | WHERE deleted = 0 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{fbox_id,jdbcType=INTEGER} |
| | | </select> |
| | | |
| | | <select id="selectAllSimple" resultType="com.dy.pipIrrGlobal.voPr.VoMqttSimple"> |
| | | <!--@mbg.generated--> |
| | | select |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmManureHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmManureHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_manure_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="manure_id" jdbcType="BIGINT" property="manureId" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="stir_running1" jdbcType="TINYINT" property="stirRunning1" /> |
| | | <result column="stir_running2" jdbcType="TINYINT" property="stirRunning2" /> |
| | | <result column="stir_running3" jdbcType="TINYINT" property="stirRunning3" /> |
| | | <result column="stir_running4" jdbcType="TINYINT" property="stirRunning4" /> |
| | | <result column="inject_running" jdbcType="TINYINT" property="injectRunning" /> |
| | | <result column="irr_running" jdbcType="TINYINT" property="irrRunning" /> |
| | | <result column="alarm" jdbcType="TINYINT" property="alarm" /> |
| | | <result column="manure_flow" jdbcType="FLOAT" property="manureFlow" /> |
| | | <result column="manure_time" jdbcType="INTEGER" property="manureTime" /> |
| | | <result column="stir_time" jdbcType="INTEGER" property="stirTime" /> |
| | | <result column="stir_duration" jdbcType="INTEGER" property="stirDuration" /> |
| | | <result column="inject_duration" jdbcType="INTEGER" property="injectDuration" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, manure_id, dt, stir_running1, stir_running2, stir_running3, stir_running4, inject_running, |
| | | irr_running, alarm, manure_flow, manure_time, stir_time, stir_duration, inject_duration |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_manure_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_manure_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_manure_history (id, manure_id, dt, |
| | | stir_running1, stir_running2, stir_running3, |
| | | stir_running4, inject_running, irr_running, |
| | | alarm, manure_flow, manure_time, |
| | | stir_time, stir_duration, inject_duration |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{manureId,jdbcType=BIGINT}, #{dt,jdbcType=TIMESTAMP}, |
| | | #{stirRunning1,jdbcType=TINYINT}, #{stirRunning2,jdbcType=TINYINT}, #{stirRunning3,jdbcType=TINYINT}, |
| | | #{stirRunning4,jdbcType=TINYINT}, #{injectRunning,jdbcType=TINYINT}, #{irrRunning,jdbcType=TINYINT}, |
| | | #{alarm,jdbcType=TINYINT}, #{manureFlow,jdbcType=FLOAT}, #{manureTime,jdbcType=INTEGER}, |
| | | #{stirTime,jdbcType=INTEGER}, #{stirDuration,jdbcType=INTEGER}, #{injectDuration,jdbcType=INTEGER} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_manure_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="manureId != null"> |
| | | manure_id, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="stirRunning1 != null"> |
| | | stir_running1, |
| | | </if> |
| | | <if test="stirRunning2 != null"> |
| | | stir_running2, |
| | | </if> |
| | | <if test="stirRunning3 != null"> |
| | | stir_running3, |
| | | </if> |
| | | <if test="stirRunning4 != null"> |
| | | stir_running4, |
| | | </if> |
| | | <if test="injectRunning != null"> |
| | | inject_running, |
| | | </if> |
| | | <if test="irrRunning != null"> |
| | | irr_running, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | alarm, |
| | | </if> |
| | | <if test="manureFlow != null"> |
| | | manure_flow, |
| | | </if> |
| | | <if test="manureTime != null"> |
| | | manure_time, |
| | | </if> |
| | | <if test="stirTime != null"> |
| | | stir_time, |
| | | </if> |
| | | <if test="stirDuration != null"> |
| | | stir_duration, |
| | | </if> |
| | | <if test="injectDuration != null"> |
| | | inject_duration, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="manureId != null"> |
| | | #{manureId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="stirRunning1 != null"> |
| | | #{stirRunning1,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning2 != null"> |
| | | #{stirRunning2,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning3 != null"> |
| | | #{stirRunning3,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning4 != null"> |
| | | #{stirRunning4,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="injectRunning != null"> |
| | | #{injectRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="irrRunning != null"> |
| | | #{irrRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | #{alarm,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="manureFlow != null"> |
| | | #{manureFlow,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="manureTime != null"> |
| | | #{manureTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirTime != null"> |
| | | #{stirTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirDuration != null"> |
| | | #{stirDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="injectDuration != null"> |
| | | #{injectDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_manure_history |
| | | <set> |
| | | <if test="manureId != null"> |
| | | manure_id = #{manureId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="stirRunning1 != null"> |
| | | stir_running1 = #{stirRunning1,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning2 != null"> |
| | | stir_running2 = #{stirRunning2,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning3 != null"> |
| | | stir_running3 = #{stirRunning3,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning4 != null"> |
| | | stir_running4 = #{stirRunning4,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="injectRunning != null"> |
| | | inject_running = #{injectRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="irrRunning != null"> |
| | | irr_running = #{irrRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | alarm = #{alarm,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="manureFlow != null"> |
| | | manure_flow = #{manureFlow,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="manureTime != null"> |
| | | manure_time = #{manureTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirTime != null"> |
| | | stir_time = #{stirTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirDuration != null"> |
| | | stir_duration = #{stirDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="injectDuration != null"> |
| | | inject_duration = #{injectDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_manure_history |
| | | set manure_id = #{manureId,jdbcType=BIGINT}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | stir_running1 = #{stirRunning1,jdbcType=TINYINT}, |
| | | stir_running2 = #{stirRunning2,jdbcType=TINYINT}, |
| | | stir_running3 = #{stirRunning3,jdbcType=TINYINT}, |
| | | stir_running4 = #{stirRunning4,jdbcType=TINYINT}, |
| | | inject_running = #{injectRunning,jdbcType=TINYINT}, |
| | | irr_running = #{irrRunning,jdbcType=TINYINT}, |
| | | alarm = #{alarm,jdbcType=TINYINT}, |
| | | manure_flow = #{manureFlow,jdbcType=FLOAT}, |
| | | manure_time = #{manureTime,jdbcType=INTEGER}, |
| | | stir_time = #{stirTime,jdbcType=INTEGER}, |
| | | stir_duration = #{stirDuration,jdbcType=INTEGER}, |
| | | inject_duration = #{injectDuration,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmManureLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmManureLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_manure_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="last_history_id" jdbcType="BIGINT" property="lastHistoryId" /> |
| | | <result column="manure_id" jdbcType="BIGINT" property="manureId" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="stir_running1" jdbcType="TINYINT" property="stirRunning1" /> |
| | | <result column="stir_running2" jdbcType="TINYINT" property="stirRunning2" /> |
| | | <result column="stir_running3" jdbcType="TINYINT" property="stirRunning3" /> |
| | | <result column="stir_running4" jdbcType="TINYINT" property="stirRunning4" /> |
| | | <result column="inject_running" jdbcType="TINYINT" property="injectRunning" /> |
| | | <result column="irr_running" jdbcType="TINYINT" property="irrRunning" /> |
| | | <result column="alarm" jdbcType="TINYINT" property="alarm" /> |
| | | <result column="manure_flow" jdbcType="FLOAT" property="manureFlow" /> |
| | | <result column="manure_time" jdbcType="INTEGER" property="manureTime" /> |
| | | <result column="stir_time" jdbcType="INTEGER" property="stirTime" /> |
| | | <result column="stir_duration" jdbcType="INTEGER" property="stirDuration" /> |
| | | <result column="inject_duration" jdbcType="INTEGER" property="injectDuration" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, last_history_id, manure_id, dt, stir_running1, stir_running2, stir_running3, |
| | | stir_running4, inject_running, irr_running, alarm, manure_flow, manure_time, stir_time, |
| | | stir_duration, inject_duration |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_manure_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--根据指定条件获取记录--> |
| | | <select id="selectRmManureLast" resultType="com.dy.pipIrrGlobal.pojoRm.RmManureLast"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_manure_last |
| | | <where> |
| | | <if test="stManureId != null and stManureId != ''"> |
| | | and manure_id = #{stManureId} |
| | | </if> |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_manure_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_manure_last (id, last_history_id, manure_id, |
| | | dt, stir_running1, stir_running2, |
| | | stir_running3, stir_running4, inject_running, |
| | | irr_running, alarm, manure_flow, |
| | | manure_time, stir_time, stir_duration, |
| | | inject_duration) |
| | | values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{manureId,jdbcType=BIGINT}, |
| | | #{dt,jdbcType=TIMESTAMP}, #{stirRunning1,jdbcType=TINYINT}, #{stirRunning2,jdbcType=TINYINT}, |
| | | #{stirRunning3,jdbcType=TINYINT}, #{stirRunning4,jdbcType=TINYINT}, #{injectRunning,jdbcType=TINYINT}, |
| | | #{irrRunning,jdbcType=TINYINT}, #{alarm,jdbcType=TINYINT}, #{manureFlow,jdbcType=FLOAT}, |
| | | #{manureTime,jdbcType=INTEGER}, #{stirTime,jdbcType=INTEGER}, #{stirDuration,jdbcType=INTEGER}, |
| | | #{injectDuration,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_manure_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id, |
| | | </if> |
| | | <if test="manureId != null"> |
| | | manure_id, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="stirRunning1 != null"> |
| | | stir_running1, |
| | | </if> |
| | | <if test="stirRunning2 != null"> |
| | | stir_running2, |
| | | </if> |
| | | <if test="stirRunning3 != null"> |
| | | stir_running3, |
| | | </if> |
| | | <if test="stirRunning4 != null"> |
| | | stir_running4, |
| | | </if> |
| | | <if test="injectRunning != null"> |
| | | inject_running, |
| | | </if> |
| | | <if test="irrRunning != null"> |
| | | irr_running, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | alarm, |
| | | </if> |
| | | <if test="manureFlow != null"> |
| | | manure_flow, |
| | | </if> |
| | | <if test="manureTime != null"> |
| | | manure_time, |
| | | </if> |
| | | <if test="stirTime != null"> |
| | | stir_time, |
| | | </if> |
| | | <if test="stirDuration != null"> |
| | | stir_duration, |
| | | </if> |
| | | <if test="injectDuration != null"> |
| | | inject_duration, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="manureId != null"> |
| | | #{manureId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="stirRunning1 != null"> |
| | | #{stirRunning1,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning2 != null"> |
| | | #{stirRunning2,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning3 != null"> |
| | | #{stirRunning3,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning4 != null"> |
| | | #{stirRunning4,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="injectRunning != null"> |
| | | #{injectRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="irrRunning != null"> |
| | | #{irrRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | #{alarm,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="manureFlow != null"> |
| | | #{manureFlow,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="manureTime != null"> |
| | | #{manureTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirTime != null"> |
| | | #{stirTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirDuration != null"> |
| | | #{stirDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="injectDuration != null"> |
| | | #{injectDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_manure_last |
| | | <set> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="manureId != null"> |
| | | manure_id = #{manureId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="stirRunning1 != null"> |
| | | stir_running1 = #{stirRunning1,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning2 != null"> |
| | | stir_running2 = #{stirRunning2,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning3 != null"> |
| | | stir_running3 = #{stirRunning3,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stirRunning4 != null"> |
| | | stir_running4 = #{stirRunning4,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="injectRunning != null"> |
| | | inject_running = #{injectRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="irrRunning != null"> |
| | | irr_running = #{irrRunning,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | alarm = #{alarm,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="manureFlow != null"> |
| | | manure_flow = #{manureFlow,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="manureTime != null"> |
| | | manure_time = #{manureTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirTime != null"> |
| | | stir_time = #{stirTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stirDuration != null"> |
| | | stir_duration = #{stirDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="injectDuration != null"> |
| | | inject_duration = #{injectDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmManureLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_manure_last |
| | | set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | manure_id = #{manureId,jdbcType=BIGINT}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | stir_running1 = #{stirRunning1,jdbcType=TINYINT}, |
| | | stir_running2 = #{stirRunning2,jdbcType=TINYINT}, |
| | | stir_running3 = #{stirRunning3,jdbcType=TINYINT}, |
| | | stir_running4 = #{stirRunning4,jdbcType=TINYINT}, |
| | | inject_running = #{injectRunning,jdbcType=TINYINT}, |
| | | irr_running = #{irrRunning,jdbcType=TINYINT}, |
| | | alarm = #{alarm,jdbcType=TINYINT}, |
| | | manure_flow = #{manureFlow,jdbcType=FLOAT}, |
| | | manure_time = #{manureTime,jdbcType=INTEGER}, |
| | | stir_time = #{stirTime,jdbcType=INTEGER}, |
| | | stir_duration = #{stirDuration,jdbcType=INTEGER}, |
| | | inject_duration = #{injectDuration,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmSoilDayMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmSoilDay"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_soil_day--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="soil_id" jdbcType="BIGINT" property="soilId" /> |
| | | <result column="dt" jdbcType="DATE" property="dt" /> |
| | | <result column="ymd" jdbcType="INTEGER" property="ymd" /> |
| | | <result column="soil_humidity1" jdbcType="FLOAT" property="soilHumidity1" /> |
| | | <result column="soil_humidity2" jdbcType="FLOAT" property="soilHumidity2" /> |
| | | <result column="soil_humidity3" jdbcType="FLOAT" property="soilHumidity3" /> |
| | | <result column="soil_humidity4" jdbcType="FLOAT" property="soilHumidity4" /> |
| | | <result column="soil_humidity5" jdbcType="FLOAT" property="soilHumidity5" /> |
| | | <result column="soil_temperature1" jdbcType="FLOAT" property="soilTemperature1" /> |
| | | <result column="soil_temperature2" jdbcType="FLOAT" property="soilTemperature2" /> |
| | | <result column="soil_temperature3" jdbcType="FLOAT" property="soilTemperature3" /> |
| | | <result column="soil_temperature4" jdbcType="FLOAT" property="soilTemperature4" /> |
| | | <result column="soil_temperature5" jdbcType="FLOAT" property="soilTemperature5" /> |
| | | <result column="times" jdbcType="INTEGER" property="times" /> |
| | | <result column="soil_sum_humidity1" jdbcType="FLOAT" property="soilSumHumidity1" /> |
| | | <result column="soil_sum_humidity2" jdbcType="FLOAT" property="soilSumHumidity2" /> |
| | | <result column="soil_sum_humidity3" jdbcType="FLOAT" property="soilSumHumidity3" /> |
| | | <result column="soil_sum_humidity4" jdbcType="FLOAT" property="soilSumHumidity4" /> |
| | | <result column="soil_sum_humidity5" jdbcType="FLOAT" property="soilSumHumidity5" /> |
| | | <result column="soil_sum_temperature1" jdbcType="FLOAT" property="soilSumTemperature1" /> |
| | | <result column="soil_sum_temperature2" jdbcType="FLOAT" property="soilSumTemperature2" /> |
| | | <result column="soil_sum_temperature3" jdbcType="FLOAT" property="soilSumTemperature3" /> |
| | | <result column="soil_sum_temperature4" jdbcType="FLOAT" property="soilSumTemperature4" /> |
| | | <result column="soil_sum_temperature5" jdbcType="FLOAT" property="soilSumTemperature5" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, soil_id, dt, ymd, soil_humidity1, soil_humidity2, soil_humidity3, soil_humidity4, |
| | | soil_humidity5, soil_temperature1, soil_temperature2, soil_temperature3, soil_temperature4, |
| | | soil_temperature5, times, soil_sum_humidity1, soil_sum_humidity2, soil_sum_humidity3, |
| | | soil_sum_humidity4, soil_sum_humidity5, soil_sum_temperature1, soil_sum_temperature2, |
| | | soil_sum_temperature3, soil_sum_temperature4, soil_sum_temperature5 |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_soil_day |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--根据指定条件获取记录--> |
| | | <select id="selectRmSoilDay" resultType="com.dy.pipIrrGlobal.pojoRm.RmSoilDay"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_soil_day |
| | | <where> |
| | | <if test="stSoilId != null and stSoilId != ''"> |
| | | and soil_id = #{stSoilId} |
| | | </if> |
| | | <if test="ymd != null and ymd != ''"> |
| | | and ymd = #{ymd} |
| | | </if> |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_soil_day |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilDay"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_soil_day (id, soil_id, dt, ymd, soil_humidity1, |
| | | soil_humidity2, soil_humidity3, soil_humidity4, |
| | | soil_humidity5, soil_temperature1, soil_temperature2, |
| | | soil_temperature3, soil_temperature4, soil_temperature5, |
| | | times, soil_sum_humidity1, soil_sum_humidity2, |
| | | soil_sum_humidity3, soil_sum_humidity4, soil_sum_humidity5, |
| | | soil_sum_temperature1, soil_sum_temperature2, soil_sum_temperature3, |
| | | soil_sum_temperature4, soil_sum_temperature5) |
| | | values (#{id,jdbcType=BIGINT}, #{soilId,jdbcType=BIGINT}, #{dt,jdbcType=DATE}, #{ymd,jdbcType=INTEGER}, #{soilHumidity1,jdbcType=FLOAT}, |
| | | #{soilHumidity2,jdbcType=FLOAT}, #{soilHumidity3,jdbcType=FLOAT}, #{soilHumidity4,jdbcType=FLOAT}, |
| | | #{soilHumidity5,jdbcType=FLOAT}, #{soilTemperature1,jdbcType=FLOAT}, #{soilTemperature2,jdbcType=FLOAT}, |
| | | #{soilTemperature3,jdbcType=FLOAT}, #{soilTemperature4,jdbcType=FLOAT}, #{soilTemperature5,jdbcType=FLOAT}, |
| | | #{times,jdbcType=INTEGER}, #{soilSumHumidity1,jdbcType=FLOAT}, #{soilSumHumidity2,jdbcType=FLOAT}, |
| | | #{soilSumHumidity3,jdbcType=FLOAT}, #{soilSumHumidity4,jdbcType=FLOAT}, #{soilSumHumidity5,jdbcType=FLOAT}, |
| | | #{soilSumTemperature1,jdbcType=FLOAT}, #{soilSumTemperature2,jdbcType=FLOAT}, #{soilSumTemperature3,jdbcType=FLOAT}, |
| | | #{soilSumTemperature4,jdbcType=FLOAT}, #{soilSumTemperature5,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilDay"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_soil_day |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="soilId != null"> |
| | | soil_id, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="ymd != null"> |
| | | ymd, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | soil_humidity1, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | soil_humidity2, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | soil_humidity3, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | soil_humidity4, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | soil_humidity5, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | soil_temperature1, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | soil_temperature2, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | soil_temperature3, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | soil_temperature4, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | soil_temperature5, |
| | | </if> |
| | | <if test="times != null"> |
| | | times, |
| | | </if> |
| | | <if test="soilSumHumidity1 != null"> |
| | | soil_sum_humidity1, |
| | | </if> |
| | | <if test="soilSumHumidity2 != null"> |
| | | soil_sum_humidity2, |
| | | </if> |
| | | <if test="soilSumHumidity3 != null"> |
| | | soil_sum_humidity3, |
| | | </if> |
| | | <if test="soilSumHumidity4 != null"> |
| | | soil_sum_humidity4, |
| | | </if> |
| | | <if test="soilSumHumidity5 != null"> |
| | | soil_sum_humidity5, |
| | | </if> |
| | | <if test="soilSumTemperature1 != null"> |
| | | soil_sum_temperature1, |
| | | </if> |
| | | <if test="soilSumTemperature2 != null"> |
| | | soil_sum_temperature2, |
| | | </if> |
| | | <if test="soilSumTemperature3 != null"> |
| | | soil_sum_temperature3, |
| | | </if> |
| | | <if test="soilSumTemperature4 != null"> |
| | | soil_sum_temperature4, |
| | | </if> |
| | | <if test="soilSumTemperature5 != null"> |
| | | soil_sum_temperature5, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="soilId != null"> |
| | | #{soilId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="ymd != null"> |
| | | #{ymd,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | #{soilHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | #{soilHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | #{soilHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | #{soilHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | #{soilHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | #{soilTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | #{soilTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | #{soilTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | #{soilTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | #{soilTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="times != null"> |
| | | #{times,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="soilSumHumidity1 != null"> |
| | | #{soilSumHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity2 != null"> |
| | | #{soilSumHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity3 != null"> |
| | | #{soilSumHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity4 != null"> |
| | | #{soilSumHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity5 != null"> |
| | | #{soilSumHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature1 != null"> |
| | | #{soilSumTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature2 != null"> |
| | | #{soilSumTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature3 != null"> |
| | | #{soilSumTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature4 != null"> |
| | | #{soilSumTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature5 != null"> |
| | | #{soilSumTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilDay"> |
| | | <!--@mbg.generated--> |
| | | update rm_soil_day |
| | | <set> |
| | | <if test="soilId != null"> |
| | | soil_id = #{soilId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="ymd != null"> |
| | | ymd = #{ymd,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | soil_humidity1 = #{soilHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | soil_humidity2 = #{soilHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | soil_humidity3 = #{soilHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | soil_humidity4 = #{soilHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | soil_humidity5 = #{soilHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | soil_temperature1 = #{soilTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | soil_temperature2 = #{soilTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | soil_temperature3 = #{soilTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | soil_temperature4 = #{soilTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | soil_temperature5 = #{soilTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="times != null"> |
| | | times = #{times,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="soilSumHumidity1 != null"> |
| | | soil_sum_humidity1 = #{soilSumHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity2 != null"> |
| | | soil_sum_humidity2 = #{soilSumHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity3 != null"> |
| | | soil_sum_humidity3 = #{soilSumHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity4 != null"> |
| | | soil_sum_humidity4 = #{soilSumHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumHumidity5 != null"> |
| | | soil_sum_humidity5 = #{soilSumHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature1 != null"> |
| | | soil_sum_temperature1 = #{soilSumTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature2 != null"> |
| | | soil_sum_temperature2 = #{soilSumTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature3 != null"> |
| | | soil_sum_temperature3 = #{soilSumTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature4 != null"> |
| | | soil_sum_temperature4 = #{soilSumTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilSumTemperature5 != null"> |
| | | soil_sum_temperature5 = #{soilSumTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilDay"> |
| | | <!--@mbg.generated--> |
| | | update rm_soil_day |
| | | set soil_id = #{soilId,jdbcType=BIGINT}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | ymd = #{ymd,jdbcType=INTEGER}, |
| | | soil_humidity1 = #{soilHumidity1,jdbcType=FLOAT}, |
| | | soil_humidity2 = #{soilHumidity2,jdbcType=FLOAT}, |
| | | soil_humidity3 = #{soilHumidity3,jdbcType=FLOAT}, |
| | | soil_humidity4 = #{soilHumidity4,jdbcType=FLOAT}, |
| | | soil_humidity5 = #{soilHumidity5,jdbcType=FLOAT}, |
| | | soil_temperature1 = #{soilTemperature1,jdbcType=FLOAT}, |
| | | soil_temperature2 = #{soilTemperature2,jdbcType=FLOAT}, |
| | | soil_temperature3 = #{soilTemperature3,jdbcType=FLOAT}, |
| | | soil_temperature4 = #{soilTemperature4,jdbcType=FLOAT}, |
| | | soil_temperature5 = #{soilTemperature5,jdbcType=FLOAT}, |
| | | times = #{times,jdbcType=INTEGER}, |
| | | soil_sum_humidity1 = #{soilSumHumidity1,jdbcType=FLOAT}, |
| | | soil_sum_humidity2 = #{soilSumHumidity2,jdbcType=FLOAT}, |
| | | soil_sum_humidity3 = #{soilSumHumidity3,jdbcType=FLOAT}, |
| | | soil_sum_humidity4 = #{soilSumHumidity4,jdbcType=FLOAT}, |
| | | soil_sum_humidity5 = #{soilSumHumidity5,jdbcType=FLOAT}, |
| | | soil_sum_temperature1 = #{soilSumTemperature1,jdbcType=FLOAT}, |
| | | soil_sum_temperature2 = #{soilSumTemperature2,jdbcType=FLOAT}, |
| | | soil_sum_temperature3 = #{soilSumTemperature3,jdbcType=FLOAT}, |
| | | soil_sum_temperature4 = #{soilSumTemperature4,jdbcType=FLOAT}, |
| | | soil_sum_temperature5 = #{soilSumTemperature5,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmSoilHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmSoilHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_soil_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="soil_id" jdbcType="BIGINT" property="soilId" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="soil_humidity1" jdbcType="FLOAT" property="soilHumidity1" /> |
| | | <result column="soil_humidity2" jdbcType="FLOAT" property="soilHumidity2" /> |
| | | <result column="soil_humidity3" jdbcType="FLOAT" property="soilHumidity3" /> |
| | | <result column="soil_humidity4" jdbcType="FLOAT" property="soilHumidity4" /> |
| | | <result column="soil_humidity5" jdbcType="FLOAT" property="soilHumidity5" /> |
| | | <result column="soil_temperature1" jdbcType="FLOAT" property="soilTemperature1" /> |
| | | <result column="soil_temperature2" jdbcType="FLOAT" property="soilTemperature2" /> |
| | | <result column="soil_temperature3" jdbcType="FLOAT" property="soilTemperature3" /> |
| | | <result column="soil_temperature4" jdbcType="FLOAT" property="soilTemperature4" /> |
| | | <result column="soil_temperature5" jdbcType="FLOAT" property="soilTemperature5" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, soil_id, dt, soil_humidity1, soil_humidity2, soil_humidity3, soil_humidity4, |
| | | soil_humidity5, soil_temperature1, soil_temperature2, soil_temperature3, soil_temperature4, |
| | | soil_temperature5 |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_soil_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_soil_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_soil_history (id, soil_id, dt, |
| | | soil_humidity1, soil_humidity2, soil_humidity3, |
| | | soil_humidity4, soil_humidity5, soil_temperature1, |
| | | soil_temperature2, soil_temperature3, soil_temperature4, |
| | | soil_temperature5) |
| | | values (#{id,jdbcType=BIGINT}, #{soilId,jdbcType=BIGINT}, #{dt,jdbcType=TIMESTAMP}, |
| | | #{soilHumidity1,jdbcType=FLOAT}, #{soilHumidity2,jdbcType=FLOAT}, #{soilHumidity3,jdbcType=FLOAT}, |
| | | #{soilHumidity4,jdbcType=FLOAT}, #{soilHumidity5,jdbcType=FLOAT}, #{soilTemperature1,jdbcType=FLOAT}, |
| | | #{soilTemperature2,jdbcType=FLOAT}, #{soilTemperature3,jdbcType=FLOAT}, #{soilTemperature4,jdbcType=FLOAT}, |
| | | #{soilTemperature5,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_soil_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="soilId != null"> |
| | | soil_id, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | soil_humidity1, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | soil_humidity2, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | soil_humidity3, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | soil_humidity4, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | soil_humidity5, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | soil_temperature1, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | soil_temperature2, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | soil_temperature3, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | soil_temperature4, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | soil_temperature5, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="soilId != null"> |
| | | #{soilId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | #{soilHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | #{soilHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | #{soilHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | #{soilHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | #{soilHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | #{soilTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | #{soilTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | #{soilTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | #{soilTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | #{soilTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_soil_history |
| | | <set> |
| | | <if test="soilId != null"> |
| | | soil_id = #{soilId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | soil_humidity1 = #{soilHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | soil_humidity2 = #{soilHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | soil_humidity3 = #{soilHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | soil_humidity4 = #{soilHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | soil_humidity5 = #{soilHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | soil_temperature1 = #{soilTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | soil_temperature2 = #{soilTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | soil_temperature3 = #{soilTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | soil_temperature4 = #{soilTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | soil_temperature5 = #{soilTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_soil_history |
| | | set soil_id = #{soilId,jdbcType=BIGINT}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | soil_humidity1 = #{soilHumidity1,jdbcType=FLOAT}, |
| | | soil_humidity2 = #{soilHumidity2,jdbcType=FLOAT}, |
| | | soil_humidity3 = #{soilHumidity3,jdbcType=FLOAT}, |
| | | soil_humidity4 = #{soilHumidity4,jdbcType=FLOAT}, |
| | | soil_humidity5 = #{soilHumidity5,jdbcType=FLOAT}, |
| | | soil_temperature1 = #{soilTemperature1,jdbcType=FLOAT}, |
| | | soil_temperature2 = #{soilTemperature2,jdbcType=FLOAT}, |
| | | soil_temperature3 = #{soilTemperature3,jdbcType=FLOAT}, |
| | | soil_temperature4 = #{soilTemperature4,jdbcType=FLOAT}, |
| | | soil_temperature5 = #{soilTemperature5,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmSoilLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmSoilLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_soil_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="last_history_id" jdbcType="BIGINT" property="lastHistoryId" /> |
| | | <result column="soil_id" jdbcType="BIGINT" property="soilId" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="soil_humidity1" jdbcType="FLOAT" property="soilHumidity1" /> |
| | | <result column="soil_humidity2" jdbcType="FLOAT" property="soilHumidity2" /> |
| | | <result column="soil_humidity3" jdbcType="FLOAT" property="soilHumidity3" /> |
| | | <result column="soil_humidity4" jdbcType="FLOAT" property="soilHumidity4" /> |
| | | <result column="soil_humidity5" jdbcType="FLOAT" property="soilHumidity5" /> |
| | | <result column="soil_temperature1" jdbcType="FLOAT" property="soilTemperature1" /> |
| | | <result column="soil_temperature2" jdbcType="FLOAT" property="soilTemperature2" /> |
| | | <result column="soil_temperature3" jdbcType="FLOAT" property="soilTemperature3" /> |
| | | <result column="soil_temperature4" jdbcType="FLOAT" property="soilTemperature4" /> |
| | | <result column="soil_temperature5" jdbcType="FLOAT" property="soilTemperature5" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, last_history_id, soil_id, dt, soil_humidity1, soil_humidity2, soil_humidity3, |
| | | soil_humidity4, soil_humidity5, soil_temperature1, soil_temperature2, soil_temperature3, |
| | | soil_temperature4, soil_temperature5 |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_soil_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--根据指定条件获取记录--> |
| | | <select id="selectRmSoilLast" resultType="com.dy.pipIrrGlobal.pojoRm.RmSoilLast"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_soil_last |
| | | <where> |
| | | <if test="stSoilId != null and stSoilId != ''"> |
| | | and soil_id = #{stSoilId} |
| | | </if> |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_soil_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_soil_last (id, last_history_id, soil_id, |
| | | dt, soil_humidity1, soil_humidity2, |
| | | soil_humidity3, soil_humidity4, soil_humidity5, |
| | | soil_temperature1, soil_temperature2, soil_temperature3, |
| | | soil_temperature4, soil_temperature5) |
| | | values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{soilId,jdbcType=BIGINT}, |
| | | #{dt,jdbcType=TIMESTAMP}, #{soilHumidity1,jdbcType=FLOAT}, #{soilHumidity2,jdbcType=FLOAT}, |
| | | #{soilHumidity3,jdbcType=FLOAT}, #{soilHumidity4,jdbcType=FLOAT}, #{soilHumidity5,jdbcType=FLOAT}, |
| | | #{soilTemperature1,jdbcType=FLOAT}, #{soilTemperature2,jdbcType=FLOAT}, #{soilTemperature3,jdbcType=FLOAT}, |
| | | #{soilTemperature4,jdbcType=FLOAT}, #{soilTemperature5,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_soil_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id, |
| | | </if> |
| | | <if test="soilId != null"> |
| | | soil_id, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | soil_humidity1, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | soil_humidity2, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | soil_humidity3, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | soil_humidity4, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | soil_humidity5, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | soil_temperature1, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | soil_temperature2, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | soil_temperature3, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | soil_temperature4, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | soil_temperature5, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="soilId != null"> |
| | | #{soilId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | #{soilHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | #{soilHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | #{soilHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | #{soilHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | #{soilHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | #{soilTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | #{soilTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | #{soilTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | #{soilTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | #{soilTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_soil_last |
| | | <set> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="soilId != null"> |
| | | soil_id = #{soilId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="soilHumidity1 != null"> |
| | | soil_humidity1 = #{soilHumidity1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity2 != null"> |
| | | soil_humidity2 = #{soilHumidity2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity3 != null"> |
| | | soil_humidity3 = #{soilHumidity3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity4 != null"> |
| | | soil_humidity4 = #{soilHumidity4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilHumidity5 != null"> |
| | | soil_humidity5 = #{soilHumidity5,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature1 != null"> |
| | | soil_temperature1 = #{soilTemperature1,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature2 != null"> |
| | | soil_temperature2 = #{soilTemperature2,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature3 != null"> |
| | | soil_temperature3 = #{soilTemperature3,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature4 != null"> |
| | | soil_temperature4 = #{soilTemperature4,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="soilTemperature5 != null"> |
| | | soil_temperature5 = #{soilTemperature5,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmSoilLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_soil_last |
| | | set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | soil_id = #{soilId,jdbcType=BIGINT}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | soil_humidity1 = #{soilHumidity1,jdbcType=FLOAT}, |
| | | soil_humidity2 = #{soilHumidity2,jdbcType=FLOAT}, |
| | | soil_humidity3 = #{soilHumidity3,jdbcType=FLOAT}, |
| | | soil_humidity4 = #{soilHumidity4,jdbcType=FLOAT}, |
| | | soil_humidity5 = #{soilHumidity5,jdbcType=FLOAT}, |
| | | soil_temperature1 = #{soilTemperature1,jdbcType=FLOAT}, |
| | | soil_temperature2 = #{soilTemperature2,jdbcType=FLOAT}, |
| | | soil_temperature3 = #{soilTemperature3,jdbcType=FLOAT}, |
| | | soil_temperature4 = #{soilTemperature4,jdbcType=FLOAT}, |
| | | soil_temperature5 = #{soilTemperature5,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmWeatherHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_weather_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="weather_id" jdbcType="BIGINT" property="weatherId" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="air_temperature" jdbcType="FLOAT" property="airTemperature" /> |
| | | <result column="air_humidity" jdbcType="FLOAT" property="airHumidity" /> |
| | | <result column="ultraviolet" jdbcType="INTEGER" property="ultraviolet" /> |
| | | <result column="light_intensity" jdbcType="INTEGER" property="lightIntensity" /> |
| | | <result column="rainfall" jdbcType="FLOAT" property="rainfall" /> |
| | | <result column="wind_speed" jdbcType="FLOAT" property="windSpeed" /> |
| | | <result column="wind_direction" jdbcType="INTEGER" property="windDirection" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, weather_id, dt, air_temperature, air_humidity, ultraviolet, light_intensity, |
| | | rainfall, wind_speed, wind_direction |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_weather_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_weather_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_weather_history (id, weather_id, dt, |
| | | air_temperature, air_humidity, ultraviolet, |
| | | light_intensity, rainfall, wind_speed, |
| | | wind_direction) |
| | | values (#{id,jdbcType=BIGINT}, #{weatherId,jdbcType=BIGINT}, #{dt,jdbcType=TIMESTAMP}, |
| | | #{airTemperature,jdbcType=FLOAT}, #{airHumidity,jdbcType=FLOAT}, #{ultraviolet,jdbcType=INTEGER}, |
| | | #{lightIntensity,jdbcType=INTEGER}, #{rainfall,jdbcType=FLOAT}, #{windSpeed,jdbcType=FLOAT}, |
| | | #{windDirection,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_weather_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="weatherId != null"> |
| | | weather_id, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="airTemperature != null"> |
| | | air_temperature, |
| | | </if> |
| | | <if test="airHumidity != null"> |
| | | air_humidity, |
| | | </if> |
| | | <if test="ultraviolet != null"> |
| | | ultraviolet, |
| | | </if> |
| | | <if test="lightIntensity != null"> |
| | | light_intensity, |
| | | </if> |
| | | <if test="rainfall != null"> |
| | | rainfall, |
| | | </if> |
| | | <if test="windSpeed != null"> |
| | | wind_speed, |
| | | </if> |
| | | <if test="windDirection != null"> |
| | | wind_direction, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="weatherId != null"> |
| | | #{weatherId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="airTemperature != null"> |
| | | #{airTemperature,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="airHumidity != null"> |
| | | #{airHumidity,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="ultraviolet != null"> |
| | | #{ultraviolet,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="lightIntensity != null"> |
| | | #{lightIntensity,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="rainfall != null"> |
| | | #{rainfall,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windSpeed != null"> |
| | | #{windSpeed,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windDirection != null"> |
| | | #{windDirection,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_weather_history |
| | | <set> |
| | | <if test="weatherId != null"> |
| | | weather_id = #{weatherId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="airTemperature != null"> |
| | | air_temperature = #{airTemperature,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="airHumidity != null"> |
| | | air_humidity = #{airHumidity,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="ultraviolet != null"> |
| | | ultraviolet = #{ultraviolet,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="lightIntensity != null"> |
| | | light_intensity = #{lightIntensity,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="rainfall != null"> |
| | | rainfall = #{rainfall,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windSpeed != null"> |
| | | wind_speed = #{windSpeed,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windDirection != null"> |
| | | wind_direction = #{windDirection,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_weather_history |
| | | set weather_id = #{weatherId,jdbcType=BIGINT}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | air_temperature = #{airTemperature,jdbcType=FLOAT}, |
| | | air_humidity = #{airHumidity,jdbcType=FLOAT}, |
| | | ultraviolet = #{ultraviolet,jdbcType=INTEGER}, |
| | | light_intensity = #{lightIntensity,jdbcType=INTEGER}, |
| | | rainfall = #{rainfall,jdbcType=FLOAT}, |
| | | wind_speed = #{windSpeed,jdbcType=FLOAT}, |
| | | wind_direction = #{windDirection,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmWeatherLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmWeatherLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_weather_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="last_history_id" jdbcType="BIGINT" property="lastHistoryId" /> |
| | | <result column="weather_id" jdbcType="BIGINT" property="weatherId" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="air_temperature" jdbcType="FLOAT" property="airTemperature" /> |
| | | <result column="air_humidity" jdbcType="FLOAT" property="airHumidity" /> |
| | | <result column="ultraviolet" jdbcType="INTEGER" property="ultraviolet" /> |
| | | <result column="light_intensity" jdbcType="INTEGER" property="lightIntensity" /> |
| | | <result column="rainfall" jdbcType="FLOAT" property="rainfall" /> |
| | | <result column="wind_speed" jdbcType="FLOAT" property="windSpeed" /> |
| | | <result column="wind_direction" jdbcType="INTEGER" property="windDirection" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, last_history_id, weather_id, dt, air_temperature, air_humidity, ultraviolet, |
| | | light_intensity, rainfall, wind_speed, wind_direction |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_weather_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--根据指定条件获取记录--> |
| | | <select id="selectRmWeatherLast" resultType="com.dy.pipIrrGlobal.pojoRm.RmWeatherLast"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_weather_last |
| | | <where> |
| | | <if test="stWeatherId != null and stWeatherId != ''"> |
| | | and weather_id = #{stWeatherId} |
| | | </if> |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_weather_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_weather_last (id, last_history_id, weather_id, |
| | | dt, air_temperature, air_humidity, |
| | | ultraviolet, light_intensity, rainfall, |
| | | wind_speed, wind_direction) |
| | | values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{weatherId,jdbcType=BIGINT}, |
| | | #{dt,jdbcType=TIMESTAMP}, #{airTemperature,jdbcType=FLOAT}, #{airHumidity,jdbcType=FLOAT}, |
| | | #{ultraviolet,jdbcType=INTEGER}, #{lightIntensity,jdbcType=INTEGER}, #{rainfall,jdbcType=FLOAT}, |
| | | #{windSpeed,jdbcType=FLOAT}, #{windDirection,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_weather_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id, |
| | | </if> |
| | | <if test="weatherId != null"> |
| | | weather_id, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="airTemperature != null"> |
| | | air_temperature, |
| | | </if> |
| | | <if test="airHumidity != null"> |
| | | air_humidity, |
| | | </if> |
| | | <if test="ultraviolet != null"> |
| | | ultraviolet, |
| | | </if> |
| | | <if test="lightIntensity != null"> |
| | | light_intensity, |
| | | </if> |
| | | <if test="rainfall != null"> |
| | | rainfall, |
| | | </if> |
| | | <if test="windSpeed != null"> |
| | | wind_speed, |
| | | </if> |
| | | <if test="windDirection != null"> |
| | | wind_direction, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="weatherId != null"> |
| | | #{weatherId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="airTemperature != null"> |
| | | #{airTemperature,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="airHumidity != null"> |
| | | #{airHumidity,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="ultraviolet != null"> |
| | | #{ultraviolet,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="lightIntensity != null"> |
| | | #{lightIntensity,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="rainfall != null"> |
| | | #{rainfall,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windSpeed != null"> |
| | | #{windSpeed,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windDirection != null"> |
| | | #{windDirection,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_weather_last |
| | | <set> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="weatherId != null"> |
| | | weather_id = #{weatherId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="airTemperature != null"> |
| | | air_temperature = #{airTemperature,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="airHumidity != null"> |
| | | air_humidity = #{airHumidity,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="ultraviolet != null"> |
| | | ultraviolet = #{ultraviolet,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="lightIntensity != null"> |
| | | light_intensity = #{lightIntensity,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="rainfall != null"> |
| | | rainfall = #{rainfall,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windSpeed != null"> |
| | | wind_speed = #{windSpeed,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="windDirection != null"> |
| | | wind_direction = #{windDirection,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWeatherLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_weather_last |
| | | set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | weather_id = #{weatherId,jdbcType=BIGINT}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | air_temperature = #{airTemperature,jdbcType=FLOAT}, |
| | | air_humidity = #{airHumidity,jdbcType=FLOAT}, |
| | | ultraviolet = #{ultraviolet,jdbcType=INTEGER}, |
| | | light_intensity = #{lightIntensity,jdbcType=INTEGER}, |
| | | rainfall = #{rainfall,jdbcType=FLOAT}, |
| | | wind_speed = #{windSpeed,jdbcType=FLOAT}, |
| | | wind_direction = #{windDirection,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | |
| | | mqVo.comCacheTimeout = conf.getSetAttrPlusInt(doc, "config.mqtt", "comCacheTimeout", null, 1, 3600, null) * 1000L ; |
| | | |
| | | ServerProperties.mqttAcceptDataMinInterval = conf.getSetAttrPlusInt(doc, "config.mqtt", "acceptDataMinInterval", null, 1, 720, null) * 60 * 1000L ; |
| | | |
| | | mqVo.useMemoryPersistence = conf.getSetAttrBoolean(doc, "config.mqtt", "useMemoryPersistence", null, null) ; |
| | | String proAndDevIds = conf.getSetAttrTxt(doc, "config.mqtt", "protocolAndDeviceIds", null, false, null) ; |
| | | if(proAndDevIds == null || proAndDevIds.trim().equals("")){ |
| | |
| | | |
| | | //Mqtt模块是否启动 |
| | | public static Boolean mqttUnitEnable = false ; |
| | | public static Long mqttAcceptDataMinInterval = 60 * 60 * 1000L ;//默认60分钟 |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.dy.rtuMw.server.rtuData.dbSv; |
| | | |
| | | import com.dy.common.util.NumUtil; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerTrampMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.*; |
| | | import com.dy.pipIrrGlobal.daoRm.*; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp; |
| | | import com.dy.pipIrrGlobal.pojoPr.*; |
| | | import com.dy.pipIrrGlobal.pojoRm.*; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo1; |
| | |
| | | private RmOnHourReportHistoryMapper rmOnHourReportHistoryDao; // 定点上报历史数据DAO |
| | | @Autowired |
| | | private RmOnHourReportLastMapper rmOnHourReportLastDao; // 定点上报最新数据DAO |
| | | |
| | | @Autowired |
| | | private PrStManureMapper prStManureDao; //水肥机DAO |
| | | @Autowired |
| | | private PrStSoilMapper prStSoilDao; //墒情站DAO |
| | | @Autowired |
| | | private PrStWeatherMapper prStWeatherDao; //气象站DAO |
| | | @Autowired |
| | | private RmManureLastMapper rmManureLastDao; //水肥DAO |
| | | @Autowired |
| | | private RmManureHistoryMapper rmManureHistoryDao; //水肥DAO |
| | | @Autowired |
| | | private RmSoilLastMapper rmSoilLastDao; //墒情DAO |
| | | @Autowired |
| | | private RmSoilHistoryMapper rmSoilHistoryDao; //墒情DAO |
| | | @Autowired |
| | | private RmSoilDayMapper rmSoilDayDao; //墒情DAO |
| | | @Autowired |
| | | private RmWeatherLastMapper rmWeatherLastDao; //气象DAO |
| | | @Autowired |
| | | private RmWeatherHistoryMapper rmWeatherHistoryDao; //气象DAO |
| | | |
| | | |
| | | //@Autowired |
| | |
| | | seVirtualCardDao.updateMoney(id,remainMoney); |
| | | } |
| | | |
| | | |
| | | ////////////////////////////////////////////////////// |
| | | // |
| | | // 水肥数据相关 |
| | | // |
| | | ////////////////////////////////////////////////////// |
| | | /** |
| | | * 通过FBox序列号得到水肥机实体 |
| | | * @param fboxId FBox序列号 |
| | | * @param no 编号 |
| | | * @return 水肥机实体 |
| | | */ |
| | | public PrStManure getStManureByFBoxIdAndNo(String fboxId, Integer no){ |
| | | List<PrStManure> list = this.prStManureDao.selectStPoByFBoxIdAndNo(fboxId, no) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 查询上报最新数据 |
| | | * @param stManureId |
| | | * @return |
| | | */ |
| | | public RmManureLast getRmManureLast(Long stManureId) { |
| | | List<RmManureLast> list = this.rmManureLastDao.selectRmManureLast(stManureId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmManureHistory(RmManureHistory po) { |
| | | this.rmManureHistoryDao.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 保存最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmManureLast(RmManureLast po) { |
| | | this.rmManureLastDao.insert(po); |
| | | } |
| | | /** |
| | | * 更新最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmManureLast(RmManureLast po){ |
| | | this.rmManureLastDao.updateByPrimaryKey(po) ; |
| | | } |
| | | |
| | | |
| | | ////////////////////////////////////////////////////// |
| | | // |
| | | // 墒情数据相关 |
| | | // |
| | | ////////////////////////////////////////////////////// |
| | | /** |
| | | * 通过FBox序列号得到墒情站实体 |
| | | * @param fboxId FBox序列号 |
| | | * @param no 编号 |
| | | * @return 水肥机实体 |
| | | */ |
| | | public PrStSoil getStSoilByFBoxIdAndNo(String fboxId, Integer no){ |
| | | List<PrStSoil> list = this.prStSoilDao.selectStPoByFBoxIdAndNo(fboxId, no) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 查询上报最新数据 |
| | | * @param stSoilId |
| | | * @return |
| | | */ |
| | | public RmSoilLast getRmSoilLast(Long stSoilId) { |
| | | List<RmSoilLast> list = this.rmSoilLastDao.selectRmSoilLast(stSoilId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmSoilHistory(RmSoilHistory po) { |
| | | this.rmSoilHistoryDao.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 保存最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmSoilLast(RmSoilLast po) { |
| | | this.rmSoilLastDao.insert(po); |
| | | } |
| | | /** |
| | | * 更新最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmSoilLast(RmSoilLast po){ |
| | | this.rmSoilLastDao.updateByPrimaryKey(po) ; |
| | | } |
| | | |
| | | /** |
| | | * 查询上报日数据 |
| | | * @param stSoilId |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public RmSoilDay getRmSoilDay(Long stSoilId, Integer nowYmd) { |
| | | List<RmSoilDay> list = this.rmSoilDayDao.selectRmSoilDay(stSoilId, nowYmd) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存日记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmSoilDay(RmSoilDay po) { |
| | | this.rmSoilDayDao.insert(po); |
| | | } |
| | | /** |
| | | * 更新日记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmSoilDay(RmSoilDay po){ |
| | | this.rmSoilDayDao.updateByPrimaryKey(po) ; |
| | | } |
| | | |
| | | |
| | | |
| | | ////////////////////////////////////////////////////// |
| | | // |
| | | // 气象数据相关 |
| | | // |
| | | ////////////////////////////////////////////////////// |
| | | /** |
| | | * 通过FBox序列号得到气象站实体 |
| | | * @param fboxId FBox序列号 |
| | | * @param no 编号 |
| | | * @return 水肥机实体 |
| | | */ |
| | | public PrStWeather getStWeatherByFBoxIdAndNo(String fboxId, Integer no){ |
| | | List<PrStWeather> list = this.prStWeatherDao.selectStPoByFBoxIdAndNo(fboxId, no) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | /** |
| | | * 查询上报最新数据 |
| | | * @param stWeatherId |
| | | * @return |
| | | */ |
| | | public RmWeatherLast getRmWeatherLast(Long stWeatherId) { |
| | | List<RmWeatherLast> list = this.rmWeatherLastDao.selectRmWeatherLast(stWeatherId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmWeatherHistory(RmWeatherHistory po) { |
| | | this.rmWeatherHistoryDao.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 保存最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmWeatherLast(RmWeatherLast po) { |
| | | this.rmWeatherLastDao.insert(po); |
| | | } |
| | | /** |
| | | * 更新最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmWeatherLast(RmWeatherLast po){ |
| | | this.rmWeatherLastDao.updateByPrimaryKey(po) ; |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////// |
| | | // |
| | | // 命令日志相关 |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.pSdV1; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.ManureVo; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureLast; |
| | | import com.dy.rtuMw.server.forMs.SendMsCache; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 11:37 |
| | | * @Description |
| | | */ |
| | | public class TkDealManureSdV1 extends TaskSurpport { |
| | | |
| | | private static Logger log = LogManager.getLogger(TkDealManureSdV1.class.getName()); |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealManureSdV1"; |
| | | |
| | | /** |
| | | * 执行节点任务 |
| | | * |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | //前面的任务已经判断了data不为空且为水肥数据 |
| | | MqttSubMsg msg = (MqttSubMsg) data; |
| | | ManureVo stVo = (ManureVo) msg.vo4Up; |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs4ManureSdV1.taskId); |
| | | DbSv sv = (DbSv) objs[0]; |
| | | PrStManure stPo = (PrStManure) objs[1]; |
| | | try{ |
| | | this.doDeal(sv, stPo, msg, stVo); |
| | | }catch (Exception e){ |
| | | log.error("保存水肥数据时发生异常", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | */ |
| | | private void doDeal(DbSv sv, |
| | | PrStManure stPo, |
| | | MqttSubMsg msg, |
| | | ManureVo stVo) throws Exception { |
| | | RmManureHistory hpo = this.saveHistory(sv, stPo, msg, stVo); |
| | | this.saveOrUpdateLast(sv, stPo, msg, stVo, hpo); |
| | | } |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | * @param hpo 历史记录最新数据 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, |
| | | PrStManure stPo, |
| | | MqttSubMsg msg, |
| | | ManureVo stVo, |
| | | RmManureHistory hpo) throws Exception { |
| | | RmManureLast po = sv.getRmManureLast(stPo.id) ; |
| | | if(po == null){ |
| | | po = new RmManureLast(); |
| | | po.valueFrom(msg, stVo); |
| | | po.manureId = stPo.id ; |
| | | po.lastHistoryId = hpo==null?null:hpo.id ; |
| | | sv.saveRmManureLast(po) ; |
| | | if(stVo.alarm != null && stVo.alarm == 1){ |
| | | this.sendMessage(stPo, msg, stVo); |
| | | } |
| | | }else{ |
| | | po.valueFrom(msg, stVo); |
| | | po.manureId = stPo.id ; |
| | | po.lastHistoryId = hpo==null?null:hpo.id ; |
| | | sv.updateRmManureLast(po); |
| | | if(stVo.alarm != null && stVo.alarm == 1){ |
| | | this.sendMessage(stPo, msg, stVo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | */ |
| | | private RmManureHistory saveHistory(DbSv sv, |
| | | PrStManure stPo, |
| | | MqttSubMsg msg, |
| | | ManureVo stVo) throws Exception { |
| | | RmManureHistory po = new RmManureHistory(); |
| | | po.valueFrom(msg, stVo); |
| | | po.manureId = stPo.id ; |
| | | sv.saveRmManureHistory(po); |
| | | return po ; |
| | | } |
| | | |
| | | /** |
| | | * 向钉钉发送消息 |
| | | * @param stPo |
| | | * @param msg |
| | | * @param stVo |
| | | */ |
| | | private void sendMessage(PrStManure stPo, MqttSubMsg msg, ManureVo stVo){ |
| | | String ms = "水肥机“" + stPo.name + "”注肥泵报警"; |
| | | try{ |
| | | SendMsCache.cacheMs(ms); |
| | | }catch (Exception e){ |
| | | log.error("缓存钉钉消息异常:", e); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.pSdV1; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.SoilVo; |
| | | import com.dy.common.util.DateTime; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilDay; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 11:38 |
| | | * @Description |
| | | */ |
| | | public class TkDealSoilSdV1 extends TaskSurpport { |
| | | |
| | | private static Logger log = LogManager.getLogger(TkDealSoilSdV1.class.getName()); |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealSoilSdV1"; |
| | | |
| | | /** |
| | | * 执行节点任务 |
| | | * |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | //前面的任务已经判断了data不为空且为墒情数据 |
| | | MqttSubMsg msg = (MqttSubMsg) data; |
| | | SoilVo stVo = (SoilVo) msg.vo4Up; |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs4SoilSdV1.taskId); |
| | | DbSv sv = (DbSv) objs[0]; |
| | | PrStSoil stPo = (PrStSoil) objs[1]; |
| | | try{ |
| | | this.doDeal(sv, stPo, msg, stVo); |
| | | }catch (Exception e){ |
| | | log.error("保存墒情数据时发生异常", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | */ |
| | | private void doDeal(DbSv sv, |
| | | PrStSoil stPo, |
| | | MqttSubMsg msg, |
| | | SoilVo stVo) throws Exception { |
| | | RmSoilHistory hpo = this.saveHistory(sv, stPo, msg, stVo); |
| | | this.saveOrUpdateLast(sv, stPo, msg, stVo, hpo); |
| | | this.saveOrUpdateDay(sv, stPo, msg, stVo, hpo); |
| | | } |
| | | |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | * @param hpo 历史记录最新数据 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, |
| | | PrStSoil stPo, |
| | | MqttSubMsg msg, |
| | | SoilVo stVo, |
| | | RmSoilHistory hpo) throws Exception { |
| | | RmSoilLast po = sv.getRmSoilLast(stPo.id) ; |
| | | if(po == null){ |
| | | po = new RmSoilLast(); |
| | | po.valueFrom(msg, stVo); |
| | | po.soilId = stPo.id ; |
| | | po.lastHistoryId = hpo==null?null:hpo.id ; |
| | | sv.saveRmSoilLast(po) ; |
| | | }else{ |
| | | po.valueFrom(msg, stVo); |
| | | po.soilId = stPo.id ; |
| | | po.lastHistoryId = hpo==null?null:hpo.id ; |
| | | sv.updateRmSoilLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | */ |
| | | private RmSoilHistory saveHistory(DbSv sv, |
| | | PrStSoil stPo, |
| | | MqttSubMsg msg, |
| | | SoilVo stVo) throws Exception { |
| | | RmSoilHistory po = new RmSoilHistory(); |
| | | po.valueFrom(msg, stVo); |
| | | po.soilId = stPo.id ; |
| | | sv.saveRmSoilHistory(po); |
| | | return po ; |
| | | } |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | * @param hpo 历史记录最新数据 |
| | | */ |
| | | private void saveOrUpdateDay(DbSv sv, |
| | | PrStSoil stPo, |
| | | MqttSubMsg msg, |
| | | SoilVo stVo, |
| | | RmSoilHistory hpo) throws Exception { |
| | | RmSoilDay po = sv.getRmSoilDay(stPo.id, Integer.parseInt(DateTime.yyyyMMdd())) ; |
| | | if(po == null){ |
| | | po = new RmSoilDay(); |
| | | po.valueFrom(msg, stVo); |
| | | po.soilId = stPo.id ; |
| | | sv.saveRmSoilDay(po) ; |
| | | }else{ |
| | | po.updateFrom(msg, stVo); |
| | | po.soilId = stPo.id ; |
| | | sv.updateRmSoilDay(po); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.pSdV1; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.WeatherVo; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 11:37 |
| | | * @Description |
| | | */ |
| | | public class TkDealWeatherSdV1 extends TaskSurpport { |
| | | |
| | | private static Logger log = LogManager.getLogger(TkDealWeatherSdV1.class.getName()); |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealWeatherSdV1"; |
| | | |
| | | /** |
| | | * 执行节点任务 |
| | | * |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | //前面的任务已经判断了data不为空且为墒情数据 |
| | | MqttSubMsg msg = (MqttSubMsg) data; |
| | | WeatherVo stVo = (WeatherVo) msg.vo4Up; |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs4WeatherSdV1.taskId); |
| | | DbSv sv = (DbSv) objs[0]; |
| | | PrStWeather stPo = (PrStWeather) objs[1]; |
| | | try{ |
| | | this.doDeal(sv, stPo, msg, stVo); |
| | | }catch (Exception e){ |
| | | log.error("保存气象数据时发生异常", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | */ |
| | | private void doDeal(DbSv sv, |
| | | PrStWeather stPo, |
| | | MqttSubMsg msg, |
| | | WeatherVo stVo) throws Exception { |
| | | RmWeatherHistory hpo = this.saveHistory(sv, stPo, msg, stVo); |
| | | this.saveOrUpdateLast(sv, stPo, msg, stVo, hpo); |
| | | } |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | * @param hpo 历史记录最新数据 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, |
| | | PrStWeather stPo, |
| | | MqttSubMsg msg, |
| | | WeatherVo stVo, |
| | | RmWeatherHistory hpo) throws Exception { |
| | | RmWeatherLast po = sv.getRmWeatherLast(stPo.id) ; |
| | | if(po == null){ |
| | | po = new RmWeatherLast(); |
| | | po.valueFrom(msg, stVo); |
| | | po.weatherId = stPo.id ; |
| | | po.lastHistoryId = hpo==null?null:hpo.id ; |
| | | sv.saveRmWeatherLast(po) ; |
| | | }else{ |
| | | po.valueFrom(msg, stVo); |
| | | po.weatherId = stPo.id ; |
| | | po.lastHistoryId = hpo==null?null:hpo.id ; |
| | | sv.updateRmWeatherLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理上行消息数据 |
| | | * @param sv 服务 |
| | | * @param stPo 实体对象 |
| | | * @param msg 上行的订阅消息 |
| | | * @param stVo 上行的设备数据 |
| | | */ |
| | | private RmWeatherHistory saveHistory(DbSv sv, |
| | | PrStWeather stPo, |
| | | MqttSubMsg msg, |
| | | WeatherVo stVo) throws Exception { |
| | | RmWeatherHistory po = new RmWeatherHistory(); |
| | | po.valueFrom(msg, stVo); |
| | | po.weatherId = stPo.id ; |
| | | sv.saveRmWeatherHistory(po); |
| | | return po ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.rtuMw.server.rtuData.pSdV1; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.ProtocolConstantSdV1; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | |
| | | public void execute(Object data) { |
| | | //前面的任务已经判断了data不为空 |
| | | MqttSubMsg msg = (MqttSubMsg)data ; |
| | | log.info(msg.toString()); |
| | | if(msg.protocol.equals(ProtocolConstantSdV1.protocolName + ProtocolConstantSdV1.protocolVer)){ |
| | | //山东sd1协议 |
| | | this.toNextTasks(data); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.pSdV1; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.ManureVo; |
| | | import com.dy.common.springUtil.SpringContextUtil; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.rtuMw.server.ServerProperties; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 8:56 |
| | | * @Description |
| | | */ |
| | | public class TkPreGenObjs4ManureSdV1 extends TaskSurpport { |
| | | |
| | | private static Logger log = LogManager.getLogger(TkPreGenObjs4ManureSdV1.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkPreGenObjs4ManureSdV1" ; |
| | | |
| | | //处理上条数据的时刻 |
| | | private static final Map<String, Long> dealDataAtDateTime = new HashMap<>(); |
| | | |
| | | /** |
| | | * 执行节点任务 |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | //前面的任务已经判断了data不为空 |
| | | MqttSubMsg msg = (MqttSubMsg)data ; |
| | | if(msg.vo4Up != null && msg.vo4Up instanceof ManureVo){ |
| | | //水肥数据 |
| | | ManureVo stVo = (ManureVo)msg.vo4Up ; |
| | | Long lastAt = dealDataAtDateTime.get(msg.deviceId + stVo.no); |
| | | Long now = System.currentTimeMillis() ; |
| | | if(lastAt == null || ((now - lastAt) >= ServerProperties.mqttAcceptDataMinInterval)){ |
| | | dealDataAtDateTime.put(msg.deviceId + stVo.no, now); |
| | | DbSv sv = SpringContextUtil.getBean(DbSv.class) ; |
| | | if(sv != null){ |
| | | PrStManure stPo = sv.getStManureByFBoxIdAndNo(msg.deviceId, stVo.no) ; |
| | | if(stPo != null){ |
| | | this.taskResult = new Object[]{sv, stPo} ; |
| | | this.toNextTasks(data); |
| | | } |
| | | }else{ |
| | | log.error("严重错误,未能得到DbSv对象"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.pSdV1; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.SoilVo; |
| | | import com.dy.common.springUtil.SpringContextUtil; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.rtuMw.server.ServerProperties; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 11:25 |
| | | * @Description |
| | | */ |
| | | public class TkPreGenObjs4SoilSdV1 extends TaskSurpport { |
| | | |
| | | private static Logger log = LogManager.getLogger(TkPreGenObjs4SoilSdV1.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkPreGenObjs4SoilSdV1" ; |
| | | |
| | | //处理上条数据的时刻 |
| | | private static final Map<String, Long> dealDataAtDateTime = new HashMap<>(); |
| | | |
| | | /** |
| | | * 执行节点任务 |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | //前面的任务已经判断了data不为空 |
| | | MqttSubMsg msg = (MqttSubMsg)data ; |
| | | if(msg.vo4Up != null && msg.vo4Up instanceof SoilVo){ |
| | | //墒情数据 |
| | | SoilVo stVo = (SoilVo)msg.vo4Up ; |
| | | Long lastAt = dealDataAtDateTime.get(msg.deviceId + stVo.no); |
| | | Long now = System.currentTimeMillis() ; |
| | | if(lastAt == null || ((now - lastAt) >= ServerProperties.mqttAcceptDataMinInterval)) { |
| | | dealDataAtDateTime.put(msg.deviceId + stVo.no, now); |
| | | DbSv sv = SpringContextUtil.getBean(DbSv.class); |
| | | if (sv != null) { |
| | | PrStSoil stPo = sv.getStSoilByFBoxIdAndNo(msg.deviceId, stVo.no); |
| | | if (stPo != null) { |
| | | this.taskResult = new Object[]{sv, stPo}; |
| | | this.toNextTasks(data); |
| | | } |
| | | } else { |
| | | log.error("严重错误,未能得到DbSv对象"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.pSdV1; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.common.mw.protocol4Mqtt.pSdV1.upVos.WeatherVo; |
| | | import com.dy.common.springUtil.SpringContextUtil; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.rtuMw.server.ServerProperties; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/25 11:25 |
| | | * @Description |
| | | */ |
| | | public class TkPreGenObjs4WeatherSdV1 extends TaskSurpport { |
| | | |
| | | private static Logger log = LogManager.getLogger(TkPreGenObjs4WeatherSdV1.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkPreGenObjs4WeatherSdV1" ; |
| | | |
| | | //处理上条数据的时刻 |
| | | private static final Map<String, Long> dealDataAtDateTime = new HashMap<>(); |
| | | |
| | | /** |
| | | * 执行节点任务 |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | //前面的任务已经判断了data不为空 |
| | | MqttSubMsg msg = (MqttSubMsg)data ; |
| | | if(msg.vo4Up != null && msg.vo4Up instanceof WeatherVo){ |
| | | //气象数据 |
| | | WeatherVo stVo = (WeatherVo)msg.vo4Up ; |
| | | Long lastAt = dealDataAtDateTime.get(msg.deviceId + stVo.no); |
| | | Long now = System.currentTimeMillis() ; |
| | | if(lastAt == null || ((now - lastAt) >= ServerProperties.mqttAcceptDataMinInterval)) { |
| | | dealDataAtDateTime.put(msg.deviceId + stVo.no, now); |
| | | DbSv sv = SpringContextUtil.getBean(DbSv.class); |
| | | if (sv != null) { |
| | | PrStWeather stPo = sv.getStWeatherByFBoxIdAndNo(msg.deviceId, stVo.no); |
| | | if (stPo != null) { |
| | | this.taskResult = new Object[]{sv, stPo}; |
| | | this.toNextTasks(data); |
| | | } |
| | | } else { |
| | | log.error("严重错误,未能得到DbSv对象"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </task> |
| | | <!-- Mqtt消息中间件订阅的消息 --> |
| | | <task id="TkMqttData" name="接收Mqtt消息" enable="true" class="com.dy.rtuMw.server.rtuData.TkMqttData"> |
| | | <task id="TkFindPSdV1" name="识别山东V1数据" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkFindPSdV1"></task> |
| | | <task id="TkFindPSdV1" name="识别山东V1数据" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkFindPSdV1"> |
| | | <task id="TkPreGenObjs4ManureSdV1" name="为处理水肥机数据预先准备各对象" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkPreGenObjs4ManureSdV1"> |
| | | <task id="TkDealManureSdV1" name="处理水肥数据" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkDealManureSdV1"> |
| | | </task> |
| | | </task> |
| | | <task id="TkPreGenObjs4WeatherSdV1" name="为处理气象数据预先准备各对象" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkPreGenObjs4WeatherSdV1"> |
| | | <task id="TkDealWeatherSdV1" name="处理气象数据" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkDealWeatherSdV1"> |
| | | </task> |
| | | </task> |
| | | <task id="TkPreGenObjs4SoilSdV1" name="为处理墒情数据预先准备各对象" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkPreGenObjs4SoilSdV1"> |
| | | <task id="TkDealSoilSdV1" name="处理墒情数据" enable="true" class="com.dy.rtuMw.server.rtuData.pSdV1.TkDealSoilSdV1"> |
| | | </task> |
| | | </task> |
| | | </task> |
| | | </task> |
| | | </task> |
| | | </project> |
| | |
| | | sendInterval 命令发送间隔(单位秒),取值范围是1~3600 |
| | | reSendTimesByNoResult 未收到命令结果时,最大重复发送次数,取值范围是0~100, 0时表示不重复发送 |
| | | comCacheTimeout: 命令最大缓存时长(秒),取值范围是1~3600 |
| | | acceptDataMinInterval:因为上行数据密度较大(如10秒上行一条数据),数据处理与存储压力大,所以最小间隔一定时间(分钟)真正接收处理一条上行数据 |
| | | useMemoryPersistence 使用内存持久化而非默认的文件持久化(true是 false否) |
| | | protocolAndDeviceIds 在子系统(orgTag)中接入的设备(FBox)所用协议及设备id集合,多个用逗号隔开,协议与ID用正斜杠隔开,例如:sd1/338220031439,sd1/338220031440 |
| | | subTopicAndQos: 订阅主题与Qos,主题名与其Qos用逗号隔开,多个主题及Qos用分号隔开,例如:ym/topic1,1;ym/topic2,1;ym/topic3,1,如果有多个OrgTag,主题前缀用其OrgTag |
| | |
| | | sendInterval="60" |
| | | reSendTimesByNoResult="0" |
| | | comCacheTimeout="30" |
| | | acceptDataMinInterval="60" |
| | | useMemoryPersistence="true" |
| | | protocolAndDeviceIds="${mqtt.protocolAndDeviceIds}" |
| | | subTopicAndQos="${mqtt.subTopicAndQos}" |