24个文件已修改
14个文件已添加
2个文件已删除
| | |
| | | public class DataCd81Vo { |
| | | public DataAlarmVo alarmVo ;//报警 |
| | | public DataStateVo stateVo ;//状态 |
| | | public String rtuDt ;//控制器时钟 |
| | | |
| | | public String toString(){ |
| | | StringBuilder sb = new StringBuilder() ; |
| | | sb.append(" 终端随机自报数据:\n"); |
| | |
| | | sb.append(stateVo.toString()); |
| | | sb.append("\n"); |
| | | } |
| | | sb.append(" 控制器时钟:"); |
| | | sb.append(rtuDt==null?"":rtuDt); |
| | | sb.append("\n"); |
| | | return sb.toString() ; |
| | | } |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 阀开工作报 |
| | | * 阀开工作报(每几十秒上报一次,上报间隔可设置) |
| | | */ |
| | | @Data |
| | | public class DataCd84Vo { |
| | | public String cardNo ;//IC卡编号 |
| | | public Double remainMoney ;//剩余金额:用户余额4字节BCD码,取值范围0.00~999999.99,单位为元 |
| | | public Double totalAmount; //累计流量:5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | public Double totalAmount; //累计流量(本次开阀以来的累计流量):5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | public Double instantAmount; //瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h。 |
| | | public String rtuDt ;//控制器时钟 |
| | | |
| | |
| | | public class DataCdC0Vo { |
| | | public Double instantAmount; //瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h。 |
| | | public Double totalAmount; //累计流量:5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | public Double lossAmount; //损失流量:5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | public Double lossAmount; //损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0):5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | 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。 |
| | |
| | | cdData.stateVo = GlParse.parseState(bs, index) ; |
| | | index += 2 ; |
| | | |
| | | //控制器时钟 |
| | | cdData.rtuDt = GlParse.parseTp(bs, index) ; |
| | | |
| | | } |
| | | } |
| | |
| | | public static Date dateFrom_yyyy_MM_dd(String yyyy_MM_dd) throws Exception { |
| | | return new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA).parse(yyyy_MM_dd); |
| | | } |
| | | |
| | | public static Date dateFrom_yyyy_MM_dd1(String yyyy_MM_dd_HH_mm_ss) throws Exception { |
| | | return new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA).parse(yyyy_MM_dd_HH_mm_ss); |
| | | } |
| | | |
| | | public static Date dateFrom_yyyyMMddHHmmss(String yyyyMMddHHmmss) throws Exception { |
| | | return new SimpleDateFormat("yyyyMMddHHmmss", Locale.CHINA).parse(yyyyMMddHHmmss); |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountHistory; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/2/28 15:31 |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmLossHistoryMapper { |
| | | /** |
| | | * 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(RmLossHistory record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmLossHistory record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmLossHistory selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by dt |
| | | * @param date 日期(yyyy-mm-dd) |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmLossHistory> selectByDate(Date date) ; |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmLossHistory record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmLossHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/2/28 15:31 |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmLossLastMapper { |
| | | /** |
| | | * 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(RmLossLast record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmLossLast record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmLossLast selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * @param rtuAddr 控制器地址 |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmLossLast> selectByRtuAddr(String rtuAddr) ; |
| | | /** |
| | | * select by dt |
| | | * @param date 日期(yyyy-mm-dd) |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmLossLast> selectByDate(Date date) ; |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmLossLast record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmLossLast record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWorkReportHistory; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/2/28 8:52 |
| | | * @LastEditTime 2024/2/28 8:52 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmWorkReportHistoryMapper { |
| | | /** |
| | | * 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(RmWorkReportHistory record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmWorkReportHistory record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmWorkReportHistory selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmWorkReportHistory record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmWorkReportHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWorkReportLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/2/28 8:52 |
| | | * @LastEditTime 2024/2/28 8:52 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmWorkReportLastMapper { |
| | | /** |
| | | * 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(RmWorkReportLast record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmWorkReportLast record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmWorkReportLast selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param rtuAddr 控制器地址 |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmWorkReportLast> selectByRtuAddr(String rtuAddr); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmWorkReportLast record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmWorkReportLast record); |
| | | } |
| | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String rtuaddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @Schema(description = "上报日期时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @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) |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String rtuaddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @Schema(description = "上报日期时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @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) |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
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/2/28 15:31 |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description 控制器日漏损水量历史数据 |
| | | */ |
| | | @TableName(value="rm_loss_history_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器日漏损水量历史数据 ") |
| | | public class RmLossHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402281620001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @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(外键) |
| | | */ |
| | | @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") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 控制器当日最后上报数据时间 |
| | | */ |
| | | @Schema(description = "控制器当日最后上报数据时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS") |
| | | public Date dtLast; |
| | | |
| | | /** |
| | | * 控制器当日最后上报数据中的控制器时钟 |
| | | */ |
| | | @Schema(description = "控制器时钟", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS") |
| | | public Date dtRtu; |
| | | |
| | | /** |
| | | * 日漏损流量 |
| | | */ |
| | | @Schema(description = "日漏损量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double lossAmount; |
| | | |
| | | |
| | | } |
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/2/28 15:31 |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description 控制器日漏损水量最新数据 |
| | | */ |
| | | @TableName(value="rm_loss_last_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器日漏损水量最新数据") |
| | | public class RmLossLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402281621001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 由最新数据持有历史数据中的最新记录ID,以方便快速查询 |
| | | * json不序列化此属性,即不向前端页面发送及显示 |
| | | */ |
| | | @Schema(hidden=true) |
| | | @JSONField(serialize = false) |
| | | public Long lastHistoryId; |
| | | |
| | | /** |
| | | * 控制器实体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") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 控制器当日最后上报数据时间 |
| | | */ |
| | | @Schema(description = "控制器当日最后上报数据时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS") |
| | | public Date dtLast; |
| | | |
| | | /** |
| | | * 控制器当日最后上报数据中的控制器时钟 |
| | | */ |
| | | @Schema(description = "控制器时钟", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS") |
| | | public Date dtRtu; |
| | | |
| | | /** |
| | | * 日漏损流量 |
| | | */ |
| | | @Schema(description = "日漏损量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double lossAmount; |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | |
| | | * 由最新数据持有历史数据中的最新记录ID,以方便快速查询 |
| | | * json不序列化此属性,即不向前端页面发送及显示 |
| | | */ |
| | | @Schema(hidden=true) |
| | | @JSONField(serialize = false) |
| | | public Long lastHistoryId; |
| | | |
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/2/28 8:52 |
| | | * @LastEditTime 2024/2/28 8:52 |
| | | * @Description 终端工作报历史数据 |
| | | */ |
| | | @TableName(value="rm_work_report_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "终端工作报历史数据") |
| | | public class RmWorkReportHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402280859001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @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(外键) |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * IC卡编号 |
| | | */ |
| | | @Schema(description = "IC卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String icCardNo; |
| | | |
| | | /** |
| | | * 累计流量 |
| | | */ |
| | | @Schema(description = "累计流量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double totalAmount; |
| | | |
| | | /** |
| | | * 瞬时流量 |
| | | */ |
| | | @Schema(description = "瞬时流量(m3/h)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double instantAmount; |
| | | |
| | | /** |
| | | * 剩余金额 |
| | | */ |
| | | @Schema(description = "剩余蒂金额(元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double remainMoney; |
| | | |
| | | |
| | | } |
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/2/28 8:52 |
| | | * @LastEditTime 2024/2/28 8:52 |
| | | * @Description 终端最新工作报 |
| | | */ |
| | | |
| | | @TableName(value="rm_work_report_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "终端最新工作报") |
| | | public class RmWorkReportLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402280855001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @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(外键) |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * IC卡编号 |
| | | */ |
| | | @Schema(description = "IC卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String icCardNo; |
| | | |
| | | /** |
| | | * 累计流量 |
| | | */ |
| | | @Schema(description = "累计流量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double totalAmount; |
| | | |
| | | /** |
| | | * 瞬时流量 |
| | | */ |
| | | @Schema(description = "瞬时流量(m3/h)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double instantAmount; |
| | | |
| | | /** |
| | | * 剩余金额 |
| | | */ |
| | | @Schema(description = "剩余蒂金额(元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double remainMoney; |
| | | |
| | | |
| | | } |
| | |
| | | <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="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" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, bateryVolt, loss, meter, valve, icCard, |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_history (id, controllerId, intakeId, |
| | | rtuAddr, dt, bateryVolt, |
| | | 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=DATE}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{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} |
| | | ) |
| | |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | |
| | | <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="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" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, bateryVolt, loss, meter, valve, icCard, |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_last (id, controllerId, intakeId, |
| | | rtuAddr, dt, bateryVolt, |
| | | 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=DATE}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{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} |
| | | ) |
| | |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | |
| | | <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="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtuDt" jdbcType="TIMESTAMP" property="rtudt" /> |
| | | <result column="instantAmount" jdbcType="DOUBLE" property="instantamount" /> |
| | | <result column="totalAmount" jdbcType="DOUBLE" property="totalamount" /> |
| | | <result column="lossAmount" jdbcType="DOUBLE" property="lossamount" /> |
| | |
| | | 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}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtudt,jdbcType=TIMESTAMP}, #{instantamount,jdbcType=DOUBLE}, |
| | | #{totalamount,jdbcType=DOUBLE}, #{lossamount,jdbcType=DOUBLE}, #{waterpress,jdbcType=DOUBLE}, |
| | | #{batteryvolt,jdbcType=DOUBLE}, #{sunvolt,jdbcType=DOUBLE}, #{signalvalue,jdbcType=INTEGER} |
| | | ) |
| | |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=DATE}, |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | #{instantamount,jdbcType=DOUBLE}, |
| | |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | | totalAmount = #{totalamount,jdbcType=DOUBLE}, |
| | | lossAmount = #{lossamount,jdbcType=DOUBLE}, |
| | |
| | | <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="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtuDt" jdbcType="TIMESTAMP" property="rtudt" /> |
| | | <result column="instantAmount" jdbcType="DOUBLE" property="instantamount" /> |
| | | <result column="totalAmount" jdbcType="DOUBLE" property="totalamount" /> |
| | | <result column="lossAmount" jdbcType="DOUBLE" property="lossamount" /> |
| | |
| | | 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}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtudt,jdbcType=TIMESTAMP}, #{instantamount,jdbcType=DOUBLE}, |
| | | #{totalamount,jdbcType=DOUBLE}, #{lossamount,jdbcType=DOUBLE}, #{waterpress,jdbcType=DOUBLE}, |
| | | #{batteryvolt,jdbcType=DOUBLE}, #{sunvolt,jdbcType=DOUBLE}, #{signalvalue,jdbcType=INTEGER} |
| | | ) |
| | |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=DATE}, |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | #{instantamount,jdbcType=DOUBLE}, |
| | |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantamount != null"> |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | rtuDt = #{rtudt,jdbcType=DATE}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | instantAmount = #{instantamount,jdbcType=DOUBLE}, |
| | | totalAmount = #{totalamount,jdbcType=DOUBLE}, |
| | | lossAmount = #{lossamount,jdbcType=DOUBLE}, |
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.RmLossHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmLossHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_loss_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <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="DATE" property="dt" /> |
| | | <result column="dt_last" jdbcType="TIMESTAMP" property="dtLast" /> |
| | | <result column="dt_rtu" jdbcType="TIMESTAMP" property="dtRtu" /> |
| | | <result column="loss_amount" jdbcType="DOUBLE" property="lossAmount" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, dt_last, dt_rtu, loss_amount |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByDate" parameterType="java.util.Date" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_history |
| | | where dt = #{dt,jdbcType=DATE} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_loss_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_history (id, controller_id, intake_id, |
| | | rtu_addr, dt, dt_last, dt_rtu, loss_amount |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, #{lossAmount,jdbcType=DOUBLE} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | dt_last, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount, |
| | | </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="dtLast != null"> |
| | | #{dtLast,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | #{dtRtu,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | #{lossAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_loss_history |
| | | <set> |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_loss_history |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE} |
| | | 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.RmLossLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_loss_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="last_history_id" jdbcType="BIGINT" property="lastHistoryId" /> |
| | | <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="DATE" property="dt" /> |
| | | <result column="dt_last" jdbcType="TIMESTAMP" property="dtLast" /> |
| | | <result column="dt_rtu" jdbcType="TIMESTAMP" property="dtRtu" /> |
| | | <result column="loss_amount" jdbcType="DOUBLE" property="lossAmount" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, last_history_id, controller_id, intake_id, rtu_addr, dt, dt_last, dt_rtu, loss_amount |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_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_loss_last |
| | | where rtu_addr = #{rtuAddr,jdbcType=VARCHAR} |
| | | </select> |
| | | <select id="selectByDate" parameterType="java.util.Date" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_last |
| | | where dt = #{dt,jdbcType=DATE} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_loss_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_last (id, last_history_id, controller_id, |
| | | intake_id, rtu_addr, dt, dt_last, dt_rtu, |
| | | loss_amount) |
| | | values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, |
| | | #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, |
| | | #{lossAmount,jdbcType=DOUBLE}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | dt_last, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="lastHistoryId != null"> |
| | | #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="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="dtLast != null"> |
| | | #{dtLast,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | #{dtRtu,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | #{lossAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_loss_last |
| | | <set> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_loss_last |
| | | set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <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="op_dt" jdbcType="DATE" property="opDt" /> |
| | | <result column="op_dt" jdbcType="TIMESTAMP" property="opDt" /> |
| | | <result column="op_type" jdbcType="TINYINT" property="opType" /> |
| | | <result column="op_total_amount" jdbcType="DOUBLE" property="opTotalAmount" /> |
| | | <result column="op_ic_card_no" jdbcType="VARCHAR" property="opIcCardNo" /> |
| | | <result column="op_ic_card_addr" jdbcType="VARCHAR" property="opIcCardAddr" /> |
| | | <result column="op_remain_money" jdbcType="DOUBLE" property="opRemainMoney" /> |
| | | <result column="open_dt" jdbcType="DATE" property="openDt" /> |
| | | <result column="cl_dt" jdbcType="DATE" property="clDt" /> |
| | | <result column="open_dt" jdbcType="TIMESTAMP" property="openDt" /> |
| | | <result column="cl_dt" jdbcType="TIMESTAMP" property="clDt" /> |
| | | <result column="cl_type" jdbcType="TINYINT" property="clType" /> |
| | | <result column="cl_total_amount" jdbcType="DOUBLE" property="clTotalAmount" /> |
| | | <result column="cl_ic_card_no" jdbcType="VARCHAR" property="clIcCardNo" /> |
| | |
| | | <result column="cl_this_amount" jdbcType="DOUBLE" property="clThisAmount" /> |
| | | <result column="cl_this_money" jdbcType="DOUBLE" property="clThisMoney" /> |
| | | <result column="cl_this_time" jdbcType="INTEGER" property="clThisTime" /> |
| | | <result column="cl_open_dt" jdbcType="DATE" property="clOpenDt" /> |
| | | <result column="close_dt" jdbcType="DATE" property="closeDt" /> |
| | | <result column="cl_open_dt" jdbcType="TIMESTAMP" property="clOpenDt" /> |
| | | <result column="close_dt" jdbcType="TIMESTAMP" property="closeDt" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | |
| | | cl_this_money, cl_this_time, cl_open_dt, |
| | | close_dt) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{opDt,jdbcType=DATE}, #{opType,jdbcType=TINYINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{opDt,jdbcType=TIMESTAMP}, #{opType,jdbcType=TINYINT}, |
| | | #{opTotalAmount,jdbcType=DOUBLE}, #{opIcCardNo,jdbcType=VARCHAR}, #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | #{opRemainMoney,jdbcType=DOUBLE}, #{openDt,jdbcType=DATE}, #{clDt,jdbcType=DATE}, |
| | | #{opRemainMoney,jdbcType=DOUBLE}, #{openDt,jdbcType=TIMESTAMP}, #{clDt,jdbcType=TIMESTAMP}, |
| | | #{clType,jdbcType=TINYINT}, #{clTotalAmount,jdbcType=DOUBLE}, #{clIcCardNo,jdbcType=VARCHAR}, |
| | | #{clIcCardAddr,jdbcType=VARCHAR}, #{clRemainMoney,jdbcType=DOUBLE}, #{clThisAmount,jdbcType=DOUBLE}, |
| | | #{clThisMoney,jdbcType=DOUBLE}, #{clThisTime,jdbcType=INTEGER}, #{clOpenDt,jdbcType=DATE}, |
| | | #{closeDt,jdbcType=DATE}) |
| | | #{clThisMoney,jdbcType=DOUBLE}, #{clThisTime,jdbcType=INTEGER}, #{clOpenDt,jdbcType=TIMESTAMP}, |
| | | #{closeDt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseValveHistory"> |
| | | <!--@mbg.generated--> |
| | |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opDt != null"> |
| | | #{opDt,jdbcType=DATE}, |
| | | #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | #{opType,jdbcType=TINYINT}, |
| | |
| | | #{opRemainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | #{openDt,jdbcType=DATE}, |
| | | #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clDt != null"> |
| | | #{clDt,jdbcType=DATE}, |
| | | #{clDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clType != null"> |
| | | #{clType,jdbcType=TINYINT}, |
| | |
| | | #{clThisTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="clOpenDt != null"> |
| | | #{clOpenDt,jdbcType=DATE}, |
| | | #{clOpenDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="closeDt != null"> |
| | | #{closeDt,jdbcType=DATE}, |
| | | #{closeDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opDt != null"> |
| | | op_dt = #{opDt,jdbcType=DATE}, |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | |
| | | op_remain_money = #{opRemainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | open_dt = #{openDt,jdbcType=DATE}, |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clDt != null"> |
| | | cl_dt = #{clDt,jdbcType=DATE}, |
| | | cl_dt = #{clDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clType != null"> |
| | | cl_type = #{clType,jdbcType=TINYINT}, |
| | |
| | | cl_this_time = #{clThisTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="clOpenDt != null"> |
| | | cl_open_dt = #{clOpenDt,jdbcType=DATE}, |
| | | cl_open_dt = #{clOpenDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="closeDt != null"> |
| | | close_dt = #{closeDt,jdbcType=DATE}, |
| | | close_dt = #{closeDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | op_dt = #{opDt,jdbcType=DATE}, |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | | op_total_amount = #{opTotalAmount,jdbcType=DOUBLE}, |
| | | op_ic_card_no = #{opIcCardNo,jdbcType=VARCHAR}, |
| | | op_ic_card_addr = #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | op_remain_money = #{opRemainMoney,jdbcType=DOUBLE}, |
| | | open_dt = #{openDt,jdbcType=DATE}, |
| | | cl_dt = #{clDt,jdbcType=DATE}, |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | cl_dt = #{clDt,jdbcType=TIMESTAMP}, |
| | | cl_type = #{clType,jdbcType=TINYINT}, |
| | | cl_total_amount = #{clTotalAmount,jdbcType=DOUBLE}, |
| | | cl_ic_card_no = #{clIcCardNo,jdbcType=VARCHAR}, |
| | |
| | | cl_this_amount = #{clThisAmount,jdbcType=DOUBLE}, |
| | | cl_this_money = #{clThisMoney,jdbcType=DOUBLE}, |
| | | cl_this_time = #{clThisTime,jdbcType=INTEGER}, |
| | | cl_open_dt = #{clOpenDt,jdbcType=DATE}, |
| | | close_dt = #{closeDt,jdbcType=DATE} |
| | | cl_open_dt = #{clOpenDt,jdbcType=TIMESTAMP}, |
| | | close_dt = #{closeDt,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <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="op_dt" jdbcType="DATE" property="opDt" /> |
| | | <result column="op_dt" jdbcType="TIMESTAMP" property="opDt" /> |
| | | <result column="op_type" jdbcType="TINYINT" property="opType" /> |
| | | <result column="op_total_amount" jdbcType="DOUBLE" property="opTotalAmount" /> |
| | | <result column="op_ic_card_no" jdbcType="VARCHAR" property="opIcCardNo" /> |
| | | <result column="op_ic_card_addr" jdbcType="VARCHAR" property="opIcCardAddr" /> |
| | | <result column="op_remain_money" jdbcType="DOUBLE" property="opRemainMoney" /> |
| | | <result column="open_dt" jdbcType="DATE" property="openDt" /> |
| | | <result column="cl_dt" jdbcType="DATE" property="clDt" /> |
| | | <result column="open_dt" jdbcType="TIMESTAMP" property="openDt" /> |
| | | <result column="cl_dt" jdbcType="TIMESTAMP" property="clDt" /> |
| | | <result column="cl_type" jdbcType="TINYINT" property="clType" /> |
| | | <result column="cl_total_amount" jdbcType="DOUBLE" property="clTotalAmount" /> |
| | | <result column="cl_ic_card_no" jdbcType="VARCHAR" property="clIcCardNo" /> |
| | |
| | | <result column="cl_this_amount" jdbcType="DOUBLE" property="clThisAmount" /> |
| | | <result column="cl_this_money" jdbcType="DOUBLE" property="clThisMoney" /> |
| | | <result column="cl_this_time" jdbcType="INTEGER" property="clThisTime" /> |
| | | <result column="cl_open_dt" jdbcType="DATE" property="clOpenDt" /> |
| | | <result column="close_dt" jdbcType="DATE" property="closeDt" /> |
| | | <result column="cl_open_dt" jdbcType="TIMESTAMP" property="clOpenDt" /> |
| | | <result column="close_dt" jdbcType="TIMESTAMP" property="closeDt" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | |
| | | cl_this_money, cl_this_time, cl_open_dt, |
| | | close_dt) |
| | | values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, |
| | | #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{opDt,jdbcType=DATE}, |
| | | #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{opDt,jdbcType=TIMESTAMP}, |
| | | #{opType,jdbcType=TINYINT}, #{opTotalAmount,jdbcType=DOUBLE}, #{opIcCardNo,jdbcType=VARCHAR}, |
| | | #{opIcCardAddr,jdbcType=VARCHAR}, #{opRemainMoney,jdbcType=DOUBLE}, #{openDt,jdbcType=DATE}, |
| | | #{clDt,jdbcType=DATE}, #{clType,jdbcType=TINYINT}, #{clTotalAmount,jdbcType=DOUBLE}, |
| | | #{opIcCardAddr,jdbcType=VARCHAR}, #{opRemainMoney,jdbcType=DOUBLE}, #{openDt,jdbcType=TIMESTAMP}, |
| | | #{clDt,jdbcType=TIMESTAMP}, #{clType,jdbcType=TINYINT}, #{clTotalAmount,jdbcType=DOUBLE}, |
| | | #{clIcCardNo,jdbcType=VARCHAR}, #{clIcCardAddr,jdbcType=VARCHAR}, #{clRemainMoney,jdbcType=DOUBLE}, |
| | | #{clThisAmount,jdbcType=DOUBLE}, #{clThisMoney,jdbcType=DOUBLE}, #{clThisTime,jdbcType=INTEGER}, |
| | | #{clOpenDt,jdbcType=DATE}, #{closeDt,jdbcType=DATE}) |
| | | #{clOpenDt,jdbcType=TIMESTAMP}, #{closeDt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseValveLast"> |
| | | <!--@mbg.generated--> |
| | |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opDt != null"> |
| | | #{opDt,jdbcType=DATE}, |
| | | #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | #{opType,jdbcType=TINYINT}, |
| | |
| | | #{opRemainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | #{openDt,jdbcType=DATE}, |
| | | #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clDt != null"> |
| | | #{clDt,jdbcType=DATE}, |
| | | #{clDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clType != null"> |
| | | #{clType,jdbcType=TINYINT}, |
| | |
| | | #{clThisTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="clOpenDt != null"> |
| | | #{clOpenDt,jdbcType=DATE}, |
| | | #{clOpenDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="closeDt != null"> |
| | | #{closeDt,jdbcType=DATE}, |
| | | #{closeDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opDt != null"> |
| | | op_dt = #{opDt,jdbcType=DATE}, |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | |
| | | op_remain_money = #{opRemainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | open_dt = #{openDt,jdbcType=DATE}, |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clDt != null"> |
| | | cl_dt = #{clDt,jdbcType=DATE}, |
| | | cl_dt = #{clDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clType != null"> |
| | | cl_type = #{clType,jdbcType=TINYINT}, |
| | |
| | | cl_this_time = #{clThisTime,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="clOpenDt != null"> |
| | | cl_open_dt = #{clOpenDt,jdbcType=DATE}, |
| | | cl_open_dt = #{clOpenDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="closeDt != null"> |
| | | close_dt = #{closeDt,jdbcType=DATE}, |
| | | close_dt = #{closeDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | op_dt = #{opDt,jdbcType=DATE}, |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | | op_total_amount = #{opTotalAmount,jdbcType=DOUBLE}, |
| | | op_ic_card_no = #{opIcCardNo,jdbcType=VARCHAR}, |
| | | op_ic_card_addr = #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | op_remain_money = #{opRemainMoney,jdbcType=DOUBLE}, |
| | | open_dt = #{openDt,jdbcType=DATE}, |
| | | cl_dt = #{clDt,jdbcType=DATE}, |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | cl_dt = #{clDt,jdbcType=TIMESTAMP}, |
| | | cl_type = #{clType,jdbcType=TINYINT}, |
| | | cl_total_amount = #{clTotalAmount,jdbcType=DOUBLE}, |
| | | cl_ic_card_no = #{clIcCardNo,jdbcType=VARCHAR}, |
| | |
| | | cl_this_amount = #{clThisAmount,jdbcType=DOUBLE}, |
| | | cl_this_money = #{clThisMoney,jdbcType=DOUBLE}, |
| | | cl_this_time = #{clThisTime,jdbcType=INTEGER}, |
| | | cl_open_dt = #{clOpenDt,jdbcType=DATE}, |
| | | close_dt = #{closeDt,jdbcType=DATE} |
| | | cl_open_dt = #{clOpenDt,jdbcType=TIMESTAMP}, |
| | | close_dt = #{closeDt,jdbcType=TIMESTAMP} |
| | | 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.RmWorkReportHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmWorkReportHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_work_report_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <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="ic_card_no" jdbcType="VARCHAR" property="icCardNo" /> |
| | | <result column="total_amount" jdbcType="DOUBLE" property="totalAmount" /> |
| | | <result column="instant_amount" jdbcType="DOUBLE" property="instantAmount" /> |
| | | <result column="remain_money" jdbcType="DOUBLE" property="remainMoney" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, ic_card_no, total_amount, instant_amount, |
| | | remain_money, rtu_dt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_work_report_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_work_report_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_work_report_history (id, controller_id, intake_id, |
| | | rtu_addr, dt, ic_card_no, |
| | | total_amount, instant_amount, remain_money, |
| | | rtu_dt) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{icCardNo,jdbcType=VARCHAR}, |
| | | #{totalAmount,jdbcType=DOUBLE}, #{instantAmount,jdbcType=DOUBLE}, #{remainMoney,jdbcType=DOUBLE}, |
| | | #{rtuDt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_work_report_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="icCardNo != null"> |
| | | ic_card_no, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount, |
| | | </if> |
| | | <if test="remainMoney != null"> |
| | | remain_money, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </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=TIMESTAMP}, |
| | | </if> |
| | | <if test="icCardNo != null"> |
| | | #{icCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | #{totalAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | #{instantAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="remainMoney != null"> |
| | | #{remainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_work_report_history |
| | | <set> |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="icCardNo != null"> |
| | | ic_card_no = #{icCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount = #{totalAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount = #{instantAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="remainMoney != null"> |
| | | remain_money = #{remainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_work_report_history |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | ic_card_no = #{icCardNo,jdbcType=VARCHAR}, |
| | | total_amount = #{totalAmount,jdbcType=DOUBLE}, |
| | | instant_amount = #{instantAmount,jdbcType=DOUBLE}, |
| | | remain_money = #{remainMoney,jdbcType=DOUBLE}, |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP} |
| | | 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.RmWorkReportLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmWorkReportLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_work_report_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <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="ic_card_no" jdbcType="VARCHAR" property="icCardNo" /> |
| | | <result column="total_amount" jdbcType="DOUBLE" property="totalAmount" /> |
| | | <result column="instant_amount" jdbcType="DOUBLE" property="instantAmount" /> |
| | | <result column="remain_money" jdbcType="DOUBLE" property="remainMoney" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, ic_card_no, total_amount, instant_amount, |
| | | remain_money, rtu_dt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_work_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_work_report_last |
| | | where rtu_addr = #{rtuAddr,jdbcType=VARCHAR} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_work_report_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_work_report_last (id, controller_id, intake_id, |
| | | rtu_addr, dt, ic_card_no, |
| | | total_amount, instant_amount, remain_money, |
| | | rtu_dt) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{icCardNo,jdbcType=VARCHAR}, |
| | | #{totalAmount,jdbcType=DOUBLE}, #{instantAmount,jdbcType=DOUBLE}, #{remainMoney,jdbcType=DOUBLE}, |
| | | #{rtuDt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_work_report_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="icCardNo != null"> |
| | | ic_card_no, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount, |
| | | </if> |
| | | <if test="remainMoney != null"> |
| | | remain_money, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </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=TIMESTAMP}, |
| | | </if> |
| | | <if test="icCardNo != null"> |
| | | #{icCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | #{totalAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | #{instantAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="remainMoney != null"> |
| | | #{remainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_work_report_last |
| | | <set> |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="icCardNo != null"> |
| | | ic_card_no = #{icCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount = #{totalAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount = #{instantAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="remainMoney != null"> |
| | | remain_money = #{remainMoney,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmWorkReportLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_work_report_last |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | ic_card_no = #{icCardNo,jdbcType=VARCHAR}, |
| | | total_amount = #{totalAmount,jdbcType=DOUBLE}, |
| | | instant_amount = #{instantAmount,jdbcType=DOUBLE}, |
| | | remain_money = #{remainMoney,jdbcType=DOUBLE}, |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private RmOpenCloseValveLastMapper rmOpenCloseValveLastMapperDao ;//控制器最新开关阀上报数据DAO |
| | | @Autowired |
| | | private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapperDao ;//控制器历史开关阀上报数据DAO |
| | | @Autowired |
| | | private RmWorkReportLastMapper rmWorkReportLastMapperDao ;//控制器最新工作报数据DAO |
| | | @Autowired |
| | | private RmWorkReportHistoryMapper rmWorkReportHistoryMapperDao ;//控制器历史工作报数据DAO |
| | | @Autowired |
| | | private RmLossLastMapper rmLossLastMapperDao ;//控制器漏损水量统计最新数据DAO |
| | | @Autowired |
| | | private RmLossHistoryMapper rmLossHistoryMapperDao ;//控制器漏损水量统计历史数据DAO |
| | | |
| | | //@Autowired |
| | | //@Lazy |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmAlarmStateLast(RmAlarmStateLast po){ |
| | | this.rmAlarmStateLastMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器报警与状态最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmAlarmStateLast(RmAlarmStateLast po){ |
| | | this.rmAlarmStateLastMapperDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器报警与状态历史记录 |
| | |
| | | this.rmOpenCloseValveHistoryMapperDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | |
| | | |
| | | |
| | | ///////////////////////////////////////////////// |
| | | // |
| | | // 工作报数据功能 |
| | | // |
| | | //////////////////////////////////////////////// |
| | | /** |
| | | * 得到控制器上报数据最新记录 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | public RmWorkReportLast getRmWorkReportLast(String rtuAddr){ |
| | | List<RmWorkReportLast> list = rmWorkReportLastMapperDao.selectByRtuAddr(rtuAddr) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存控制器上报数据最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmWorkReportLast(RmWorkReportLast po){ |
| | | this.rmWorkReportLastMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器上报数据最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmWorkReportLast(RmWorkReportLast po){ |
| | | this.rmWorkReportLastMapperDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器上报数据历史记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmWorkReportHistory(RmWorkReportHistory po){ |
| | | this.rmWorkReportHistoryMapperDao.insert(po) ; |
| | | } |
| | | |
| | | |
| | | ///////////////////////////////////////////////// |
| | | // |
| | | // 漏损水量统计功能 |
| | | // |
| | | //////////////////////////////////////////////// |
| | | /** |
| | | * 得到控制器漏损水量统计最新记录 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | public RmLossLast getRmLossLast(String rtuAddr){ |
| | | List<RmLossLast> list = rmLossLastMapperDao.selectByRtuAddr(rtuAddr) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | /** |
| | | * 保存控制器漏损水量统计最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmLossLast(RmLossLast po){ |
| | | this.rmLossLastMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器漏损水量统计最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmLossHistory(RmLossHistory po){ |
| | | this.rmLossHistoryMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器漏损水量统计最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmLossLast(RmLossLast po){ |
| | | this.rmLossLastMapperDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | /** |
| | | * 保存控制器漏损水量统计最新记录 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmLossHistory(RmLossHistory po){ |
| | | this.rmLossHistoryMapperDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | |
| | | /** |
| | | * 得到控制器漏损水量统计历史记录中的最新记录 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public RmLossHistory getRmLossHistory(Long id){ |
| | | return rmLossHistoryMapperDao.selectByPrimaryKey(id) ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 得到控制器漏损水量统计最新记录 |
| | | * @param dt |
| | | * @return |
| | | */ |
| | | public RmLossLast getRmLossLastByDate(Date dt){ |
| | | List<RmLossLast> list = rmLossLastMapperDao.selectByDate(dt) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | /** |
| | | * 得到控制器漏损水量统计历史记录中的某日记录 |
| | | * @param dt |
| | | * @return |
| | | */ |
| | | public RmLossHistory getRmLossHistoryByDate(Date dt){ |
| | | List<RmLossHistory> list = rmLossHistoryMapperDao.selectByDate(dt) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return 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, dV1_0_1.dataCd81Vo.alarmVo, dV1_0_1.dataCd81Vo.stateVo) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCd81Vo.alarmVo, dV1_0_1.dataCd81Vo.stateVo) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), dV1_0_1.dataCd81Vo.rtuDt, dV1_0_1, dV1_0_1.dataCd81Vo.alarmVo, dV1_0_1.dataCd81Vo.stateVo) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), dV1_0_1.dataCd81Vo.rtuDt, dV1_0_1, 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, dV1_0_1.dataCdC0Vo.alarmVo, dV1_0_1.dataCdC0Vo.stateVo) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCdC0Vo.alarmVo, dV1_0_1.dataCdC0Vo.stateVo) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), dV1_0_1.dataCdC0Vo.rtuDt, dV1_0_1, dV1_0_1.dataCdC0Vo.alarmVo, dV1_0_1.dataCdC0Vo.stateVo) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), dV1_0_1.dataCdC0Vo.rtuDt, dV1_0_1, dV1_0_1.dataCdC0Vo.alarmVo, dV1_0_1.dataCdC0Vo.stateVo) ; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param alarmVo 报警对象 |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | 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, dV1_0_1, alarmVo, stateVo) ; |
| | | sv.saveRmAlarmStateLast(po); |
| | | po = this.update(controller, po, rtuDt, dV1_0_1, alarmVo, stateVo) ; |
| | | sv.updateRmAlarmStateLast(po); |
| | | } |
| | | } |
| | | |
| | |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param alarmVo 报警对象 |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | 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) ; |
| | | } |
| | | |
| | | |
| | | private RmAlarmStateLast update(PrController controller, RmAlarmStateLast po, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | 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 ; |
| | |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 14:11 |
| | | * @LastEditTime 2024/1/16 14:11 |
| | | * @Description |
| | | * @Description 控制器自报数据(功能码为C0)(整点上报) |
| | | */ |
| | | public class TkDealAutoReport extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealAlarmStatus.class.getName()) ; |
| | | private static final Logger log = LogManager.getLogger(TkDealAutoReport.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealAlarmStatus" ; |
| | | public static final String taskId = "TkDealAutoReport" ; |
| | | |
| | | /** |
| | | * 执行节点任务:控制器自报数据(功能码为C0) |
| | |
| | | dataCdC0Vo.waterPress, dataCdC0Vo.batteryVolt, dataCdC0Vo.sunVolt, dataCdC0Vo.signalValue) ; |
| | | sv.saveRmAutoReportLast(po) ; |
| | | }else{ |
| | | po = this.update(po, dV1_0_1, dataCdC0Vo) ; |
| | | po = this.update(controller, po, dV1_0_1, dataCdC0Vo) ; |
| | | sv.updateRmAutoReportLast(po); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private RmAutoReportLast update(RmAutoReportLast po, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo) throws Exception { |
| | | private RmAutoReportLast update(PrController controller, RmAutoReportLast po, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo) 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(dataCdC0Vo.rtuDt) ; |
| | | po.instantamount = dataCdC0Vo.instantAmount; |
| | |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | try{ |
| | | this.dealSave(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCd83CloseVo) ; |
| | | this.doDeal(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCd83CloseVo) ; |
| | | }catch (Exception e){ |
| | | log.error("保存控制器关阀上报时发生异常", e); |
| | | } |
| | |
| | | * @param dV1_0_1 上报数据 |
| | | * @param dataCd83CloseVo 关阀上报数据对象 |
| | | */ |
| | | private void dealSave(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd83CloseVo dataCd83CloseVo) throws Exception { |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd83CloseVo dataCd83CloseVo) throws Exception { |
| | | RmOpenCloseValveLast poLast = sv.getRmOpenCloseValveLast(rtuAddr) ; |
| | | if(poLast == null){ |
| | | //首先生成最新数据及历史数据,并先保存历史数据 |
| | |
| | | //}else{ |
| | | if(poLast.clType == null){ |
| | | //原记录不存在关阀数据,所以当前关阀上报是新的一次关阀,保留原记录开阀数据 |
| | | this.updateCloseValve(poLast, null, dV1_0_1, dataCd83CloseVo, false) ; |
| | | this.updateCloseValve(controller, poLast, null, dV1_0_1, dataCd83CloseVo, false) ; |
| | | if(poLast.opType == null){ |
| | | //原记录中不存在开阀数据,没办进行匹配 |
| | | //生成并保存新的关阀上报历史数据记录 |
| | |
| | | }else{ |
| | | //if(po.opType == null) |
| | | //原记录不存在开阀数据也不存在关阀数据,这种情况不存在,但为安全也进行处理 |
| | | this.updateCloseValve(poLast, null, dV1_0_1, dataCd83CloseVo, false) ; |
| | | this.updateCloseValve(controller,poLast, null, dV1_0_1, dataCd83CloseVo, false) ; |
| | | //生成并保存新的关阀上报历史数据记录 |
| | | this.newHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCd83CloseVo, poLast); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 更新数据 |
| | | * @param controller |
| | | * @param poLast |
| | | * @param poHistory |
| | | * @param dV1_0_1 |
| | |
| | | * @param clearOpenValve |
| | | * @throws Exception |
| | | */ |
| | | private void updateCloseValve(RmOpenCloseValveLast poLast, RmOpenCloseValveHistory poHistory, DataV1_0_1 dV1_0_1, DataCd83CloseVo dataCd83CloseVo, boolean clearOpenValve) throws Exception { |
| | | private void updateCloseValve(PrController controller, RmOpenCloseValveLast poLast, RmOpenCloseValveHistory poHistory, DataV1_0_1 dV1_0_1, DataCd83CloseVo dataCd83CloseVo, boolean clearOpenValve) throws Exception { |
| | | poLast.controllerId = controller==null?null:controller.getId(); |
| | | poLast.intakeId = controller==null?null:controller.getIntakeId(); |
| | | |
| | | poLast.clDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt); |
| | | poLast.clType = dataCd83CloseVo.type; |
| | | poLast.clTotalAmount = dataCd83CloseVo.totalAmount; |
| | |
| | | poLast.closeDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83CloseVo.closeDt) ; |
| | | |
| | | if(poHistory != null){ |
| | | poHistory.controllerId = controller==null?null:controller.getId(); |
| | | poHistory.intakeId = controller==null?null:controller.getIntakeId(); |
| | | |
| | | poHistory.clDt = poLast.clDt; |
| | | poHistory.clType = dataCd83CloseVo.type; |
| | | poHistory.clTotalAmount = dataCd83CloseVo.totalAmount; |
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.RmLossHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossLast; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/2/28 16:31 |
| | | * @LastEditTime 2024/2/28 16:31 |
| | | * @Description 控制器漏损统计 |
| | | */ |
| | | public class TkDealLoss extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealLoss.class.getName()); |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealLoss"; |
| | | |
| | | /** |
| | | * 执行节点任务: 处理控制器漏损统计 |
| | | * |
| | | * @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.doDeal(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCdC0Vo); |
| | | } catch (Exception e) { |
| | | log.error("保存控制器开阀上报时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 业务处理 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dV1_0_1 上报数据 |
| | | * @param dataCdC0Vo 开阀上报数据对象 |
| | | */ |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo) throws Exception { |
| | | RmLossLast poLast = sv.getRmLossLast(rtuAddr); |
| | | if (poLast == null) { |
| | | //首先生成历史数据,并保存 |
| | | poLast = this.newRmLossLast(controller, rtuAddr, dV1_0_1, dataCdC0Vo); |
| | | this.newAndSaveHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCdC0Vo, poLast); |
| | | sv.saveRmLossLast(poLast); |
| | | } else { |
| | | if(DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt).equals(poLast.dtRtu)){ |
| | | //时间一致,重复上报数据,不进行任何处理 |
| | | }else{ |
| | | RmLossHistory poHistory = null ; |
| | | if(poLast.lastHistoryId != null){ |
| | | poHistory = sv.getRmLossHistory(poLast.lastHistoryId) ; |
| | | } |
| | | if(poHistory == null){ |
| | | poHistory = this.newAndSaveHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCdC0Vo, poLast); |
| | | } |
| | | if(DateTime.dateFrom_yyyy_MM_dd1(dV1_0_1.dt).equals(poLast.dt)){ |
| | | //同一天数据 |
| | | poLast.lossAmount = (poLast.lossAmount == null?0.0:poLast.lossAmount) + (dataCdC0Vo.lossAmount == null?0.0:dataCdC0Vo.lossAmount) ; |
| | | poLast.dtLast = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | poLast.dtRtu = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt) ; |
| | | sv.updateRmLossLast(poLast); |
| | | |
| | | poHistory.lossAmount = (poLast.lossAmount == null?0.0:poLast.lossAmount) + (dataCdC0Vo.lossAmount == null?0.0:dataCdC0Vo.lossAmount) ; |
| | | poHistory.dtLast = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | poHistory.dtRtu = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt) ; |
| | | sv.updateRmLossHistory(poHistory); |
| | | }else if(DateTime.dateFrom_yyyy_MM_dd1(dV1_0_1.dt).after(poLast.dt)){ |
| | | //新的日期 |
| | | poLast = this.newRmLossLast(controller, rtuAddr, dV1_0_1, dataCdC0Vo); |
| | | this.newAndSaveHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCdC0Vo, poLast); |
| | | sv.saveRmLossLast(poLast); |
| | | }else{ |
| | | //这种情况不存在(收到数据的日期早于本地记录中的日期,此种情况不会存在) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成新的控制器漏损日统计最新记录 |
| | | * @param controller |
| | | * @param rtuAddr |
| | | * @param dV1_0_1 |
| | | * @param dataCdC0Vo |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private RmLossLast newRmLossLast(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo)throws Exception { |
| | | RmLossLast po = new RmLossLast(null, null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd1(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt), |
| | | dataCdC0Vo.lossAmount) ; |
| | | return po ; |
| | | } |
| | | |
| | | /** |
| | | * 生成新的控制器漏损日统计历史记录 |
| | | * @param controller |
| | | * @param rtuAddr |
| | | * @param dV1_0_1 |
| | | * @param dataCdC0Vo |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private RmLossHistory newRmLossHistory(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo)throws Exception { |
| | | RmLossHistory po = new RmLossHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd1(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt), |
| | | dataCdC0Vo.lossAmount) ; |
| | | return po ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存新的开阀上报历史数据记录,并把ID赋值给最新记录的 lastHistoryId |
| | | * @param sv |
| | | * @param controller |
| | | * @param rtuAddr |
| | | * @param dV1_0_1 |
| | | * @param dataCdC0Vo |
| | | * @param poLast |
| | | * @throws Exception |
| | | * @return RmLossHistory |
| | | */ |
| | | private RmLossHistory newAndSaveHistoryDataDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo, RmLossLast poLast)throws Exception { |
| | | RmLossHistory poHistory = this.newRmLossHistory(controller, rtuAddr, dV1_0_1, dataCdC0Vo) ; |
| | | sv.saveRmLossHistory(poHistory); |
| | | //由最新数据持有历史数据中的最新记录ID,以方便快速查询 |
| | | poLast.lastHistoryId = poHistory == null ? null: poHistory.id ; |
| | | return poHistory ; |
| | | } |
| | | |
| | | } |
| | |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | try{ |
| | | this.dealSave(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCd83OpenVo) ; |
| | | this.doDeal(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCd83OpenVo) ; |
| | | }catch (Exception e){ |
| | | log.error("保存控制器开阀上报时发生异常", e); |
| | | } |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 保存数据 |
| | | * 业务处理 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dV1_0_1 上报数据 |
| | | * @param dataCd83OpenVo 开阀上报数据对象 |
| | | */ |
| | | private void dealSave(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo) throws Exception { |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo) throws Exception { |
| | | RmOpenCloseValveLast poLast = sv.getRmOpenCloseValveLast(rtuAddr) ; |
| | | if(poLast == null){ |
| | | //首先生成历史数据,并保存 |
| | |
| | | //重复上报的开阀数据,不进行处理 |
| | | }else{ |
| | | //当前开阀上报是新的一次开阀,不管原记录是否存在关阀数据,一律清空关阀数据 |
| | | this.updateOpenValve(poLast, null, dV1_0_1, dataCd83OpenVo, true) ; |
| | | this.updateOpenValve(controller, poLast, null, dV1_0_1, dataCd83OpenVo, true) ; |
| | | //生成并保存新的开阀上报历史数据记录 |
| | | this.newHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCd83OpenVo, poLast); |
| | | } |
| | |
| | | if(poLast.lastHistoryId != null){ |
| | | poHistory = sv.getRmOpenCloseValveHistory(poLast.lastHistoryId) ; |
| | | } |
| | | this.updateOpenValve(poLast, poHistory, dV1_0_1, dataCd83OpenVo, false) ; |
| | | this.updateOpenValve(controller, poLast, poHistory, dV1_0_1, dataCd83OpenVo, false) ; |
| | | if(poHistory != null){ |
| | | sv.updateRmOpenCloseValveHistory(poHistory); |
| | | } |
| | | }else if(poLast.closeDt != null && poLast.closeDt.before(DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt))){ |
| | | //当前上报是新的开阀数据 |
| | | this.updateOpenValve(poLast, null, dV1_0_1, dataCd83OpenVo, true) ; |
| | | this.updateOpenValve(controller, poLast, null, dV1_0_1, dataCd83OpenVo, true) ; |
| | | //生成并保存新的开阀上报历史数据记录 |
| | | this.newHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCd83OpenVo, poLast); |
| | | }else { |
| | |
| | | if(poLast.lastHistoryId != null){ |
| | | poHistory = sv.getRmOpenCloseValveHistory(poLast.lastHistoryId) ; |
| | | } |
| | | this.updateOpenValve(poLast, poHistory, dV1_0_1, dataCd83OpenVo, false) ; |
| | | this.updateOpenValve(controller, poLast, poHistory, dV1_0_1, dataCd83OpenVo, false) ; |
| | | if(poHistory != null){ |
| | | sv.updateRmOpenCloseValveHistory(poHistory); |
| | | } |
| | |
| | | }else{ |
| | | //if(po.clType == null) |
| | | //原记录不存在开阀数据也不存在关阀数据,这种情况不存在,但为安全也进行处理 |
| | | this.updateOpenValve(poLast, null, dV1_0_1, dataCd83OpenVo, true) ; |
| | | this.updateOpenValve(controller, poLast, null, dV1_0_1, dataCd83OpenVo, true) ; |
| | | //生成并保存新的开阀上报历史数据记录 |
| | | this.newHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCd83OpenVo, poLast); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 更新数据 |
| | | * @param controller |
| | | * @param poLast |
| | | * @param poHistory |
| | | * @param dV1_0_1 |
| | |
| | | * @param clearCloseValve |
| | | * @throws Exception |
| | | */ |
| | | private void updateOpenValve(RmOpenCloseValveLast poLast, RmOpenCloseValveHistory poHistory, DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo, boolean clearCloseValve) throws Exception { |
| | | private void updateOpenValve(PrController controller, RmOpenCloseValveLast poLast, RmOpenCloseValveHistory poHistory, DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo, boolean clearCloseValve) throws Exception { |
| | | poLast.controllerId = controller==null?null:controller.getId(); |
| | | poLast.intakeId = controller==null?null:controller.getIntakeId(); |
| | | |
| | | poLast.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt); |
| | | poLast.opType = dataCd83OpenVo.type ; |
| | | poLast.opTotalAmount = dataCd83OpenVo.totalAmount ; |
| | |
| | | poLast.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt) ; |
| | | |
| | | if(poHistory != null){ |
| | | poHistory.controllerId = controller==null?null:controller.getId(); |
| | | poHistory.intakeId = controller==null?null:controller.getIntakeId(); |
| | | |
| | | poHistory.opDt = poLast.opDt; |
| | | poHistory.opType = dataCd83OpenVo.type ; |
| | | poHistory.opTotalAmount = dataCd83OpenVo.totalAmount ; |
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.DataCd84Vo; |
| | | 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.RmAlarmStateLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWorkReportHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWorkReportLast; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/2/27 14:20 |
| | | * @LastEditTime 2024/2/27 14:20 |
| | | * @Description 开阀工作报 |
| | | */ |
| | | public class TkDealWorkReport extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealWorkReport.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealWorkReport" ; |
| | | |
| | | /** |
| | | * 执行节点任务: 处理控制器开阀上报 |
| | | * @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.dataCd84Vo != null) { |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | try{ |
| | | this.doDeal(sv, controller, d.getRtuAddr(), dV1_0_1, dV1_0_1.dataCd84Vo) ; |
| | | }catch (Exception e){ |
| | | log.error("保存控制器开阀工作报时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 处理开阀工作报数据 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dataCd84Vo 工作报数据对象 |
| | | */ |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd84Vo dataCd84Vo) throws Exception { |
| | | this.saveLast(sv, controller, rtuAddr, dV1_0_1, dataCd84Vo); |
| | | this.saveHistory(sv, controller, rtuAddr, dV1_0_1, dataCd84Vo); |
| | | } |
| | | |
| | | /** |
| | | * 保存开阀工作报最新数据 |
| | | * @param sv |
| | | * @param controller |
| | | * @param rtuAddr |
| | | * @param dV1_0_1 |
| | | * @param dataCd84Vo |
| | | */ |
| | | private void saveLast(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd84Vo dataCd84Vo) throws Exception { |
| | | RmWorkReportLast po = sv.getRmWorkReportLast(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmWorkReportLast(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(dataCd84Vo.rtuDt), |
| | | dataCd84Vo.cardNo, |
| | | dataCd84Vo.totalAmount, |
| | | dataCd84Vo.instantAmount, |
| | | dataCd84Vo.remainMoney) ; |
| | | sv.saveRmWorkReportLast(po) ; |
| | | }else{ |
| | | 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(dataCd84Vo.rtuDt); |
| | | po.icCardNo = dataCd84Vo.cardNo; |
| | | po.totalAmount = dataCd84Vo.totalAmount; |
| | | po.instantAmount = dataCd84Vo.instantAmount; |
| | | po.remainMoney = dataCd84Vo.remainMoney; |
| | | sv.updateRmWorkReportLast(po); |
| | | } |
| | | } |
| | | /** |
| | | * 保存开阀工作报历史数据 |
| | | * @param sv |
| | | * @param controller |
| | | * @param rtuAddr |
| | | * @param dV1_0_1 |
| | | * @param dataCd84Vo |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd84Vo dataCd84Vo) throws Exception { |
| | | RmWorkReportHistory po = new RmWorkReportHistory(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(dataCd84Vo.rtuDt), |
| | | dataCd84Vo.cardNo, |
| | | dataCd84Vo.totalAmount, |
| | | dataCd84Vo.instantAmount, |
| | | dataCd84Vo.remainMoney) ; |
| | | sv.saveRmWorkReportHistory(po) ; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <!-- 识别主动上报数据 --> |
| | | <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 id="TkDealOpenValveReport" name="控制器开阀上报" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealOpenValveReport" /> |
| | | <task id="TkDealCloseValveReport" name="控制器关阀上报" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealCloseValveReport" /> |
| | | <task id="TkDealAutoReport" name="控制器自报数据(整点报)" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealAutoReport" /> |
| | | <task id="TkDealWorkReport" name="控制器开阀工作上报" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealWorkReport" /> |
| | | <task id="TkDealOpenValveReport" name="控制器开阀上报(待新协议出来后修改实现)" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealOpenValveReport" /> |
| | | <task id="TkDealCloseValveReport" name="控制器关阀上报(待新协议出来后修改实现)" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealCloseValveReport" /> |
| | | <task id="TkDealLoss" name="控制器漏损统计(待新协议出来后修改实现)" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkDealLoss" /> |
| | | </task> |
| | | <!-- 识别命令响应数据 --> |
| | | <task id="TkFindComResponse" name="识别响应命令数据" enable="true" class="com.dy.aceMw.server.rtuData.p206V1_0_0.TkFindComResponse"> |