1、完善协议实现代码;
2、实体协议数据处理自动任务(报警及状态+定时上报数据);
3、数据库实体id自动付值插件优化。
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.http.*; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | |
| | | .build() |
| | | .toUriString(); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8")); |
| | | |
| | | HttpEntity<?> httpEntity = new HttpEntity<>(headers); |
| | | ResponseEntity<SsoVo> response = null; |
| | | try { |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index += 4 ; |
| | | strTemp = "" + cvo.moneyAlarm ; |
| | | bTemp = ByteUtil.string2BCD_LE(strTemp) ; |
| | | bTempLen = bTemp.length ; |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index ++ ; |
| | | GlCreate.createPw(bs, index); |
| | | |
| | | index += 2 ; |
| | |
| | | throw new Exception("水位下限值必须是0~9999.99范围内的整数") ; |
| | | } |
| | | |
| | | byte[] bs = new byte[17] ; |
| | | byte[] bs = new byte[16] ; |
| | | int index = 0 ; |
| | | bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16)); |
| | | |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index += 4 ; |
| | | strTemp = "" + (Double.valueOf(cvo.limitLevel * 100)).longValue() ; |
| | | bTemp = ByteUtil.string2BCD_LE(strTemp) ; |
| | | bTempLen = bTemp.length ; |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index ++ ; |
| | | GlCreate.createPw(bs, index); |
| | | |
| | | index += 2 ; |
| | |
| | | import com.dy.common.mw.protocol.p206V202404.*; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.DateTime; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | |
| | | index += 4 ; |
| | | cdData.batteryVolt = ByteUtil.BCD2Int_LE(bs, index, index + 1)/100.0D ; |
| | | |
| | | index += 2 ; |
| | | String hh = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String dd = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String mm = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String yy = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | |
| | | String ymd = "20" + yy + "-" + mm + "-" + dd ; |
| | | |
| | | cdData.rtuDt = ymd + " " + hh ; |
| | | |
| | | cdData.dataDt = DateTime.lastXDay_yyyy_MM_dd(ymd, 1) ; |
| | | } |
| | | |
| | | } |
| | |
| | | if(!NumUtil.isPlusIntNumber(cvo.orderNo)){ |
| | | throw new Exception("订单号必须是16位数字") ; |
| | | } |
| | | if(cvo.orderNo.length() != 12){ |
| | | if(cvo.orderNo.length() != 16){ |
| | | throw new Exception("订单号必须是16位数字") ; |
| | | } |
| | | |
| | |
| | | GlCreate.createIcCardNo(cvo.icCardNo, bs, index); |
| | | |
| | | index += 8 ; |
| | | if(cvo.waterRemain != null){ |
| | | if(cvo.waterRemain == null){ |
| | | cvo.waterRemain = 0.0 ; |
| | | } |
| | | String strTemp = "" + Double.valueOf(cvo.waterRemain * 100).intValue() ; |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | if(cvo.moneyRemain != null){ |
| | | if(cvo.moneyRemain == null){ |
| | | cvo.moneyRemain = 0.0 ; |
| | | } |
| | | strTemp = "" + (Double.valueOf(cvo.moneyRemain * 100)).intValue() ; |
| | |
| | | } |
| | | |
| | | |
| | | if(cvo.waterPrice != null){ |
| | | if(cvo.waterPrice == null){ |
| | | cvo.waterPrice = 0.0 ; |
| | | } |
| | | strTemp = "" + (Double.valueOf(cvo.waterPrice * 100)).intValue() ; |
| | |
| | | } |
| | | |
| | | |
| | | if(cvo.elePrice != null){ |
| | | if(cvo.elePrice == null){ |
| | | cvo.elePrice = 0.0 ; |
| | | } |
| | | strTemp = "" + (Double.valueOf(cvo.elePrice * 100)).intValue() ; |
| | |
| | | sb.append(alarmEleLowVolt == null?"未知":(alarmEleLowVolt.byteValue() == 0 ? "正常":(alarmEleLowVolt.byteValue() == 1 ? "报警":"未知"))) ; |
| | | sb.append("\n") ; |
| | | sb.append(" IC卡功能 : ") ; |
| | | sb.append(stateIcEnable == null?"未知":(stateIcEnable.byteValue() == 0 ? "不支持":(stateIcEnable.byteValue() == 1 ? "支持":"未知"))) ; |
| | | sb.append(stateIcEnable == null?"未知":(stateIcEnable.byteValue() == 0 ? "无效":(stateIcEnable.byteValue() == 1 ? "有效":"未知"))) ; |
| | | sb.append("\n") ; |
| | | |
| | | return sb.toString() ; |
| | |
| | | sb.append(" 项目编号 : ") ; |
| | | sb.append(projectNo == null?"未知":projectNo) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 剩余水量报警值 : ") ; |
| | | sb.append(" 剩余金额报警值 : ") ; |
| | | sb.append(moneyAlarm == null?"未知":moneyAlarm) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 剩余水量报警值 : ") ; |
| | |
| | | public Double waterUserTotalAmountDay ;// 当日用户用水量 |
| | | public Double lossTotalAmountDay ;// 漏损水量 |
| | | public Double batteryVolt ;//后备电池电压 |
| | | public Double rtuDt ;//上报时间(yyyy-mm-dd HH) |
| | | public String dataDt ;//数据时间(yyyy-mm-dd) |
| | | public String rtuDt ;//RTU时钟(上报时刻)(yyyy-mm-dd HH:00:00) |
| | | |
| | | public String comName ;//命令名称 |
| | | |
| | |
| | | public String icCardAddr ;//IC卡地址(远程关闭时为0) |
| | | public String icCardNo ;//IC卡编号(17位数字) |
| | | public String orderNo ;//订单号(16位数字) |
| | | public String opDt ;//开泵/阀时间(分时日月) |
| | | public String opDt ;//开泵/阀时间(yyyy-mm-dd HH:MM:SS) |
| | | public Double waterTotalAmount ;//水表累计水量,单位0.01立方米 |
| | | public Double eleTotalAmount ;//电表累计电量,单位0.01度 |
| | | public Double moneyRemainUser ;//用户剩余金额, 单位0.01元 |
| | |
| | | public Byte opType1 ;//操作方式:0:刷卡开水泵/阀门;1:远程开水泵/阀门;2:APP开水泵/阀门 |
| | | public Byte opType2 ;//开启关闭:0: 开启 -1:关闭 |
| | | public Boolean success ;//执行结果(true成功, false失败) |
| | | public String rutDt ;//设备时钟 |
| | | public String rtuDt;//设备时钟 |
| | | |
| | | public String comName ;//命令名称 |
| | | |
| | |
| | | sb.append(opType2 == null?"未知":(opType2.byteValue()==0?"开启水泵/阀门":(opType2.byteValue()==1?"关闭水泵/阀门":"未知"))) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 设备时钟 : ") ; |
| | | sb.append(rutDt == null?"未知":rutDt) ; |
| | | sb.append(rtuDt == null?"未知": rtuDt) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 执行结果 : ") ; |
| | | sb.append(success == null?"未知":(success?"成功":"失败")) ; |
| | |
| | | |
| | | static int MAPPED_STATEMENT_INDEX = 0; |
| | | static int PARAMETER_INDEX = 1; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME = "setId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME2 = "setUserId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETID = "setId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETUSERID = "setUserId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETROLEID = "setRoleId"; |
| | | |
| | | /** |
| | | * 拦截逻辑实现 |
| | |
| | | if (entity instanceof BaseEntity) { |
| | | //Class<? extends Object> entityClass = entity.getClass(); |
| | | Class<?> entityClass = entity.getClass(); |
| | | Method setMt = null ; |
| | | Method setId = null ; |
| | | Method setUserId = null ; |
| | | Method setRoleId = null ; |
| | | try{ |
| | | /* |
| | | // 添加用户时userId为自动生成主键。roleId存在时是为用户绑角色 |
| | | String jsonString = JSONObject.toJSONString(entity, JSONWriter.Feature.WriteMapNullValue); |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if(jsonObject.containsKey("userId") && !jsonObject.containsKey("roleId")) { |
| | | setMt = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME2, Long.class) ; |
| | | setUserId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETUSERID, Long.class) ; |
| | | setRoleId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETROLEID, Long.class) ; |
| | | }else { |
| | | //有一些实体没有id,例如中间表 |
| | | setMt = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME, Long.class) ; |
| | | setId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETID, Long.class) ; |
| | | } |
| | | */ |
| | | //有一些实体没有id,例如中间表 |
| | | setId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETID, Long.class) ; |
| | | // BaUser实体中是setUserId, BaUserRole实体中包含setUserId,和setRoleId |
| | | setUserId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETUSERID, Long.class) ; |
| | | setRoleId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETROLEID, Long.class) ; |
| | | }catch (Exception e){ |
| | | //当entityClass没有setId方法时,会抛出异常 |
| | | } |
| | | if(setMt != null){ |
| | | setMt.invoke(entity, new IDLongGenerator().generate()); |
| | | if(setUserId != null && setRoleId == null){ |
| | | setUserId.invoke(entity, new IDLongGenerator().generate()); |
| | | }else if(setId != null){ |
| | | setId.invoke(entity, new IDLongGenerator().generate()); |
| | | } |
| | | |
| | | invocation.getArgs()[PARAMETER_INDEX] = entity; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 此接口拦截器(AutoGenerateIdInterceptor【自动什值ID】)中用到。 |
| | | */ |
| | | public interface BaseEntity extends Serializable { |
| | | } |
| | |
| | | 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 |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 20:20 |
| | | * @Description |
| | | */ |
| | | */ |
| | | @Mapper |
| | | public interface RmAlarmStateHistoryMapper extends BaseMapper<RmAlarmStateHistory> { |
| | | public interface RmAlarmStateHistoryMapper { |
| | | /** |
| | | * delete by primary key |
| | | * |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * select by primary key |
| | | * |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | |
| | | |
| | | /** |
| | | * update record selective |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * update record |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | |
| | | 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 |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 19:55 |
| | | * @Description |
| | | */ |
| | | */ |
| | | @Mapper |
| | | public interface RmAlarmStateLastMapper extends BaseMapper<RmAlarmStateLast> { |
| | | public interface RmAlarmStateLastMapper { |
| | | /** |
| | | * delete by primary key |
| | | * |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 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 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * update record |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmAlarmStateLast record); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * |
| | | * @param rtuAddr rtuAddr |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmAlarmStateLast> selectByRtuAddr(String rtuAddr); |
| | | } |
| | |
| | | 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 控制器报警与状态(历史) |
| | | */ |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 20:20 |
| | | * @Description |
| | | */ |
| | | |
| | | /** |
| | | * 控制器报警与状态(历史) |
| | | */ |
| | | @TableName(value="rm_alarm_state_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器报警与状态(历史)") |
| | | public class RmAlarmStateHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161104001L; |
| | | public static final long serialVersionUID = 202405202021001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @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; |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String rtuaddr; |
| | | 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; |
| | | /** |
| | | * 报警-蓄电池电压(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte bateryvolt; |
| | | public Date rtuDt; |
| | | |
| | | /** |
| | | * 报警-漏损(1报警,0正常) |
| | | * 状态-阀门/泵(1打开、0关闭) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte loss; |
| | | public Byte valveState; |
| | | |
| | | /** |
| | | * 报警-仪表(1报警,0正常) |
| | | * 剩余水量小于报警上限报警报警(1:报警, 0:正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte meter; |
| | | public Byte alarmRemainWater; |
| | | |
| | | /** |
| | | * 报警-阀门(1报警,0正常) |
| | | * 剩余水量为0关泵/阀(1:关泵,0:正常) |
| | | */ |
| | | @Schema(description = "报警-阀门(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valve; |
| | | public Byte alarm0WaterRemain; |
| | | |
| | | /** |
| | | * 状态-IC卡功能(1有效、0无效) |
| | | * 年用水量大于限制水量报警(1:报警 0:正常) |
| | | */ |
| | | @Schema(description = "状态-IC卡功能(1有效、0无效)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte iccard; |
| | | public Byte alarmExceedYear; |
| | | |
| | | /** |
| | | * 状态-工作(1启动、0停止) |
| | | * 流量计故障(1:报警,0:正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte working; |
| | | public Byte alarmWaterMeterFault; |
| | | |
| | | /** |
| | | * 状态-阀门(1打开、0关闭) |
| | | * 漏损(偷水)报警(1:报警, 0:正常) |
| | | */ |
| | | @Schema(description = "状态-阀门(1打开、0关闭)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valvestate; |
| | | public Byte alarmLoss; |
| | | |
| | | /** |
| | | * 流量计损坏(正常通讯但瞬时为0)报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmWaterMeterBreak; |
| | | |
| | | /** |
| | | * 电表故障报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMeterFault; |
| | | |
| | | /** |
| | | * 剩余金额为0(1:报警,0:正常) |
| | | */ |
| | | public Byte alarm0MoneyRemain; |
| | | |
| | | /** |
| | | * 控制器内门报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmInnerDoor; |
| | | |
| | | /** |
| | | * 控制器外门打开报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmOuterDoor; |
| | | |
| | | /** |
| | | * 交流缺项报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMiss; |
| | | |
| | | /** |
| | | * 交流过流报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleExceed; |
| | | |
| | | /** |
| | | * 三相电欠压报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleLowVolt; |
| | | |
| | | /** |
| | | * IC卡状态(1、有效,0:无效) |
| | | */ |
| | | public Byte stateIcEnable; |
| | | |
| | | } |
| | |
| | | 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 控制器报警与状态(最新) |
| | | */ |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 19:55 |
| | | * @Description |
| | | */ |
| | | |
| | | /** |
| | | * 控制器报警与状态(最新) |
| | | */ |
| | | @TableName(value="rm_alarm_state_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器报警与状态(最新)") |
| | | public class RmAlarmStateLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161041001L; |
| | | public static final long serialVersionUID = 202405202021002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @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(外键) |
| | | */ |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String rtuaddr; |
| | | * 控制器地址 |
| | | */ |
| | | 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; |
| | | * 控制器时钟 |
| | | */ |
| | | public Date rtuDt; |
| | | |
| | | /** |
| | | * 报警-蓄电池电压(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte bateryvolt; |
| | | * 状态-阀门/泵(1打开、0关闭) |
| | | */ |
| | | public Byte valveState; |
| | | |
| | | /** |
| | | * 报警-漏损(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte loss; |
| | | * 剩余水量小于报警上限报警报警(1:报警, 0:正常) |
| | | */ |
| | | public Byte alarmRemainWater; |
| | | |
| | | /** |
| | | * 报警-仪表(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte meter; |
| | | * 剩余水量为0关泵/阀(1:关泵,0:正常) |
| | | */ |
| | | public Byte alarm0WaterRemain; |
| | | |
| | | /** |
| | | * 报警-阀门(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-阀门(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valve; |
| | | * 年用水量大于限制水量报警(1:报警 0:正常) |
| | | */ |
| | | public Byte alarmExceedYear; |
| | | |
| | | /** |
| | | * 状态-IC卡功能(1有效、0无效) |
| | | */ |
| | | @Schema(description = "状态-IC卡功能(1有效、0无效)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte iccard; |
| | | * 流量计故障(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmWaterMeterFault; |
| | | |
| | | /** |
| | | * 状态-工作(1启动、0停止) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte working; |
| | | * 漏损(偷水)报警(1:报警, 0:正常) |
| | | */ |
| | | public Byte alarmLoss; |
| | | |
| | | /** |
| | | * 状态-阀门(1打开、0关闭) |
| | | */ |
| | | @Schema(description = "状态-阀门(1打开、0关闭)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valvestate; |
| | | * 流量计损坏(正常通讯但瞬时为0)报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmWaterMeterBreak; |
| | | |
| | | /** |
| | | * 电表故障报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMeterFault; |
| | | |
| | | /** |
| | | * 剩余金额为0(1:报警,0:正常) |
| | | */ |
| | | public Byte alarm0MoneyRemain; |
| | | |
| | | /** |
| | | * 控制器内门报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmInnerDoor; |
| | | |
| | | /** |
| | | * 控制器外门打开报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmOuterDoor; |
| | | |
| | | /** |
| | | * 交流缺项报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMiss; |
| | | |
| | | /** |
| | | * 交流过流报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleExceed; |
| | | |
| | | /** |
| | | * 三相电欠压报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleLowVolt; |
| | | |
| | | /** |
| | | * IC卡状态(1、有效,0:无效) |
| | | */ |
| | | public Byte stateIcEnable; |
| | | |
| | | } |
| | |
| | | <!--@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="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtuDt" jdbcType="TIMESTAMP" property="rtudt" /> |
| | | <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" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | <result column="valve_state" jdbcType="TINYINT" property="valveState" /> |
| | | <result column="alarm_remain_water" jdbcType="TINYINT" property="alarmRemainWater" /> |
| | | <result column="alarm0_water_remain" jdbcType="TINYINT" property="alarm0WaterRemain" /> |
| | | <result column="alarm_exceed_year" jdbcType="TINYINT" property="alarmExceedYear" /> |
| | | <result column="alarm_water_meter_fault" jdbcType="TINYINT" property="alarmWaterMeterFault" /> |
| | | <result column="alarm_loss" jdbcType="TINYINT" property="alarmLoss" /> |
| | | <result column="alarm_water_meter_break" jdbcType="TINYINT" property="alarmWaterMeterBreak" /> |
| | | <result column="alarm_ele_meter_fault" jdbcType="TINYINT" property="alarmEleMeterFault" /> |
| | | <result column="alarm0_money_remain" jdbcType="TINYINT" property="alarm0MoneyRemain" /> |
| | | <result column="alarm_inner_door" jdbcType="TINYINT" property="alarmInnerDoor" /> |
| | | <result column="alarm_outer_door" jdbcType="TINYINT" property="alarmOuterDoor" /> |
| | | <result column="alarm_ele_miss" jdbcType="TINYINT" property="alarmEleMiss" /> |
| | | <result column="alarm_ele_exceed" jdbcType="TINYINT" property="alarmEleExceed" /> |
| | | <result column="alarm_ele_low_volt" jdbcType="TINYINT" property="alarmEleLowVolt" /> |
| | | <result column="state_ic_enable" jdbcType="TINYINT" property="stateIcEnable" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, valve_state, alarm_remain_water, |
| | | alarm0_water_remain, alarm_exceed_year, alarm_water_meter_fault, alarm_loss, alarm_water_meter_break, |
| | | alarm_ele_meter_fault, alarm0_money_remain, alarm_inner_door, alarm_outer_door, alarm_ele_miss, |
| | | alarm_ele_exceed, alarm_ele_low_volt, state_ic_enable |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_history (id, controllerId, intakeId, |
| | | rtuAddr, dt, rtuDt, bateryVolt, |
| | | loss, meter, valve, |
| | | icCard, working, valveState |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtudt,jdbcType=TIMESTAMP}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{loss,jdbcType=TINYINT}, #{meter,jdbcType=TINYINT}, #{valve,jdbcType=TINYINT}, |
| | | #{iccard,jdbcType=TINYINT}, #{working,jdbcType=TINYINT}, #{valvestate,jdbcType=TINYINT} |
| | | ) |
| | | insert into rm_alarm_state_history (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | valve_state, alarm_remain_water, alarm0_water_remain, |
| | | alarm_exceed_year, alarm_water_meter_fault, |
| | | alarm_loss, alarm_water_meter_break, alarm_ele_meter_fault, |
| | | alarm0_money_remain, alarm_inner_door, alarm_outer_door, |
| | | alarm_ele_miss, alarm_ele_exceed, alarm_ele_low_volt, |
| | | state_ic_enable) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{valveState,jdbcType=TINYINT}, #{alarmRemainWater,jdbcType=TINYINT}, #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | #{alarmExceedYear,jdbcType=TINYINT}, #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | #{alarmLoss,jdbcType=TINYINT}, #{alarmWaterMeterBreak,jdbcType=TINYINT}, #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, #{alarmInnerDoor,jdbcType=TINYINT}, #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | #{alarmEleMiss,jdbcType=TINYINT}, #{alarmEleExceed,jdbcType=TINYINT}, #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | #{stateIcEnable,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | | <if test="valveState != null"> |
| | | valve_state, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault, |
| | | </if> |
| | | <if test="working != null"> |
| | | working, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_history |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | working = #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState = #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | <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}, |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | 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} |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <!--@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="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtuDt" jdbcType="TIMESTAMP" property="rtudt" /> |
| | | <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" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | <result column="valve_state" jdbcType="TINYINT" property="valveState" /> |
| | | <result column="alarm_remain_water" jdbcType="TINYINT" property="alarmRemainWater" /> |
| | | <result column="alarm0_water_remain" jdbcType="TINYINT" property="alarm0WaterRemain" /> |
| | | <result column="alarm_exceed_year" jdbcType="TINYINT" property="alarmExceedYear" /> |
| | | <result column="alarm_water_meter_fault" jdbcType="TINYINT" property="alarmWaterMeterFault" /> |
| | | <result column="alarm_loss" jdbcType="TINYINT" property="alarmLoss" /> |
| | | <result column="alarm_water_meter_break" jdbcType="TINYINT" property="alarmWaterMeterBreak" /> |
| | | <result column="alarm_ele_meter_fault" jdbcType="TINYINT" property="alarmEleMeterFault" /> |
| | | <result column="alarm0_money_remain" jdbcType="TINYINT" property="alarm0MoneyRemain" /> |
| | | <result column="alarm_inner_door" jdbcType="TINYINT" property="alarmInnerDoor" /> |
| | | <result column="alarm_outer_door" jdbcType="TINYINT" property="alarmOuterDoor" /> |
| | | <result column="alarm_ele_miss" jdbcType="TINYINT" property="alarmEleMiss" /> |
| | | <result column="alarm_ele_exceed" jdbcType="TINYINT" property="alarmEleExceed" /> |
| | | <result column="alarm_ele_low_volt" jdbcType="TINYINT" property="alarmEleLowVolt" /> |
| | | <result column="state_ic_enable" jdbcType="TINYINT" property="stateIcEnable" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, valve_state, alarm_remain_water, |
| | | alarm0_water_remain, alarm_exceed_year, alarm_water_meter_fault, alarm_loss, alarm_water_meter_break, |
| | | alarm_ele_meter_fault, alarm0_money_remain, alarm_inner_door, alarm_outer_door, alarm_ele_miss, |
| | | alarm_ele_exceed, alarm_ele_low_volt, state_ic_enable |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | from rm_alarm_state_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByRtuAddr" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| | | <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} |
| | | where rtu_addr = #{rtuAddr,jdbcType=VARCHAR} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_alarm_state_last |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_last (id, controllerId, intakeId, |
| | | rtuAddr, dt, rtuDt, bateryVolt, |
| | | loss, meter, valve, |
| | | icCard, working, valveState |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtudt,jdbcType=TIMESTAMP}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{loss,jdbcType=TINYINT}, #{meter,jdbcType=TINYINT}, #{valve,jdbcType=TINYINT}, |
| | | #{iccard,jdbcType=TINYINT}, #{working,jdbcType=TINYINT}, #{valvestate,jdbcType=TINYINT} |
| | | ) |
| | | insert into rm_alarm_state_last (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | valve_state, alarm_remain_water, alarm0_water_remain, |
| | | alarm_exceed_year, alarm_water_meter_fault, |
| | | alarm_loss, alarm_water_meter_break, alarm_ele_meter_fault, |
| | | alarm0_money_remain, alarm_inner_door, alarm_outer_door, |
| | | alarm_ele_miss, alarm_ele_exceed, alarm_ele_low_volt, |
| | | state_ic_enable) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{valveState,jdbcType=TINYINT}, #{alarmRemainWater,jdbcType=TINYINT}, #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | #{alarmExceedYear,jdbcType=TINYINT}, #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | #{alarmLoss,jdbcType=TINYINT}, #{alarmWaterMeterBreak,jdbcType=TINYINT}, #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, #{alarmInnerDoor,jdbcType=TINYINT}, #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | #{alarmEleMiss,jdbcType=TINYINT}, #{alarmEleExceed,jdbcType=TINYINT}, #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | #{stateIcEnable,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | | <if test="valveState != null"> |
| | | valve_state, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault, |
| | | </if> |
| | | <if test="working != null"> |
| | | working, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_last |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | working = #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState = #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | <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}, |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | 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} |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | MidResultToRtu resToRtu = TcpDownCommandCache.matchFromHead(resFromRtu) ; |
| | | if(resToRtu != null){ |
| | | //匹配到下发的命令 |
| | | resFromRtu.matchedCommand(resToRtu.rtuResultSendWebUrl, resToRtu.commandId) ; |
| | | resFromRtu.matchedCommand(resToRtu.commandId, resToRtu.rtuResultSendWebUrl) ; |
| | | this.nextDealRtuData(false, resFromRtu); |
| | | this.nextDealRtuComResult(resFromRtu); |
| | | }else{ |
| | |
| | | |
| | | log.info("网络连接关闭," |
| | | + (rtuAddr==null?"":("终端地址是:" + rtuAddr))) ; |
| | | //+ (session==null?"":(session.getRemoteAddress() == null?"":(session.getRemoteAddress().toString()==null?"":("终端网址是:" + session.getRemoteAddress().toString()))))) ; |
| | | //+ (session==null?"":(session.getRemoteAddress() == null?"":(session.getRemoteAddress().toString()==null?"":(",终端网址是:" + session.getRemoteAddress().toString()))))) ; |
| | | } |
| | | } |
| | | /** |
| | |
| | | String rtuAddr = (String)session.getAttribute(TcpIoSessionAttrIdIsRtuAddr.sessionArrIdKey) ; |
| | | log.error("网络会话发生异常," |
| | | + (rtuAddr==null?"":("终端地址是:" + rtuAddr)) |
| | | + (session==null?"":(session.getRemoteAddress() != null?("终端网址是:" + session.getRemoteAddress().toString()):"")) |
| | | + (session==null?"":(session.getRemoteAddress() != null?(",终端网址是:" + session.getRemoteAddress().toString()):"")) |
| | | + "\n异常消息:" + cause.getMessage(), cause); |
| | | } |
| | | } |
| | |
| | | String rtuAddr = (String)session.getAttribute(TcpIoSessionAttrIdIsRtuAddr.sessionArrIdKey) ; |
| | | log.info("网络发送了数据," |
| | | + (rtuAddr==null?"":("终端地址是:" + rtuAddr)) |
| | | + (session==null?"":(session.getRemoteAddress() != null?("终端网址是:" + session.getRemoteAddress().toString()):"")) ); |
| | | + (session==null?"":(session.getRemoteAddress() != null?(",终端网址是:" + session.getRemoteAddress().toString()):"")) ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, String rtuDt, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmAlarmStateLast(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | 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(controller, po, rtuDt, dV1_0_1, alarmVo, stateVo) ; |
| | | sv.updateRmAlarmStateLast(po); |
| | | } |
| | | // RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | // if(po == null){ |
| | | // po = new RmAlarmStateLast(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // 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(controller, po, rtuDt, dV1_0_1, alarmVo, stateVo) ; |
| | | // sv.updateRmAlarmStateLast(po); |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, String rtuDt, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | RmAlarmStateHistory po = new RmAlarmStateHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | 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) ; |
| | | // RmAlarmStateHistory po = new RmAlarmStateHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // 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(PrController controller, RmAlarmStateLast po, String rtuDt, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | po.controllerid = controller==null?null:controller.getId() ; |
| | | po.intakeid = controller==null?null:controller.getIntakeId() ; |
| | | |
| | | po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | po.rtudt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | 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 ; |
| | | } |
| | | // po.controllerid = controller==null?null:controller.getId() ; |
| | | // po.intakeid = controller==null?null:controller.getIntakeId() ; |
| | | // |
| | | // po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | // po.rtudt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | // 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 ; |
| | | |
| | | } |
| | | } |
| | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404 ; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.*; |
| | | import com.dy.common.util.DateTime; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data)data ; |
| | | Object protocolData = d.getSubData() ; |
| | | if(protocolData != null){ |
| | | DataV202404 dV202404 = (DataV202404)protocolData ; |
| | | if(dV202404 != null){ |
| | | Object cdObj = dV202404.subData ; |
| | | if(cdObj != null){ |
| | | try{ |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | if(cdObj instanceof DataCd81Vo){ |
| | | //设备终端随机自报 |
| | | DataCd81Vo cdData = (DataCd81Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), null, null, null, cdData, null, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), null, null, null, cdData, null, null) ; |
| | | }else if(cdObj instanceof DataCd80_5BVo){ |
| | | //设备终端工作上报 + 查询设备终端实时值 |
| | | DataCd80_5BVo cdData = (DataCd80_5BVo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, null, null, null, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, null, null, null, null) ; |
| | | }else if(cdObj instanceof DataCd93_A3Vo){ |
| | | //平台/APP远程关闭水泵/阀门 + 刷卡关泵/阀上报 |
| | | DataCd93_A3Vo cdData = (DataCd93_A3Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.endDt, null, cdData, null, null, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.endDt, null, cdData, null, null, null) ; |
| | | }else if(cdObj instanceof DataCd84Vo){ |
| | | //设备终端随机自报 |
| | | DataCd84Vo cdData = (DataCd84Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), null, null, null, null, cdData, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), null, null, null, null, cdData, null) ; |
| | | }else if(cdObj instanceof DataCdC2Vo){ |
| | | //设备终端随机自报 |
| | | DataCdC2Vo cdData = (DataCdC2Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), null, null, null, null, null, cdData) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), null, null, null, null, null, cdData) ; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("保存控制器报警和状态数据时发生异常", e); |
| | | } |
| | | DataV202404 dV202404 = (DataV202404)d.getSubData() ;//前面任务已经判断不为null |
| | | Object cdObj = dV202404.subData ; |
| | | if(cdObj != null){ |
| | | try{ |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | if(cdObj instanceof DataCd81Vo){ |
| | | //设备终端随机自报 |
| | | DataCd81Vo cdData = (DataCd81Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCd80_5BVo){ |
| | | //设备终端工作上报 + 查询设备终端实时值 |
| | | DataCd80_5BVo cdData = (DataCd80_5BVo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCd93_A3Vo){ |
| | | //平台/APP远程关闭水泵/阀门 + 刷卡关泵/阀上报 |
| | | DataCd93_A3Vo cdData = (DataCd93_A3Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.endDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.endDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCd84Vo){ |
| | | //设备终端随机自报 |
| | | DataCd84Vo cdData = (DataCd84Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.opDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.opDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCdC2Vo){ |
| | | //设备终端随机自报 |
| | | DataCdC2Vo cdData = (DataCdC2Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("保存控制器报警和状态数据时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param vo80_5B |
| | | * @param vo93_A3_85 |
| | | * @param vo81 |
| | | * @param alarmVo 报警及状态数据 |
| | | * @param receiveDt 接收数据时本地时钟 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, |
| | | PrController controller, |
| | | String rtuAddr, |
| | | String rtuDt, |
| | | DataCd80_5BVo vo80_5B, |
| | | DataCd93_A3Vo vo93_A3_85, |
| | | DataCd81Vo vo81, |
| | | DataCd84Vo vo84, |
| | | DataCdC2Vo voC2) throws Exception { |
| | | // RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | // if(po == null){ |
| | | // po = new RmAlarmStateLast(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // 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(controller, po, rtuDt, dV1_0_1, alarmVo, stateVo) ; |
| | | // sv.updateRmAlarmStateLast(po); |
| | | // } |
| | | AlarmVo alarmVo, |
| | | String receiveDt) throws Exception { |
| | | RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmAlarmStateLast(null, |
| | | controller==null?null:controller.getId(), |
| | | controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(receiveDt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | alarmVo==null?null:alarmVo.statePump, |
| | | alarmVo==null?null:alarmVo.alarmWaterRemain, |
| | | alarmVo==null?null:alarmVo.alarm0WaterRemain, |
| | | alarmVo==null?null:alarmVo.alarmExceedYear, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterFault, |
| | | alarmVo==null?null:alarmVo.alarmSteal, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterBreak, |
| | | alarmVo==null?null:alarmVo.alarmEleMeterFault, |
| | | alarmVo==null?null:alarmVo.alarm0MoneyRemain, |
| | | alarmVo==null?null:alarmVo.alarmInnerDoor, |
| | | alarmVo==null?null:alarmVo.alarmOuterDoor, |
| | | alarmVo==null?null:alarmVo.alarmEleMiss, |
| | | alarmVo==null?null:alarmVo.alarmEleExceed, |
| | | alarmVo==null?null:alarmVo.alarmEleLowVolt, |
| | | alarmVo==null?null:alarmVo.stateIcEnable |
| | | ) ; |
| | | sv.saveRmAlarmStateLast(po) ; |
| | | }else{ |
| | | po = this.update(po, controller, rtuDt, alarmVo, receiveDt) ; |
| | | sv.updateRmAlarmStateLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param vo80_5B |
| | | * @param vo93_A3_85 |
| | | * @param vo81 |
| | | * @param alarmVo 报警及状态数据 |
| | | * @param receiveDt 接收数据时本地时钟 |
| | | */ |
| | | private void saveHistory(DbSv sv, |
| | | PrController controller, |
| | | String rtuAddr, |
| | | String rtuDt, |
| | | DataCd80_5BVo vo80_5B, |
| | | DataCd93_A3Vo vo93_A3_85, |
| | | DataCd81Vo vo81, |
| | | DataCd84Vo vo84, |
| | | DataCdC2Vo voC2) throws Exception { |
| | | // RmAlarmStateHistory po = new RmAlarmStateHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // 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) ; |
| | | AlarmVo alarmVo, |
| | | String receiveDt) throws Exception { |
| | | RmAlarmStateHistory po = new RmAlarmStateHistory(null, |
| | | controller==null?null:controller.getId(), |
| | | controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(receiveDt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | alarmVo==null?null:alarmVo.statePump, |
| | | alarmVo==null?null:alarmVo.alarmWaterRemain, |
| | | alarmVo==null?null:alarmVo.alarm0WaterRemain, |
| | | alarmVo==null?null:alarmVo.alarmExceedYear, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterFault, |
| | | alarmVo==null?null:alarmVo.alarmSteal, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterBreak, |
| | | alarmVo==null?null:alarmVo.alarmEleMeterFault, |
| | | alarmVo==null?null:alarmVo.alarm0MoneyRemain, |
| | | alarmVo==null?null:alarmVo.alarmInnerDoor, |
| | | alarmVo==null?null:alarmVo.alarmOuterDoor, |
| | | alarmVo==null?null:alarmVo.alarmEleMiss, |
| | | alarmVo==null?null:alarmVo.alarmEleExceed, |
| | | alarmVo==null?null:alarmVo.alarmEleLowVolt, |
| | | alarmVo==null?null:alarmVo.stateIcEnable |
| | | ) ; |
| | | sv.saveRmAlarmStateHistory(po) ; |
| | | } |
| | | |
| | | |
| | | private RmAlarmStateLast update(PrController controller, |
| | | RmAlarmStateLast po, |
| | | /** |
| | | * 保存报警状态最新数据 |
| | | * @param po 实体对象 |
| | | * @param controller 控制器对象 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param alarmVo 报警及状态数据 |
| | | * @param receiveDt 接收数据时本地时钟 |
| | | */ |
| | | private RmAlarmStateLast update(RmAlarmStateLast po, |
| | | PrController controller, |
| | | String rtuDt, |
| | | DataCd80_5BVo vo80_5B, |
| | | DataCd93_A3Vo vo93_A3_85, |
| | | DataCd81Vo vo81, |
| | | DataCd84Vo vo84, |
| | | DataCdC2Vo voC2) throws Exception { |
| | | // po.controllerid = controller==null?null:controller.getId() ; |
| | | // po.intakeid = controller==null?null:controller.getIntakeId() ; |
| | | // |
| | | // po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | // po.rtudt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | // 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 ; |
| | | return null ; |
| | | AlarmVo alarmVo, |
| | | String receiveDt) throws Exception { |
| | | po.controllerId = controller==null?null:controller.getId() ; |
| | | po.intakeId = controller==null?null:controller.getIntakeId() ; |
| | | |
| | | po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(receiveDt) ; |
| | | po.rtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | if(alarmVo != null){ |
| | | po.valveState = alarmVo.statePump ; |
| | | po.alarmRemainWater = alarmVo.alarmWaterRemain ; |
| | | po.alarm0WaterRemain = alarmVo.alarm0WaterRemain ; |
| | | po.alarmExceedYear = alarmVo.alarmExceedYear ; |
| | | po.alarmWaterMeterFault = alarmVo.alarmWaterMeterFault ; |
| | | po.alarmLoss = alarmVo.alarmSteal ; |
| | | po.alarmWaterMeterBreak = alarmVo.alarmWaterMeterBreak ; |
| | | po.alarmEleMeterFault = alarmVo.alarmEleMeterFault ; |
| | | po.alarm0MoneyRemain = alarmVo.alarm0MoneyRemain ; |
| | | po.alarmInnerDoor = alarmVo.alarmInnerDoor ; |
| | | po.alarmOuterDoor = alarmVo.alarmOuterDoor ; |
| | | po.alarmEleMiss = alarmVo.alarmEleMiss ; |
| | | po.alarmEleExceed = alarmVo.alarmEleExceed ; |
| | | po.alarmEleLowVolt = alarmVo.alarmEleLowVolt ; |
| | | po.stateIcEnable = alarmVo.stateIcEnable ; |
| | | } |
| | | return po ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.p206V202404; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.*; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | 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: 2024/5/20 20:29 |
| | | * @Description |
| | | */ |
| | | public class TkDealTimingReportV202404 extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealTimingReportV202404.class.getName()); |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealTimingReportV202404"; |
| | | |
| | | /** |
| | | * 执行节点任务:报警及状态 |
| | | * |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data) data; |
| | | DataV202404 dV202404 = (DataV202404) d.getSubData();//前面任务已经判断不为null |
| | | Object cdObj = dV202404.subData; |
| | | if (cdObj != null) { |
| | | try { |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId); |
| | | DbSv sv = (DbSv) objs[0]; |
| | | PrController controller = (PrController) objs[1]; |
| | | if (cdObj instanceof DataCd83Vo) { |
| | | //设备终端定点上报, 每天12点上报数据 |
| | | DataCd83Vo cdData = (DataCd83Vo) (cdObj); |
| | | //this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt); |
| | | //this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("保存控制器报警和状态数据时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.dy.rtuMw.server.rtuData.p206V202404; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | |
| | | Data d = (Data)data ; |
| | | if(d.getCommandId() == null || d.getCommandId().trim().equals("")){ |
| | | //无命令ID |
| | | this.toNextTasks(data); |
| | | Object protocolData = d.getSubData() ; |
| | | if(protocolData != null) { |
| | | this.toNextTasks(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.http.*; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | |
| | | String url = UriComponentsBuilder.fromUriString(data.rtuResultSendWebUrl) |
| | | .build() |
| | | .toUriString(); |
| | | restTemplate.getMessageConverters().set(1,new StringHttpMessageConverter(StandardCharsets.UTF_8)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8")); |
| | | HttpEntity<?> httpEntity = new HttpEntity<>(data, headers); |
| | | ResponseEntity<WebResponseVo> response = null; |
| | | try { |
| | |
| | | <!-- 识别非命令应答上行数据 --> |
| | | <task id="TkFindReportV202404" name="识别非命令应答上行数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkFindReportV202404"> |
| | | <task id="TkDealAlarmStatusV202404" name="控制器报警与状态数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealAlarmStatusV202404" /> |
| | | <task id="TkDealTimingReportV202404" name="控制器定点上报数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealTimingReportV202404" /> |
| | | </task> |
| | | <!-- 识别命令响应数据 --> |
| | | <task id="TkFindComResponseV202404" name="识别响应命令数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkFindComResponseV202404"> |
| | |
| | | @GetMapping(path = "test") |
| | | public BaseResponse<String> test() { |
| | | //return this.connect() ;//连接通信中间件测试 |
| | | return this.cdXY(CodeV202404.cd_30) ;//发送固定参数XY的命令 |
| | | //return this.cdXY(CodeV202404.cd_30) ;//发送固定参数XY的命令 |
| | | //return this.cd55(1) ; |
| | | //return this.cd15() ; |
| | | //return this.cd16() ; |
| | | //return this.cd22() ; |
| | | //return this.cd31() ; |
| | | return this.cd92() ; |
| | | } |
| | | |
| | | /** |