Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
Conflicts:
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml
| | |
| | | public Double waterPress; //水压:4字节BCD码,取值范围0~999999.99,单位为KPa。 |
| | | public Double batteryVolt;//蓄电池电压:4字节BCD码,取值范围0~99.99,单位为V。 |
| | | public Double sunVolt ;//太阳能电压:4字节BCD码,取值范围0~99.99,单位为V。 |
| | | public Integer signal; //信号强度:1字节BCD码,取值范围0~99。 |
| | | public Integer signalValue; //信号强度:1字节BCD码,取值范围0~99。 |
| | | public String rtuDt ;//控制器时钟 |
| | | public DataAlarmVo alarmVo ;//报警 |
| | | public DataStateVo stateVo ;//状态 |
| | |
| | | sb.append(sunVolt==null?"":sunVolt); |
| | | sb.append("\n"); |
| | | sb.append(" 信号强度:"); |
| | | sb.append(signal==null?"":signal); |
| | | sb.append(signalValue ==null?"": signalValue); |
| | | sb.append("\n"); |
| | | sb.append(" 控制器时钟:"); |
| | | sb.append(rtuDt==null?"":rtuDt); |
| | |
| | | |
| | | @Data |
| | | public class DataStateVo { |
| | | public Byte idCard ;// 蓄电池电压 |
| | | public Byte work;//工作状态 |
| | | public Byte icCard;// IC卡功能 |
| | | public Byte working;//工作状态 |
| | | public Byte valve ;//阀门 |
| | | |
| | | public String toString(){ |
| | | StringBuilder str = new StringBuilder() ; |
| | | str.append(" 状态:\n"); |
| | | str.append(" IC 卡功能:"); |
| | | str.append(idCard==null?"":(idCard==1?"有效":"无效")); |
| | | str.append(icCard ==null?"":(icCard ==1?"有效":"无效")); |
| | | str.append("\n"); |
| | | str.append(" 工作状态:"); |
| | | str.append(work ==null?"":(work==1?"启动":"停止")); |
| | | str.append(working ==null?"":(working ==1?"启动":"停止")); |
| | | str.append("\n"); |
| | | str.append(" 阀门:"); |
| | | str.append(" 阀门状态:"); |
| | | str.append(valve==null?"":(valve==1?"打开":"关闭")); |
| | | return str.toString() ; |
| | | } |
| | |
| | | } |
| | | if(hasSignal){ |
| | | //信号强度:1字节BCD码,取值范围0~99。 |
| | | cdData.signal = 0 ; |
| | | cdData.signalValue = 0 ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.signal += tpInt ; |
| | | cdData.signalValue += tpInt ; |
| | | } |
| | | if(hasAlarmStatus){ |
| | | //报警数据 |
| | |
| | | DataStateVo avo = new DataStateVo() ; |
| | | byte b = bs[index] ; |
| | | index++ ; |
| | | avo.idCard = (byte)(b & 0x4) ; |
| | | avo.work = (byte)(b & 0x8) ; |
| | | avo.icCard = (byte)(b & 0x4) ; |
| | | avo.working = (byte)(b & 0x8) ; |
| | | avo.valve = (byte)(b & 0x20) ; |
| | | return avo ; |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.voPr.VoController; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.security.access.method.P; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | List<PrController> getControllersByRtuAddr(@Param("rtuAddr") String rtuAddr); |
| | | |
| | | /** |
| | | * 根据控制器编号获取控制器列表 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | List<PrController> getControllersByRtuAddr(@Param("rtuAddr") String rtuAddr); |
| | | |
| | | /** |
| | | * 根据控制器编号逻辑删除控制 |
| | | * @param controllerId |
| | | * @return |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 11:18 |
| | | * @LastEditTime 2024/1/16 11:18 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmAlarmStateHistoryMapper extends BaseMapper<RmAlarmStateHistory> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmAlarmStateHistory record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmAlarmStateHistory record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmAlarmStateHistory selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmAlarmStateHistory record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmAlarmStateHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 11:18 |
| | | * @LastEditTime 2024/1/16 11:18 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmAlarmStateLastMapper extends BaseMapper<RmAlarmStateLast> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmAlarmStateLast record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmAlarmStateLast record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmAlarmStateLast selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * @param rtuAddr rtuAddr |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmAlarmStateLast> selectByRtuAddr(String rtuAddr); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmAlarmStateLast record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmAlarmStateLast record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 14:59 |
| | | * @LastEditTime 2024/1/16 14:59 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmAutoReportHistoryMapper extends BaseMapper<RmAutoReportHistory> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmAutoReportHistory record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmAutoReportHistory record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmAutoReportHistory selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmAutoReportHistory record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmAutoReportHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 14:45 |
| | | * @LastEditTime 2024/1/16 14:45 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmAutoReportLastMapper extends BaseMapper<RmAutoReportLast> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmAutoReportLast record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmAutoReportLast record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmAutoReportLast selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * @param rtuAddr rtuAddr |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmAutoReportLast> selectByRtuAddr(String rtuAddr); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmAutoReportLast record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmAutoReportLast record); |
| | | } |
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.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 2024/1/16 11:03 |
| | | * @LastEditTime 2024/1/16 11:03 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 控制器报警与状态(历史) |
| | | */ |
| | | @TableName(value="rm_alarm_state_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器报警与状态(历史)") |
| | | public class RmAlarmStateHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161104001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @Schema(description = "控制器实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerid; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | public String rtuaddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @Schema(description = "上报日期时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 报警-蓄电池电压(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte bateryvolt; |
| | | |
| | | /** |
| | | * 报警-漏损(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte loss; |
| | | |
| | | /** |
| | | * 报警-仪表(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte meter; |
| | | |
| | | /** |
| | | * 报警-阀门(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-阀门(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valve; |
| | | |
| | | /** |
| | | * 状态-IC卡功能(1有效、0无效) |
| | | */ |
| | | @Schema(description = "状态-IC卡功能(1有效、0无效)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte iccard; |
| | | |
| | | /** |
| | | * 状态-工作(1启动、0停止) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte working; |
| | | |
| | | /** |
| | | * 状态-阀门(1打开、0关闭) |
| | | */ |
| | | @Schema(description = "状态-阀门(1打开、0关闭)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valvestate; |
| | | |
| | | } |
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.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 2024/1/16 10:39 |
| | | * @LastEditTime 2024/1/16 10:39 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 控制器报警与状态(最新) |
| | | */ |
| | | @TableName(value="rm_alarm_state_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器报警与状态(最新)") |
| | | public class RmAlarmStateLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161041001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @Schema(description = "控制器实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerid; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | public String rtuaddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @Schema(description = "上报日期时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 报警-蓄电池电压(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte bateryvolt; |
| | | |
| | | /** |
| | | * 报警-漏损(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte loss; |
| | | |
| | | /** |
| | | * 报警-仪表(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte meter; |
| | | |
| | | /** |
| | | * 报警-阀门(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-阀门(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valve; |
| | | |
| | | /** |
| | | * 状态-IC卡功能(1有效、0无效) |
| | | */ |
| | | @Schema(description = "状态-IC卡功能(1有效、0无效)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte iccard; |
| | | |
| | | /** |
| | | * 状态-工作(1启动、0停止) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte working; |
| | | |
| | | /** |
| | | * 状态-阀门(1打开、0关闭) |
| | | */ |
| | | @Schema(description = "状态-阀门(1打开、0关闭)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valvestate; |
| | | |
| | | |
| | | |
| | | } |
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.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 2024/1/16 14:59 |
| | | * @LastEditTime 2024/1/16 14:59 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 终端自报(最新) |
| | | */ |
| | | @TableName(value="rm_alarm_state_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器自报(历史)") |
| | | public class RmAutoReportHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161501001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @Schema(description = "控制器实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerid; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | public String rtuaddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @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(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date rtudt; |
| | | |
| | | /** |
| | | * 瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h |
| | | */ |
| | | @Schema(description = "瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double instantamount; |
| | | |
| | | /** |
| | | * 累计流量:5字节BCD码,取值范围0~9999999999,单位为m3 |
| | | */ |
| | | @Schema(description = "累计流量:5字节BCD码,取值范围0~9999999999,单位为m3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double totalamount; |
| | | |
| | | /** |
| | | * 损失流量:5字节BCD码,取值范围0~9999999999,单位为m3 |
| | | */ |
| | | @Schema(description = "损失流量:5字节BCD码,取值范围0~9999999999,单位为m3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double lossamount; |
| | | |
| | | /** |
| | | * 水压:4字节BCD码,取值范围0~999999.99,单位为KPa |
| | | */ |
| | | @Schema(description = "水压:4字节BCD码,取值范围0~999999.99,单位为KPa", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double waterpress; |
| | | |
| | | /** |
| | | * 蓄电池电压:4字节BCD码,取值范围0~99.99,单位为V |
| | | */ |
| | | @Schema(description = "蓄电池电压:4字节BCD码,取值范围0~99.99,单位为V", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double batteryvolt; |
| | | |
| | | /** |
| | | * 太阳能电压:4字节BCD码,取值范围0~99.99,单位为V |
| | | */ |
| | | @Schema(description = "太阳能电压:4字节BCD码,取值范围0~99.99,单位为V", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double sunvolt; |
| | | |
| | | /** |
| | | * 信号强度:1字节BCD码,取值范围0~99 |
| | | */ |
| | | @Schema(description = "信号强度:1字节BCD码,取值范围0~99", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer signalvalue; |
| | | |
| | | } |
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.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 2024/1/16 14:45 |
| | | * @LastEditTime 2024/1/16 14:45 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 终端自报(最新) |
| | | */ |
| | | |
| | | @TableName(value="rm_alarm_state_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器自报(最新)") |
| | | public class RmAutoReportLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161446001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @Schema(description = "控制器实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerid; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | public String rtuaddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @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(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date rtudt; |
| | | |
| | | /** |
| | | * 瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h |
| | | */ |
| | | @Schema(description = "瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double instantamount; |
| | | |
| | | /** |
| | | * 累计流量:5字节BCD码,取值范围0~9999999999,单位为m3 |
| | | */ |
| | | @Schema(description = "累计流量:5字节BCD码,取值范围0~9999999999,单位为m3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double totalamount; |
| | | |
| | | /** |
| | | * 损失流量:5字节BCD码,取值范围0~9999999999,单位为m3 |
| | | */ |
| | | @Schema(description = "损失流量:5字节BCD码,取值范围0~9999999999,单位为m3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double lossamount; |
| | | |
| | | /** |
| | | * 水压:4字节BCD码,取值范围0~999999.99,单位为KPa |
| | | */ |
| | | @Schema(description = "水压:4字节BCD码,取值范围0~999999.99,单位为KPa", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double waterpress; |
| | | |
| | | /** |
| | | * 蓄电池电压:4字节BCD码,取值范围0~99.99,单位为V |
| | | */ |
| | | @Schema(description = "蓄电池电压:4字节BCD码,取值范围0~99.99,单位为V", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double batteryvolt; |
| | | |
| | | /** |
| | | * 太阳能电压:4字节BCD码,取值范围0~99.99,单位为V |
| | | */ |
| | | @Schema(description = "太阳能电压:4字节BCD码,取值范围0~99.99,单位为V", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double sunvolt; |
| | | |
| | | /** |
| | | * 信号强度:1字节BCD码,取值范围0~99 |
| | | */ |
| | | @Schema(description = "信号强度:1字节BCD码,取值范围0~99", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer signalvalue; |
| | | |
| | | } |
| | |
| | | <!--@mbg.generated--> |
| | | id, intakeId, rtuAddr, protocol, findDt, addWays, `operator`, operateDt, deleted |
| | | </sql> |
| | | <sql id="Part_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, rtuAddr |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_controller (id, intakeId, rtuAddr, |
| | | protocol, findDt, addWays, |
| | | insert into pr_controller (id, intakeId, rtuAddr, |
| | | protocol, findDt, addWays, |
| | | `operator`, operateDt, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, |
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.RmAlarmStateHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_alarm_state_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controllerId" jdbcType="BIGINT" property="controllerid" /> |
| | | <result column="intakeId" jdbcType="BIGINT" property="intakeid" /> |
| | | <result column="rtuAddr" jdbcType="VARCHAR" property="rtuaddr" /> |
| | | <result column="dt" jdbcType="DATE" property="dt" /> |
| | | <result column="bateryVolt" jdbcType="TINYINT" property="bateryvolt" /> |
| | | <result column="loss" jdbcType="TINYINT" property="loss" /> |
| | | <result column="meter" jdbcType="TINYINT" property="meter" /> |
| | | <result column="valve" jdbcType="TINYINT" property="valve" /> |
| | | <result column="icCard" jdbcType="TINYINT" property="iccard" /> |
| | | <result column="working" jdbcType="TINYINT" property="working" /> |
| | | <result column="valveState" jdbcType="TINYINT" property="valvestate" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_alarm_state_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_alarm_state_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_history (id, controllerId, intakeId, |
| | | rtuAddr, dt, bateryVolt, |
| | | loss, meter, valve, |
| | | icCard, working, valveState |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{loss,jdbcType=TINYINT}, #{meter,jdbcType=TINYINT}, #{valve,jdbcType=TINYINT}, |
| | | #{iccard,jdbcType=TINYINT}, #{working,jdbcType=TINYINT}, #{valvestate,jdbcType=TINYINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard, |
| | | </if> |
| | | <if test="working != null"> |
| | | working, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | #{loss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | #{meter,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | #{valve,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | #{iccard,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | #{working,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | #{valvestate,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_history |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | working = #{working,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState = #{valvestate,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_history |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | working = #{working,jdbcType=TINYINT}, |
| | | valveState = #{valvestate,jdbcType=TINYINT} |
| | | 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.RmAlarmStateLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_alarm_state_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controllerId" jdbcType="BIGINT" property="controllerid" /> |
| | | <result column="intakeId" jdbcType="BIGINT" property="intakeid" /> |
| | | <result column="rtuAddr" jdbcType="VARCHAR" property="rtuaddr" /> |
| | | <result column="dt" jdbcType="DATE" property="dt" /> |
| | | <result column="bateryVolt" jdbcType="TINYINT" property="bateryvolt" /> |
| | | <result column="loss" jdbcType="TINYINT" property="loss" /> |
| | | <result column="meter" jdbcType="TINYINT" property="meter" /> |
| | | <result column="valve" jdbcType="TINYINT" property="valve" /> |
| | | <result column="icCard" jdbcType="TINYINT" property="iccard" /> |
| | | <result column="working" jdbcType="TINYINT" property="working" /> |
| | | <result column="valveState" jdbcType="TINYINT" property="valvestate" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_alarm_state_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByRtuAddr" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_alarm_state_last |
| | | where rtuAddr = #{rtuAddr,jdbcType=VARCHAR} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_alarm_state_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_last (id, controllerId, intakeId, |
| | | rtuAddr, dt, bateryVolt, |
| | | loss, meter, valve, |
| | | icCard, working, valveState |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{loss,jdbcType=TINYINT}, #{meter,jdbcType=TINYINT}, #{valve,jdbcType=TINYINT}, |
| | | #{iccard,jdbcType=TINYINT}, #{working,jdbcType=TINYINT}, #{valvestate,jdbcType=TINYINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard, |
| | | </if> |
| | | <if test="working != null"> |
| | | working, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | #{loss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | #{meter,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | #{valve,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | #{iccard,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | #{working,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | #{valvestate,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_last |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | working = #{working,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState = #{valvestate,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_last |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | working = #{working,jdbcType=TINYINT}, |
| | | valveState = #{valvestate,jdbcType=TINYINT} |
| | | 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.RmAutoReportHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_auto_report_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controllerId" jdbcType="BIGINT" property="controllerid" /> |
| | | <result column="intakeId" jdbcType="BIGINT" property="intakeid" /> |
| | | <result column="rtuAddr" jdbcType="VARCHAR" property="rtuaddr" /> |
| | | <result column="dt" jdbcType="DATE" property="dt" /> |
| | | <result column="rtuDt" jdbcType="DATE" property="rtudt" /> |
| | | <result column="instantAmount" jdbcType="DOUBLE" property="instantamount" /> |
| | | <result column="totalAmount" jdbcType="DOUBLE" property="totalamount" /> |
| | | <result column="lossAmount" jdbcType="DOUBLE" property="lossamount" /> |
| | | <result column="waterPress" jdbcType="DOUBLE" property="waterpress" /> |
| | | <result column="batteryVolt" jdbcType="DOUBLE" property="batteryvolt" /> |
| | | <result column="sunVolt" jdbcType="DOUBLE" property="sunvolt" /> |
| | | <result column="signalValue" jdbcType="INTEGER" property="signalvalue" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, instantAmount, totalAmount, lossAmount, |
| | | waterPress, batteryVolt, sunVolt, signalValue |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_auto_report_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_auto_report_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_auto_report_history (id, controllerId, intakeId, |
| | | rtuAddr, dt, rtuDt, instantAmount, |
| | | totalAmount, lossAmount, waterPress, |
| | | batteryVolt, sunVolt, signalValue |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{rtudt,jdbcType=DATE}, #{instantamount,jdbcType=DOUBLE}, |
| | | #{totalamount,jdbcType=DOUBLE}, #{lossamount,jdbcType=DOUBLE}, #{waterpress,jdbcType=DOUBLE}, |
| | | #{batteryvolt,jdbcType=DOUBLE}, #{sunvolt,jdbcType=DOUBLE}, #{signalvalue,jdbcType=INTEGER} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_auto_report_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | instantAmount, |
| | | </if> |
| | | <if test="totalamount != null"> |
| | | totalAmount, |
| | | </if> |
| | | <if test="lossamount != null"> |
| | | lossAmount, |
| | | </if> |
| | | <if test="waterpress != null"> |
| | | waterPress, |
| | | </if> |
| | | <if test="batteryvolt != null"> |
| | | batteryVolt, |
| | | </if> |
| | | <if test="sunvolt != null"> |
| | | sunVolt, |
| | | </if> |
| | | <if test="signalvalue != null"> |
| | | signalValue, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | #{instantamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="totalamount != null"> |
| | | #{totalamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="lossamount != null"> |
| | | #{lossamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="waterpress != null"> |
| | | #{waterpress,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="batteryvolt != null"> |
| | | #{batteryvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="sunvolt != null"> |
| | | #{sunvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="signalvalue != null"> |
| | | #{signalvalue,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_auto_report_history |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="totalamount != null"> |
| | | totalAmount = #{totalamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="lossamount != null"> |
| | | lossAmount = #{lossamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="waterpress != null"> |
| | | waterPress = #{waterpress,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="batteryvolt != null"> |
| | | batteryVolt = #{batteryvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="sunvolt != null"> |
| | | sunVolt = #{sunvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="signalvalue != null"> |
| | | signalValue = #{signalvalue,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_auto_report_history |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | | totalAmount = #{totalamount,jdbcType=DOUBLE}, |
| | | lossAmount = #{lossamount,jdbcType=DOUBLE}, |
| | | waterPress = #{waterpress,jdbcType=DOUBLE}, |
| | | batteryVolt = #{batteryvolt,jdbcType=DOUBLE}, |
| | | sunVolt = #{sunvolt,jdbcType=DOUBLE}, |
| | | signalValue = #{signalvalue,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.RmAutoReportLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_auto_report_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controllerId" jdbcType="BIGINT" property="controllerid" /> |
| | | <result column="intakeId" jdbcType="BIGINT" property="intakeid" /> |
| | | <result column="rtuAddr" jdbcType="VARCHAR" property="rtuaddr" /> |
| | | <result column="dt" jdbcType="DATE" property="dt" /> |
| | | <result column="rtuDt" jdbcType="DATE" property="rtudt" /> |
| | | <result column="instantAmount" jdbcType="DOUBLE" property="instantamount" /> |
| | | <result column="totalAmount" jdbcType="DOUBLE" property="totalamount" /> |
| | | <result column="lossAmount" jdbcType="DOUBLE" property="lossamount" /> |
| | | <result column="waterPress" jdbcType="DOUBLE" property="waterpress" /> |
| | | <result column="batteryVolt" jdbcType="DOUBLE" property="batteryvolt" /> |
| | | <result column="sunVolt" jdbcType="DOUBLE" property="sunvolt" /> |
| | | <result column="signalValue" jdbcType="INTEGER" property="signalvalue" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, instantAmount, totalAmount, lossAmount, |
| | | waterPress, batteryVolt, sunVolt, signalValue |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_auto_report_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByRtuAddr" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_auto_report_last |
| | | where rtuAddr = #{rtuAddr,jdbcType=VARCHAR} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_auto_report_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_auto_report_last (id, controllerId, intakeId, |
| | | rtuAddr, dt, rtuDt, instantAmount, |
| | | totalAmount, lossAmount, waterPress, |
| | | batteryVolt, sunVolt, signalValue |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{rtudt,jdbcType=DATE}, #{instantamount,jdbcType=DOUBLE}, |
| | | #{totalamount,jdbcType=DOUBLE}, #{lossamount,jdbcType=DOUBLE}, #{waterpress,jdbcType=DOUBLE}, |
| | | #{batteryvolt,jdbcType=DOUBLE}, #{sunvolt,jdbcType=DOUBLE}, #{signalvalue,jdbcType=INTEGER} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_auto_report_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | instantAmount, |
| | | </if> |
| | | <if test="totalamount != null"> |
| | | totalAmount, |
| | | </if> |
| | | <if test="lossamount != null"> |
| | | lossAmount, |
| | | </if> |
| | | <if test="waterpress != null"> |
| | | waterPress, |
| | | </if> |
| | | <if test="batteryvolt != null"> |
| | | batteryVolt, |
| | | </if> |
| | | <if test="sunvolt != null"> |
| | | sunVolt, |
| | | </if> |
| | | <if test="signalvalue != null"> |
| | | signalValue, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | #{instantamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="totalamount != null"> |
| | | #{totalamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="lossamount != null"> |
| | | #{lossamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="waterpress != null"> |
| | | #{waterpress,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="batteryvolt != null"> |
| | | #{batteryvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="sunvolt != null"> |
| | | #{sunvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="signalvalue != null"> |
| | | #{signalvalue,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_auto_report_last |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="totalamount != null"> |
| | | totalAmount = #{totalamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="lossamount != null"> |
| | | lossAmount = #{lossamount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="waterpress != null"> |
| | | waterPress = #{waterpress,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="batteryvolt != null"> |
| | | batteryVolt = #{batteryvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="sunvolt != null"> |
| | | sunVolt = #{sunvolt,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="signalvalue != null"> |
| | | signalValue = #{signalvalue,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_auto_report_last |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | | totalAmount = #{totalamount,jdbcType=DOUBLE}, |
| | | lossAmount = #{lossamount,jdbcType=DOUBLE}, |
| | | waterPress = #{waterpress,jdbcType=DOUBLE}, |
| | | batteryVolt = #{batteryvolt,jdbcType=DOUBLE}, |
| | | sunVolt = #{sunvolt,jdbcType=DOUBLE}, |
| | | signalValue = #{signalvalue,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | * 多线程环境下运行 |
| | | * @return |
| | | */ |
| | | public static synchronized TaskSurpport popTask(){ |
| | | TaskSurpport t = (tasks.size() > 0)?tasks.get(0):null ; |
| | | if(t != null){ |
| | | tasks.remove(0) ; |
| | | }else{ |
| | | try { |
| | | t = newTaskTree() ; |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage() == null?"实例化上行数据处理任务对象树失败!" : e.getMessage(), e); |
| | | } finally { |
| | | if(t == null){ |
| | | log.error("实例化上行数据处理任务对象失败!" ); |
| | | public static TaskSurpport popTask(){ |
| | | synchronized(tasks){ |
| | | TaskSurpport t = (tasks.size() > 0)?tasks.get(0):null ; |
| | | if(t != null){ |
| | | tasks.remove(0) ; |
| | | }else{ |
| | | try { |
| | | t = newTaskTree() ; |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage() == null?"实例化上行数据处理任务对象树失败!" : e.getMessage(), e); |
| | | } finally { |
| | | if(t == null){ |
| | | log.error("实例化上行数据处理任务对象失败!" ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return t ; |
| | | } |
| | | |
| | | return t ; |
| | | } |
| | | |
| | | /** |
| | |
| | | * 这里需要同步锁,因为上面方法中执行完tasks.get(0)且未执行tasks.remove(0)期间,本方法执行并且执行完,那么后期就会出乱子 |
| | | * @param t |
| | | */ |
| | | public static synchronized void freeAndCleanTask(TaskSurpport t){ |
| | | if(t != null){ |
| | | boolean find = false ; |
| | | for(TaskSurpport tin : tasks){ |
| | | if(tin == t){ |
| | | find = true ; |
| | | break ; |
| | | public static void freeAndCleanTask(TaskSurpport t){ |
| | | synchronized(tasks) { |
| | | if (t != null) { |
| | | boolean find = false; |
| | | for (TaskSurpport tin : tasks) { |
| | | if (tin == t) { |
| | | find = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if(!find){ |
| | | t.cleanMeAndSubs(); |
| | | tasks.add(0, t) ; |
| | | if (!find) { |
| | | t.cleanMeAndSubs(); |
| | | tasks.add(0, t); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | private static final Logger log = LogManager.getLogger(TaskSurpport.class.getName()) ; |
| | | |
| | | //当前所处理的上行数据所属RTU的地址 |
| | | public String rtuAddr_inRootTk ;//只在根root任务对象上会付此值 |
| | | //public String rtuAddr_inRootTk ;//只在根root任务对象上会付此值 |
| | | //本节点配置 |
| | | protected TaskConfig conf ; |
| | | //根任务 |
| | |
| | | */ |
| | | @Override |
| | | public void cleanMeAndSubs() { |
| | | rtuAddr_inRootTk = null ; |
| | | //rtuAddr_inRootTk = null ; |
| | | taskResult = null ; |
| | | if(this.subTasks != null && this.subTasks.length > 0){ |
| | | for(int i = 0 ; i < this.subTasks.length; i++){ |
| | |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerTrampMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAlarmStateHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAlarmStateLastMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAutoReportHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAutoReportLastMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | private PrControllerTrampMapper prControllerTrampMapperDao;//流浪控制器DAO |
| | | @Autowired |
| | | private PrControllerMapper prControllerMapperDao ;//控制器DAO |
| | | @Autowired |
| | | private RmAlarmStateLastMapper rmAlarmStateLastMapperDao ;//控制器最新报警和状态DAO |
| | | @Autowired |
| | | private RmAlarmStateHistoryMapper rmAlarmStateHistoryMapperDao ;//控制器历史报警和状态DAO |
| | | @Autowired |
| | | private RmAutoReportLastMapper rmAutoReportLastMapperDao ;//控制器最新上报数据DAO |
| | | @Autowired |
| | | private RmAutoReportHistoryMapper rmAutoReportHistoryMapperDao ;//控制器历史上报数据DAO |
| | | |
| | | @Autowired |
| | | @Lazy |
| | |
| | | * @return 控制器 |
| | | */ |
| | | public PrController getPrControllerByRtuAddr(String rtuAddr){ |
| | | List<PrController> list = this.prControllerMapperDao.selectPrControllerByRtuAddr(rtuAddr) ; |
| | | List<PrController> list = this.prControllerMapperDao.getControllersByRtuAddr(rtuAddr) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | |
| | | * @return 流浪控制器 |
| | | */ |
| | | public PrControllerTramp getPrControllerTrampByRtuAddr(String rtuAddr){ |
| | | List<PrControllerTramp> list = this.prControllerTrampMapperDao.selectPrControllerTrampByRtuAddr(rtuAddr) ; |
| | | List<PrControllerTramp> list = this.prControllerTrampMapperDao.getPrControllerTrampByRtuAddr(rtuAddr) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存流浪控制器 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void savePrConctrollerTramp(PrControllerTramp po){ |
| | | this.prControllerTrampMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 得到控制器报警与状态最新记录 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | public RmAlarmStateLast getRmLastAlarmState(String rtuAddr){ |
| | | List<RmAlarmStateLast> list = rmAlarmStateLastMapperDao.selectByRtuAddr(rtuAddr) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存控制器报警与状态最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmAlarmStateLast(RmAlarmStateLast po){ |
| | | this.rmAlarmStateLastMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器报警与状态历史记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmAlarmStateHistory(RmAlarmStateHistory po){ |
| | | this.rmAlarmStateHistoryMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 得到控制器上报数据最新记录 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | public RmAutoReportLast getRmLastAutoReport(String rtuAddr){ |
| | | List<RmAutoReportLast> list = rmAutoReportLastMapperDao.selectByRtuAddr(rtuAddr) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存控制器上报数据最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmAutoReportLast(RmAutoReportLast po){ |
| | | this.rmAutoReportLastMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器上报数据历史记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmAutoReportHistory(RmAutoReportHistory po){ |
| | | this.rmAutoReportHistoryMapperDao.insert(po) ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.aceMw.server.rtuData.p206V1_0_0; |
| | | |
| | | import com.dy.aceMw.server.rtuData.TaskSurpport; |
| | | import com.dy.aceMw.server.rtuData.dbSv.DbSv; |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataAlarmVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataStateVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/15 21:59 |
| | | * @LastEditTime 2024/1/15 21:59 |
| | | * @Description |
| | | */ |
| | | public class TkDealAlarmStatus extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealAlarmStatus.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealAlarmStatus" ; |
| | | |
| | | /** |
| | | * 执行节点任务:报警及状态 |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data)data ; |
| | | Object subD = d.getSubData() ; |
| | | if(subD != null){ |
| | | DataV1_0_1 dV1_0_1 = (DataV1_0_1)subD ; |
| | | if(dV1_0_1 != null){ |
| | | //dV1_0_1.dataCd81Vo 与 dV1_0_1.dataCdC0Vo 不会同时有值 |
| | | if(dV1_0_1.dataCd81Vo != null){ |
| | | if(dV1_0_1.dataCd81Vo.alarmVo != null || dV1_0_1.dataCd81Vo.stateVo != null){ |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), dV1_0_1.dataCd81Vo.alarmVo, dV1_0_1.dataCd81Vo.stateVo) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), dV1_0_1.dataCd81Vo.alarmVo, dV1_0_1.dataCd81Vo.stateVo) ; |
| | | } |
| | | } else if(dV1_0_1.dataCdC0Vo != null){ |
| | | if(dV1_0_1.dataCdC0Vo.alarmVo != null || dV1_0_1.dataCdC0Vo.stateVo != null){ |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), dV1_0_1.dataCdC0Vo.alarmVo, dV1_0_1.dataCdC0Vo.stateVo) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), dV1_0_1.dataCdC0Vo.alarmVo, dV1_0_1.dataCdC0Vo.stateVo) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 保存报警状态最新数据 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param alarmVo 报警对象 |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, DataAlarmVo alarmVo, DataStateVo stateVo){ |
| | | RmAlarmStateLast po = sv.getRmLastAlarmState(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmAlarmStateLast(null, controller.getId(), controller.getId(), |
| | | rtuAddr, |
| | | new Date(), |
| | | alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | sv.saveRmAlarmStateLast(po) ; |
| | | }else{ |
| | | po = this.update(po, alarmVo, stateVo) ; |
| | | sv.saveRmAlarmStateLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存报警状态历史记录 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param alarmVo 报警对象 |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataAlarmVo alarmVo, DataStateVo stateVo){ |
| | | RmAlarmStateHistory po = new RmAlarmStateHistory(null, controller.getId(), controller.getId(), |
| | | rtuAddr, |
| | | new Date(), |
| | | alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | sv.saveRmAlarmStateHistory(po) ; |
| | | } |
| | | |
| | | |
| | | private RmAlarmStateLast update(RmAlarmStateLast po, DataAlarmVo alarmVo, DataStateVo stateVo){ |
| | | po.dt = new Date() ; |
| | | if(alarmVo != null){ |
| | | po.bateryvolt = alarmVo.batteryVolt ; |
| | | po.loss = alarmVo.loss ; |
| | | po.meter = alarmVo.meter ; |
| | | po.valve = alarmVo.valve ; |
| | | }else{ |
| | | po.bateryvolt = null ; |
| | | po.loss = null ; |
| | | po.meter = null ; |
| | | po.valve = null ; |
| | | } |
| | | if(stateVo != null){ |
| | | po.iccard = stateVo.icCard ; |
| | | po.working = stateVo.working ; |
| | | po.valvestate = stateVo.valve ; |
| | | }else{ |
| | | po.iccard = null ; |
| | | po.working = null ; |
| | | po.valvestate = null ; |
| | | } |
| | | return po ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.aceMw.server.rtuData.p206V1_0_0; |
| | | |
| | | import com.dy.aceMw.server.rtuData.TaskSurpport; |
| | | import com.dy.aceMw.server.rtuData.dbSv.DbSv; |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataCdC0Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1; |
| | | import com.dy.common.util.DateTime; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAutoReportHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAutoReportLast; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 14:11 |
| | | * @LastEditTime 2024/1/16 14:11 |
| | | * @Description |
| | | */ |
| | | public class TkDealAutoReport extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealAlarmStatus.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealAlarmStatus" ; |
| | | |
| | | /** |
| | | * 执行节点任务:控制器自报数据(功能码为C0) |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data) data; |
| | | Object subD = d.getSubData(); |
| | | if (subD != null) { |
| | | DataV1_0_1 dV1_0_1 = (DataV1_0_1) subD; |
| | | if (dV1_0_1 != null && dV1_0_1.dataCdC0Vo != null) { |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | try{ |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), dV1_0_1.dataCdC0Vo) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), dV1_0_1.dataCdC0Vo) ; |
| | | }catch (Exception e){ |
| | | log.error("保存控制器自报数据时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 保存自报最新数据 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dataCdC0Vo 自报数据对象 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, DataCdC0Vo dataCdC0Vo) throws Exception { |
| | | RmAutoReportLast po = sv.getRmLastAutoReport(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmAutoReportLast(null, controller.getId(), controller.getId(), |
| | | rtuAddr, |
| | | new Date(), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt), |
| | | dataCdC0Vo.instantAmount, dataCdC0Vo.totalAmount, dataCdC0Vo.lossAmount, |
| | | dataCdC0Vo.waterPress, dataCdC0Vo.batteryVolt, dataCdC0Vo.sunVolt, dataCdC0Vo.signalValue) ; |
| | | sv.saveRmAutoReportLast(po) ; |
| | | }else{ |
| | | po = this.update(po, dataCdC0Vo) ; |
| | | sv.saveRmAutoReportLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存自报历史记录 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dataCdC0Vo 自报数据对象 |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataCdC0Vo dataCdC0Vo) throws Exception { |
| | | RmAutoReportHistory po = new RmAutoReportHistory(null, controller.getId(), controller.getId(), |
| | | rtuAddr, |
| | | new Date(), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt), |
| | | dataCdC0Vo.instantAmount, dataCdC0Vo.totalAmount, dataCdC0Vo.lossAmount, |
| | | dataCdC0Vo.waterPress, dataCdC0Vo.batteryVolt, dataCdC0Vo.sunVolt, dataCdC0Vo.signalValue) ; |
| | | sv.saveRmAutoReportHistory(po) ; |
| | | } |
| | | |
| | | |
| | | private RmAutoReportLast update(RmAutoReportLast po, DataCdC0Vo dataCdC0Vo) throws Exception { |
| | | po.dt = new Date() ; |
| | | po.rtudt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt) ; |
| | | po.instantamount = dataCdC0Vo.instantAmount; |
| | | po.totalamount = dataCdC0Vo.totalAmount; |
| | | po.lossamount = dataCdC0Vo.lossAmount; |
| | | po.waterpress = dataCdC0Vo.waterPress; |
| | | po.batteryvolt = dataCdC0Vo.batteryVolt; |
| | | po.sunvolt = dataCdC0Vo.sunVolt; |
| | | po.signalvalue = dataCdC0Vo.signalValue; |
| | | return po ; |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | if(data instanceof Data){ |
| | | Data d = (Data)data ; |
| | | if(d.getCommandId() == null || d.getCommandId().trim().equals("")){ |
| | | //无命令ID |
| | | this.toNextTasks(data); |
| | | } |
| | | Data d = (Data)data ; |
| | | if(d.getCommandId() == null || d.getCommandId().trim().equals("")){ |
| | | //无命令ID |
| | | this.toNextTasks(data); |
| | | } |
| | | //Object[] objs = this.getTaskResults(TkPreGenObjs.taskId) ; |
| | | //DbSv sv = (DbSv)objs[0] ; |
| | | //PrController controller = (PrController)objs[1] ; |
| | | } |
| | | } |
| | |
| | | <task id="TkDealControllerTramp" name="处理流浪控制器" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealControllerTramp" /> |
| | | <!-- 非流浪者RTU,必须放在TkDealControllerTramp后面 --> |
| | | <!-- 识别主动上报数据 --> |
| | | <task id="TkFindReport" name="识别上报数据" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkFindReport"> |
| | | |
| | | <task id="TkFindReport" name="识别控制器上报数据" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkFindReport"> |
| | | <task id="TkDealAlarmStatus" name="控制器报警与状态数据" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealAlarmStatus" /> |
| | | <task id="TkDealAutoReport" name="控制器自报数据" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealAutoReport" /> |
| | | </task> |
| | | <!-- 识别命令响应数据 --> |
| | | <task id="TkFindComResponse" name="识别响应命令数据" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkFindComResponse"> |
| | |
| | | </task> |
| | | </task> |
| | | </task> |
| | | </task> |
| | | </task> |
| | | </task> |
| | | </project> |
| | |
| | | @Mapping(target = "name", source = "name") |
| | | @Mapping(target = "clientNum", source = "clientnum") |
| | | @Mapping(target = "phone", source = "phone") |
| | | @Mapping(target = "idCard", source = "idcard") |
| | | @Mapping(target = "idcard", source = "idcard") |
| | | //@Mapping(target = "cardCount", source = "cardCount") |
| | | @Mapping(target = "address", source = "address") |
| | | @Mapping(target = "operateDt", source = "operatedt") |