2024-06-20 朱宝民 开关阀上报数据处理(基本功能)
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-06-20 10:34 |
| | | * @LastEditTime 2024-06-20 10:34 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface RmOpenCloseHistoryMapper extends BaseMapper<RmOpenCloseHistory> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmOpenCloseHistory record); |
| | | |
| | | int insertSelective(RmOpenCloseHistory record); |
| | | |
| | | RmOpenCloseHistory selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(RmOpenCloseHistory record); |
| | | |
| | | int updateByPrimaryKey(RmOpenCloseHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-06-20 10:34 |
| | | * @LastEditTime 2024-06-20 10:34 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface RmOpenCloseLastMapper extends BaseMapper<RmOpenCloseLast> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmOpenCloseLast record); |
| | | |
| | | int insertSelective(RmOpenCloseLast record); |
| | | |
| | | RmOpenCloseLast selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(RmOpenCloseLast record); |
| | | |
| | | int updateByPrimaryKey(RmOpenCloseLast record); |
| | | |
| | | /** |
| | | * 根据阀控器地址获取开关阀上报最新数据 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | List<RmOpenCloseLast> getRmOpenCloseReportLast(String rtuAddr); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd84Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd85Vo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.dy.common.util.DateTime; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-06-20 10:34 |
| | | * @LastEditTime 2024-06-20 10:34 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 开关阀报历史数据表 |
| | | */ |
| | | |
| | | @TableName(value="rm_open_close_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "开关阀报历史数据表") |
| | | public class RmOpenCloseHistory implements BaseEntity { |
| | | public static final long serialVersionUID = 202406201040001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | public String rtuAddr; |
| | | |
| | | /** |
| | | * 开阀数据接收日期时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date opDt; |
| | | |
| | | /** |
| | | * 开阀控制器时钟 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date opRtuDt; |
| | | |
| | | /** |
| | | * IC卡地址(远程关闭时为0) |
| | | */ |
| | | public String opIcCardAddr; |
| | | |
| | | /** |
| | | * IC卡编号(17位数字) |
| | | */ |
| | | public String opIcCardNo; |
| | | |
| | | /** |
| | | * 开阀订单号(16位数字) |
| | | */ |
| | | public String opOrderNo; |
| | | |
| | | /** |
| | | * 开泵/阀时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date openDt; |
| | | |
| | | /** |
| | | * 开阀水表累计水量 |
| | | */ |
| | | public Double opWaterTotalAmount; |
| | | |
| | | /** |
| | | * 开阀电表累计电量 |
| | | */ |
| | | public Double opEleTotalAmount; |
| | | |
| | | /** |
| | | * 开阀用户剩余金额 |
| | | */ |
| | | public Double opMoneyRemainUser; |
| | | |
| | | /** |
| | | * 开阀用户剩余水量 |
| | | */ |
| | | public Double opWaterRemainUser; |
| | | |
| | | /** |
| | | * 关泵/阀方式 |
| | | */ |
| | | public Byte opType; |
| | | |
| | | /** |
| | | * 关阀IC卡地址(远程关闭时为0) |
| | | */ |
| | | public String clIcCardAddr; |
| | | |
| | | /** |
| | | * 关阀IC卡编号(17位数字) |
| | | */ |
| | | public String clIcCardNo; |
| | | |
| | | /** |
| | | * 关阀订单号(16位数字) |
| | | */ |
| | | public String clOrderNo; |
| | | |
| | | /** |
| | | * 开始时间(分时日月) |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date startDt; |
| | | |
| | | /** |
| | | * 结束时间(分时日月) |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date endDt; |
| | | |
| | | /** |
| | | * 水表累计流量 |
| | | */ |
| | | public Double clWaterTotalAmount; |
| | | |
| | | /** |
| | | * 电表累计电量 |
| | | */ |
| | | public Double clEleTotalAmount; |
| | | |
| | | /** |
| | | * 用户剩余金额 |
| | | */ |
| | | public Double clMoneyRemainUser; |
| | | |
| | | /** |
| | | * 用户剩余水量 |
| | | */ |
| | | public Double clWaterRemainUser; |
| | | |
| | | /** |
| | | * 本次使用电量 |
| | | */ |
| | | public Double thisEle; |
| | | |
| | | /** |
| | | * 本次使用水量 |
| | | */ |
| | | public Double thisWater; |
| | | |
| | | /** |
| | | * 本次使用金额 |
| | | */ |
| | | public Double thisMoney; |
| | | |
| | | /** |
| | | * 本次使用时间长 |
| | | */ |
| | | public Integer thisDuration; |
| | | |
| | | public void valueFrom84(DataV202404 dataV202404, DataCd84Vo cdData) throws Exception{ |
| | | this.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataV202404.dt); |
| | | this.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.opDt); |
| | | //this.opRtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.opDt); |
| | | this.opIcCardAddr = cdData.icCardAddr; |
| | | this.opIcCardNo = cdData.icCardNo; |
| | | this.opOrderNo = cdData.orderNo; |
| | | this.opWaterTotalAmount = cdData.waterTotalAmount; |
| | | this.opEleTotalAmount = cdData.eleTotalAmount; |
| | | this.opMoneyRemainUser = cdData.moneyRemainUser; |
| | | this.opWaterRemainUser = cdData.waterRemainUser; |
| | | } |
| | | |
| | | public void valueFrom85(DataV202404 dataV202404, DataCd85Vo cdData) throws Exception{ |
| | | this.startDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.startDt); |
| | | this.endDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.endDt); |
| | | this.opType = cdData.opType; |
| | | this.clIcCardAddr = cdData.icCardAddr; |
| | | this.clIcCardNo = cdData.icCardNo; |
| | | this.clOrderNo = cdData.orderNo; |
| | | this.clWaterTotalAmount = cdData.waterTotalAmount; |
| | | this.clEleTotalAmount = cdData.eleTotalAmount; |
| | | this.clMoneyRemainUser = cdData.moneyRemain; |
| | | this.clWaterRemainUser = cdData.waterRemain; |
| | | this.thisEle = cdData.thisEle; |
| | | this.thisWater = cdData.thisWater; |
| | | this.thisMoney = cdData.thisMoney; |
| | | this.thisDuration = cdData.thisDuration; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd84Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd85Vo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.dy.common.util.DateTime; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-06-20 10:34 |
| | | * @LastEditTime 2024-06-20 10:34 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 开关阀报最新数据表 |
| | | */ |
| | | |
| | | @TableName(value="rm_open_close_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "开关阀报最新数据表") |
| | | public class RmOpenCloseLast implements BaseEntity { |
| | | public static final long serialVersionUID = 202406201041001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | public String rtuAddr; |
| | | |
| | | /** |
| | | * 开阀数据接收日期时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date opDt; |
| | | |
| | | /** |
| | | * 开阀控制器时钟 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date opRtuDt; |
| | | |
| | | /** |
| | | * IC卡地址(远程关闭时为0) |
| | | */ |
| | | public String opIcCardAddr; |
| | | |
| | | /** |
| | | * IC卡编号(17位数字) |
| | | */ |
| | | public String opIcCardNo; |
| | | |
| | | /** |
| | | * 开阀订单号(16位数字) |
| | | */ |
| | | public String opOrderNo; |
| | | |
| | | /** |
| | | * 开泵/阀时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date openDt; |
| | | |
| | | /** |
| | | * 开阀水表累计水量 |
| | | */ |
| | | public Double opWaterTotalAmount; |
| | | |
| | | /** |
| | | * 开阀电表累计电量 |
| | | */ |
| | | public Double opEleTotalAmount; |
| | | |
| | | /** |
| | | * 开阀用户剩余金额 |
| | | */ |
| | | public Double opMoneyRemainUser; |
| | | |
| | | /** |
| | | * 开阀用户剩余水量 |
| | | */ |
| | | public Double opWaterRemainUser; |
| | | |
| | | /** |
| | | * 关泵/阀方式 |
| | | */ |
| | | public Byte opType; |
| | | |
| | | /** |
| | | * 关阀IC卡地址(远程关闭时为0) |
| | | */ |
| | | public String clIcCardAddr; |
| | | |
| | | /** |
| | | * 关阀IC卡编号(17位数字) |
| | | */ |
| | | public String clIcCardNo; |
| | | |
| | | /** |
| | | * 关阀订单号(16位数字) |
| | | */ |
| | | public String clOrderNo; |
| | | |
| | | /** |
| | | * 开始时间(分时日月) |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date startDt; |
| | | |
| | | /** |
| | | * 结束时间(分时日月) |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date endDt; |
| | | |
| | | /** |
| | | * 水表累计流量 |
| | | */ |
| | | public Double clWaterTotalAmount; |
| | | |
| | | /** |
| | | * 电表累计电量 |
| | | */ |
| | | public Double clEleTotalAmount; |
| | | |
| | | /** |
| | | * 用户剩余金额 |
| | | */ |
| | | public Double clMoneyRemainUser; |
| | | |
| | | /** |
| | | * 用户剩余水量 |
| | | */ |
| | | public Double clWaterRemainUser; |
| | | |
| | | /** |
| | | * 本次使用电量 |
| | | */ |
| | | public Double thisEle; |
| | | |
| | | /** |
| | | * 本次使用水量 |
| | | */ |
| | | public Double thisWater; |
| | | |
| | | /** |
| | | * 本次使用金额 |
| | | */ |
| | | public Double thisMoney; |
| | | |
| | | /** |
| | | * 本次使用时间长 |
| | | */ |
| | | public Integer thisDuration; |
| | | |
| | | public void valueFrom84(DataV202404 dataV202404, DataCd84Vo cdData) throws Exception{ |
| | | this.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataV202404.dt); |
| | | this.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.opDt); |
| | | //this.opRtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.opDt); |
| | | this.opIcCardAddr = cdData.icCardAddr; |
| | | this.opIcCardNo = cdData.icCardNo; |
| | | this.opOrderNo = cdData.orderNo; |
| | | this.opWaterTotalAmount = cdData.waterTotalAmount; |
| | | this.opEleTotalAmount = cdData.eleTotalAmount; |
| | | this.opMoneyRemainUser = cdData.moneyRemainUser; |
| | | this.opWaterRemainUser = cdData.waterRemainUser; |
| | | } |
| | | |
| | | public void valueFrom85(DataV202404 dataV202404, DataCd85Vo cdData) throws Exception{ |
| | | this.startDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.startDt); |
| | | this.endDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.endDt); |
| | | this.opType = cdData.opType; |
| | | this.clIcCardAddr = cdData.icCardAddr; |
| | | this.clIcCardNo = cdData.icCardNo; |
| | | this.clOrderNo = cdData.orderNo; |
| | | this.clWaterTotalAmount = cdData.waterTotalAmount; |
| | | this.clEleTotalAmount = cdData.eleTotalAmount; |
| | | this.clMoneyRemainUser = cdData.moneyRemain; |
| | | this.clWaterRemainUser = cdData.waterRemain; |
| | | this.thisEle = cdData.thisEle; |
| | | this.thisWater = cdData.thisWater; |
| | | this.thisMoney = cdData.thisMoney; |
| | | this.thisDuration = cdData.thisDuration; |
| | | } |
| | | } |
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.RmOpenCloseHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_open_close_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="op_dt" jdbcType="TIMESTAMP" property="opDt" /> |
| | | <result column="op_rtu_dt" jdbcType="TIMESTAMP" property="opRtuDt" /> |
| | | <result column="op_ic_card_addr" jdbcType="VARCHAR" property="opIcCardAddr" /> |
| | | <result column="op_ic_card_no" jdbcType="VARCHAR" property="opIcCardNo" /> |
| | | <result column="op_order_no" jdbcType="VARCHAR" property="opOrderNo" /> |
| | | <result column="open_dt" jdbcType="TIMESTAMP" property="openDt" /> |
| | | <result column="op_water_total_amount" jdbcType="FLOAT" property="opWaterTotalAmount" /> |
| | | <result column="op_ele_total_amount" jdbcType="FLOAT" property="opEleTotalAmount" /> |
| | | <result column="op_money_remain_user" jdbcType="FLOAT" property="opMoneyRemainUser" /> |
| | | <result column="op_water_remain_user" jdbcType="FLOAT" property="opWaterRemainUser" /> |
| | | <result column="op_type" jdbcType="TINYINT" property="opType" /> |
| | | <result column="cl_ic_card_addr" jdbcType="VARCHAR" property="clIcCardAddr" /> |
| | | <result column="cl_ic_card_no" jdbcType="VARCHAR" property="clIcCardNo" /> |
| | | <result column="cl_order_no" jdbcType="VARCHAR" property="clOrderNo" /> |
| | | <result column="start_dt" jdbcType="TIMESTAMP" property="startDt" /> |
| | | <result column="end_dt" jdbcType="TIMESTAMP" property="endDt" /> |
| | | <result column="cl_water_total_amount" jdbcType="FLOAT" property="clWaterTotalAmount" /> |
| | | <result column="cl_ele_total_amount" jdbcType="FLOAT" property="clEleTotalAmount" /> |
| | | <result column="cl_money_remain_user" jdbcType="FLOAT" property="clMoneyRemainUser" /> |
| | | <result column="cl_water_remain_user" jdbcType="FLOAT" property="clWaterRemainUser" /> |
| | | <result column="this_ele" jdbcType="FLOAT" property="thisEle" /> |
| | | <result column="this_water" jdbcType="FLOAT" property="thisWater" /> |
| | | <result column="this_money" jdbcType="FLOAT" property="thisMoney" /> |
| | | <result column="this_duration" jdbcType="INTEGER" property="thisDuration" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, op_dt, op_rtu_dt, op_ic_card_addr, op_ic_card_no, |
| | | op_order_no, open_dt, op_water_total_amount, op_ele_total_amount, op_money_remain_user, |
| | | op_water_remain_user, op_type, cl_ic_card_addr, cl_ic_card_no, cl_order_no, start_dt, |
| | | end_dt, cl_water_total_amount, cl_ele_total_amount, cl_money_remain_user, cl_water_remain_user, |
| | | this_ele, this_water, this_money, this_duration |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_open_close_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_open_close_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_open_close_history (id, controller_id, intake_id, |
| | | rtu_addr, op_dt, op_rtu_dt, |
| | | op_ic_card_addr, op_ic_card_no, op_order_no, |
| | | open_dt, op_water_total_amount, op_ele_total_amount, |
| | | op_money_remain_user, op_water_remain_user, op_type, |
| | | cl_ic_card_addr, cl_ic_card_no, cl_order_no, |
| | | start_dt, end_dt, cl_water_total_amount, |
| | | cl_ele_total_amount, cl_money_remain_user, cl_water_remain_user, |
| | | this_ele, this_water, this_money, |
| | | this_duration) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{opDt,jdbcType=TIMESTAMP}, #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | #{opIcCardAddr,jdbcType=VARCHAR}, #{opIcCardNo,jdbcType=VARCHAR}, #{opOrderNo,jdbcType=VARCHAR}, |
| | | #{openDt,jdbcType=TIMESTAMP}, #{opWaterTotalAmount,jdbcType=FLOAT}, #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | #{opMoneyRemainUser,jdbcType=FLOAT}, #{opWaterRemainUser,jdbcType=FLOAT}, #{opType,jdbcType=TINYINT}, |
| | | #{clIcCardAddr,jdbcType=VARCHAR}, #{clIcCardNo,jdbcType=VARCHAR}, #{clOrderNo,jdbcType=VARCHAR}, |
| | | #{startDt,jdbcType=TIMESTAMP}, #{endDt,jdbcType=TIMESTAMP}, #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | #{clEleTotalAmount,jdbcType=FLOAT}, #{clMoneyRemainUser,jdbcType=FLOAT}, #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | #{thisEle,jdbcType=FLOAT}, #{thisWater,jdbcType=FLOAT}, #{thisMoney,jdbcType=FLOAT}, |
| | | #{thisDuration,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_open_close_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="opDt != null"> |
| | | op_dt, |
| | | </if> |
| | | <if test="opRtuDt != null"> |
| | | op_rtu_dt, |
| | | </if> |
| | | <if test="opIcCardAddr != null"> |
| | | op_ic_card_addr, |
| | | </if> |
| | | <if test="opIcCardNo != null"> |
| | | op_ic_card_no, |
| | | </if> |
| | | <if test="opOrderNo != null"> |
| | | op_order_no, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | open_dt, |
| | | </if> |
| | | <if test="opWaterTotalAmount != null"> |
| | | op_water_total_amount, |
| | | </if> |
| | | <if test="opEleTotalAmount != null"> |
| | | op_ele_total_amount, |
| | | </if> |
| | | <if test="opMoneyRemainUser != null"> |
| | | op_money_remain_user, |
| | | </if> |
| | | <if test="opWaterRemainUser != null"> |
| | | op_water_remain_user, |
| | | </if> |
| | | <if test="opType != null"> |
| | | op_type, |
| | | </if> |
| | | <if test="clIcCardAddr != null"> |
| | | cl_ic_card_addr, |
| | | </if> |
| | | <if test="clIcCardNo != null"> |
| | | cl_ic_card_no, |
| | | </if> |
| | | <if test="clOrderNo != null"> |
| | | cl_order_no, |
| | | </if> |
| | | <if test="startDt != null"> |
| | | start_dt, |
| | | </if> |
| | | <if test="endDt != null"> |
| | | end_dt, |
| | | </if> |
| | | <if test="clWaterTotalAmount != null"> |
| | | cl_water_total_amount, |
| | | </if> |
| | | <if test="clEleTotalAmount != null"> |
| | | cl_ele_total_amount, |
| | | </if> |
| | | <if test="clMoneyRemainUser != null"> |
| | | cl_money_remain_user, |
| | | </if> |
| | | <if test="clWaterRemainUser != null"> |
| | | cl_water_remain_user, |
| | | </if> |
| | | <if test="thisEle != null"> |
| | | this_ele, |
| | | </if> |
| | | <if test="thisWater != null"> |
| | | this_water, |
| | | </if> |
| | | <if test="thisMoney != null"> |
| | | this_money, |
| | | </if> |
| | | <if test="thisDuration != null"> |
| | | this_duration, |
| | | </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="opDt != null"> |
| | | #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opRtuDt != null"> |
| | | #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opIcCardAddr != null"> |
| | | #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opIcCardNo != null"> |
| | | #{opIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opOrderNo != null"> |
| | | #{opOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opWaterTotalAmount != null"> |
| | | #{opWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opEleTotalAmount != null"> |
| | | #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opMoneyRemainUser != null"> |
| | | #{opMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opWaterRemainUser != null"> |
| | | #{opWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | #{opType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="clIcCardAddr != null"> |
| | | #{clIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clIcCardNo != null"> |
| | | #{clIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clOrderNo != null"> |
| | | #{clOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="startDt != null"> |
| | | #{startDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="endDt != null"> |
| | | #{endDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clWaterTotalAmount != null"> |
| | | #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clEleTotalAmount != null"> |
| | | #{clEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clMoneyRemainUser != null"> |
| | | #{clMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clWaterRemainUser != null"> |
| | | #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisEle != null"> |
| | | #{thisEle,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisWater != null"> |
| | | #{thisWater,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisMoney != null"> |
| | | #{thisMoney,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisDuration != null"> |
| | | #{thisDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_open_close_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="opDt != null"> |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opRtuDt != null"> |
| | | op_rtu_dt = #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opIcCardAddr != null"> |
| | | op_ic_card_addr = #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opIcCardNo != null"> |
| | | op_ic_card_no = #{opIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opOrderNo != null"> |
| | | op_order_no = #{opOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opWaterTotalAmount != null"> |
| | | op_water_total_amount = #{opWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opEleTotalAmount != null"> |
| | | op_ele_total_amount = #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opMoneyRemainUser != null"> |
| | | op_money_remain_user = #{opMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opWaterRemainUser != null"> |
| | | op_water_remain_user = #{opWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="clIcCardAddr != null"> |
| | | cl_ic_card_addr = #{clIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clIcCardNo != null"> |
| | | cl_ic_card_no = #{clIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clOrderNo != null"> |
| | | cl_order_no = #{clOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="startDt != null"> |
| | | start_dt = #{startDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="endDt != null"> |
| | | end_dt = #{endDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clWaterTotalAmount != null"> |
| | | cl_water_total_amount = #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clEleTotalAmount != null"> |
| | | cl_ele_total_amount = #{clEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clMoneyRemainUser != null"> |
| | | cl_money_remain_user = #{clMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clWaterRemainUser != null"> |
| | | cl_water_remain_user = #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisEle != null"> |
| | | this_ele = #{thisEle,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisWater != null"> |
| | | this_water = #{thisWater,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisMoney != null"> |
| | | this_money = #{thisMoney,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisDuration != null"> |
| | | this_duration = #{thisDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_open_close_history |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | op_rtu_dt = #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | op_ic_card_addr = #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | op_ic_card_no = #{opIcCardNo,jdbcType=VARCHAR}, |
| | | op_order_no = #{opOrderNo,jdbcType=VARCHAR}, |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | op_water_total_amount = #{opWaterTotalAmount,jdbcType=FLOAT}, |
| | | op_ele_total_amount = #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | op_money_remain_user = #{opMoneyRemainUser,jdbcType=FLOAT}, |
| | | op_water_remain_user = #{opWaterRemainUser,jdbcType=FLOAT}, |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | | cl_ic_card_addr = #{clIcCardAddr,jdbcType=VARCHAR}, |
| | | cl_ic_card_no = #{clIcCardNo,jdbcType=VARCHAR}, |
| | | cl_order_no = #{clOrderNo,jdbcType=VARCHAR}, |
| | | start_dt = #{startDt,jdbcType=TIMESTAMP}, |
| | | end_dt = #{endDt,jdbcType=TIMESTAMP}, |
| | | cl_water_total_amount = #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | cl_ele_total_amount = #{clEleTotalAmount,jdbcType=FLOAT}, |
| | | cl_money_remain_user = #{clMoneyRemainUser,jdbcType=FLOAT}, |
| | | cl_water_remain_user = #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | this_ele = #{thisEle,jdbcType=FLOAT}, |
| | | this_water = #{thisWater,jdbcType=FLOAT}, |
| | | this_money = #{thisMoney,jdbcType=FLOAT}, |
| | | this_duration = #{thisDuration,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmOpenCloseLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_open_close_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="op_dt" jdbcType="TIMESTAMP" property="opDt" /> |
| | | <result column="op_rtu_dt" jdbcType="TIMESTAMP" property="opRtuDt" /> |
| | | <result column="op_ic_card_addr" jdbcType="VARCHAR" property="opIcCardAddr" /> |
| | | <result column="op_ic_card_no" jdbcType="VARCHAR" property="opIcCardNo" /> |
| | | <result column="op_order_no" jdbcType="VARCHAR" property="opOrderNo" /> |
| | | <result column="open_dt" jdbcType="TIMESTAMP" property="openDt" /> |
| | | <result column="op_water_total_amount" jdbcType="FLOAT" property="opWaterTotalAmount" /> |
| | | <result column="op_ele_total_amount" jdbcType="FLOAT" property="opEleTotalAmount" /> |
| | | <result column="op_money_remain_user" jdbcType="FLOAT" property="opMoneyRemainUser" /> |
| | | <result column="op_water_remain_user" jdbcType="FLOAT" property="opWaterRemainUser" /> |
| | | <result column="op_type" jdbcType="TINYINT" property="opType" /> |
| | | <result column="cl_ic_card_addr" jdbcType="VARCHAR" property="clIcCardAddr" /> |
| | | <result column="cl_ic_card_no" jdbcType="VARCHAR" property="clIcCardNo" /> |
| | | <result column="cl_order_no" jdbcType="VARCHAR" property="clOrderNo" /> |
| | | <result column="start_dt" jdbcType="TIMESTAMP" property="startDt" /> |
| | | <result column="end_dt" jdbcType="TIMESTAMP" property="endDt" /> |
| | | <result column="cl_water_total_amount" jdbcType="FLOAT" property="clWaterTotalAmount" /> |
| | | <result column="cl_ele_total_amount" jdbcType="FLOAT" property="clEleTotalAmount" /> |
| | | <result column="cl_money_remain_user" jdbcType="FLOAT" property="clMoneyRemainUser" /> |
| | | <result column="cl_water_remain_user" jdbcType="FLOAT" property="clWaterRemainUser" /> |
| | | <result column="this_ele" jdbcType="FLOAT" property="thisEle" /> |
| | | <result column="this_water" jdbcType="FLOAT" property="thisWater" /> |
| | | <result column="this_money" jdbcType="FLOAT" property="thisMoney" /> |
| | | <result column="this_duration" jdbcType="INTEGER" property="thisDuration" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, op_dt, op_rtu_dt, op_ic_card_addr, op_ic_card_no, |
| | | op_order_no, open_dt, op_water_total_amount, op_ele_total_amount, op_money_remain_user, |
| | | op_water_remain_user, op_type, cl_ic_card_addr, cl_ic_card_no, cl_order_no, start_dt, |
| | | end_dt, cl_water_total_amount, cl_ele_total_amount, cl_money_remain_user, cl_water_remain_user, |
| | | this_ele, this_water, this_money, this_duration |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_open_close_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_open_close_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_open_close_last (id, controller_id, intake_id, |
| | | rtu_addr, op_dt, op_rtu_dt, |
| | | op_ic_card_addr, op_ic_card_no, op_order_no, |
| | | open_dt, op_water_total_amount, op_ele_total_amount, |
| | | op_money_remain_user, op_water_remain_user, op_type, |
| | | cl_ic_card_addr, cl_ic_card_no, cl_order_no, |
| | | start_dt, end_dt, cl_water_total_amount, |
| | | cl_ele_total_amount, cl_money_remain_user, cl_water_remain_user, |
| | | this_ele, this_water, this_money, |
| | | this_duration) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{opDt,jdbcType=TIMESTAMP}, #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | #{opIcCardAddr,jdbcType=VARCHAR}, #{opIcCardNo,jdbcType=VARCHAR}, #{opOrderNo,jdbcType=VARCHAR}, |
| | | #{openDt,jdbcType=TIMESTAMP}, #{opWaterTotalAmount,jdbcType=FLOAT}, #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | #{opMoneyRemainUser,jdbcType=FLOAT}, #{opWaterRemainUser,jdbcType=FLOAT}, #{opType,jdbcType=TINYINT}, |
| | | #{clIcCardAddr,jdbcType=VARCHAR}, #{clIcCardNo,jdbcType=VARCHAR}, #{clOrderNo,jdbcType=VARCHAR}, |
| | | #{startDt,jdbcType=TIMESTAMP}, #{endDt,jdbcType=TIMESTAMP}, #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | #{clEleTotalAmount,jdbcType=FLOAT}, #{clMoneyRemainUser,jdbcType=FLOAT}, #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | #{thisEle,jdbcType=FLOAT}, #{thisWater,jdbcType=FLOAT}, #{thisMoney,jdbcType=FLOAT}, |
| | | #{thisDuration,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_open_close_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="opDt != null"> |
| | | op_dt, |
| | | </if> |
| | | <if test="opRtuDt != null"> |
| | | op_rtu_dt, |
| | | </if> |
| | | <if test="opIcCardAddr != null"> |
| | | op_ic_card_addr, |
| | | </if> |
| | | <if test="opIcCardNo != null"> |
| | | op_ic_card_no, |
| | | </if> |
| | | <if test="opOrderNo != null"> |
| | | op_order_no, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | open_dt, |
| | | </if> |
| | | <if test="opWaterTotalAmount != null"> |
| | | op_water_total_amount, |
| | | </if> |
| | | <if test="opEleTotalAmount != null"> |
| | | op_ele_total_amount, |
| | | </if> |
| | | <if test="opMoneyRemainUser != null"> |
| | | op_money_remain_user, |
| | | </if> |
| | | <if test="opWaterRemainUser != null"> |
| | | op_water_remain_user, |
| | | </if> |
| | | <if test="opType != null"> |
| | | op_type, |
| | | </if> |
| | | <if test="clIcCardAddr != null"> |
| | | cl_ic_card_addr, |
| | | </if> |
| | | <if test="clIcCardNo != null"> |
| | | cl_ic_card_no, |
| | | </if> |
| | | <if test="clOrderNo != null"> |
| | | cl_order_no, |
| | | </if> |
| | | <if test="startDt != null"> |
| | | start_dt, |
| | | </if> |
| | | <if test="endDt != null"> |
| | | end_dt, |
| | | </if> |
| | | <if test="clWaterTotalAmount != null"> |
| | | cl_water_total_amount, |
| | | </if> |
| | | <if test="clEleTotalAmount != null"> |
| | | cl_ele_total_amount, |
| | | </if> |
| | | <if test="clMoneyRemainUser != null"> |
| | | cl_money_remain_user, |
| | | </if> |
| | | <if test="clWaterRemainUser != null"> |
| | | cl_water_remain_user, |
| | | </if> |
| | | <if test="thisEle != null"> |
| | | this_ele, |
| | | </if> |
| | | <if test="thisWater != null"> |
| | | this_water, |
| | | </if> |
| | | <if test="thisMoney != null"> |
| | | this_money, |
| | | </if> |
| | | <if test="thisDuration != null"> |
| | | this_duration, |
| | | </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="opDt != null"> |
| | | #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opRtuDt != null"> |
| | | #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opIcCardAddr != null"> |
| | | #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opIcCardNo != null"> |
| | | #{opIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opOrderNo != null"> |
| | | #{opOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opWaterTotalAmount != null"> |
| | | #{opWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opEleTotalAmount != null"> |
| | | #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opMoneyRemainUser != null"> |
| | | #{opMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opWaterRemainUser != null"> |
| | | #{opWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | #{opType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="clIcCardAddr != null"> |
| | | #{clIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clIcCardNo != null"> |
| | | #{clIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clOrderNo != null"> |
| | | #{clOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="startDt != null"> |
| | | #{startDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="endDt != null"> |
| | | #{endDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clWaterTotalAmount != null"> |
| | | #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clEleTotalAmount != null"> |
| | | #{clEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clMoneyRemainUser != null"> |
| | | #{clMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clWaterRemainUser != null"> |
| | | #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisEle != null"> |
| | | #{thisEle,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisWater != null"> |
| | | #{thisWater,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisMoney != null"> |
| | | #{thisMoney,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisDuration != null"> |
| | | #{thisDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_open_close_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="opDt != null"> |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opRtuDt != null"> |
| | | op_rtu_dt = #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opIcCardAddr != null"> |
| | | op_ic_card_addr = #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opIcCardNo != null"> |
| | | op_ic_card_no = #{opIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="opOrderNo != null"> |
| | | op_order_no = #{opOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="openDt != null"> |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="opWaterTotalAmount != null"> |
| | | op_water_total_amount = #{opWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opEleTotalAmount != null"> |
| | | op_ele_total_amount = #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opMoneyRemainUser != null"> |
| | | op_money_remain_user = #{opMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opWaterRemainUser != null"> |
| | | op_water_remain_user = #{opWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="opType != null"> |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="clIcCardAddr != null"> |
| | | cl_ic_card_addr = #{clIcCardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clIcCardNo != null"> |
| | | cl_ic_card_no = #{clIcCardNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="clOrderNo != null"> |
| | | cl_order_no = #{clOrderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="startDt != null"> |
| | | start_dt = #{startDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="endDt != null"> |
| | | end_dt = #{endDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="clWaterTotalAmount != null"> |
| | | cl_water_total_amount = #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clEleTotalAmount != null"> |
| | | cl_ele_total_amount = #{clEleTotalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clMoneyRemainUser != null"> |
| | | cl_money_remain_user = #{clMoneyRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="clWaterRemainUser != null"> |
| | | cl_water_remain_user = #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisEle != null"> |
| | | this_ele = #{thisEle,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisWater != null"> |
| | | this_water = #{thisWater,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisMoney != null"> |
| | | this_money = #{thisMoney,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="thisDuration != null"> |
| | | this_duration = #{thisDuration,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_open_close_last |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | op_dt = #{opDt,jdbcType=TIMESTAMP}, |
| | | op_rtu_dt = #{opRtuDt,jdbcType=TIMESTAMP}, |
| | | op_ic_card_addr = #{opIcCardAddr,jdbcType=VARCHAR}, |
| | | op_ic_card_no = #{opIcCardNo,jdbcType=VARCHAR}, |
| | | op_order_no = #{opOrderNo,jdbcType=VARCHAR}, |
| | | open_dt = #{openDt,jdbcType=TIMESTAMP}, |
| | | op_water_total_amount = #{opWaterTotalAmount,jdbcType=FLOAT}, |
| | | op_ele_total_amount = #{opEleTotalAmount,jdbcType=FLOAT}, |
| | | op_money_remain_user = #{opMoneyRemainUser,jdbcType=FLOAT}, |
| | | op_water_remain_user = #{opWaterRemainUser,jdbcType=FLOAT}, |
| | | op_type = #{opType,jdbcType=TINYINT}, |
| | | cl_ic_card_addr = #{clIcCardAddr,jdbcType=VARCHAR}, |
| | | cl_ic_card_no = #{clIcCardNo,jdbcType=VARCHAR}, |
| | | cl_order_no = #{clOrderNo,jdbcType=VARCHAR}, |
| | | start_dt = #{startDt,jdbcType=TIMESTAMP}, |
| | | end_dt = #{endDt,jdbcType=TIMESTAMP}, |
| | | cl_water_total_amount = #{clWaterTotalAmount,jdbcType=FLOAT}, |
| | | cl_ele_total_amount = #{clEleTotalAmount,jdbcType=FLOAT}, |
| | | cl_money_remain_user = #{clMoneyRemainUser,jdbcType=FLOAT}, |
| | | cl_water_remain_user = #{clWaterRemainUser,jdbcType=FLOAT}, |
| | | this_ele = #{thisEle,jdbcType=FLOAT}, |
| | | this_water = #{thisWater,jdbcType=FLOAT}, |
| | | this_money = #{thisMoney,jdbcType=FLOAT}, |
| | | this_duration = #{thisDuration,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据阀控器地址获取开关阀上报最新数据--> |
| | | <select id="getRmOpenCloseReportLast" resultType="com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_open_close_last |
| | | where rtu_addr = #{rtuAddr} |
| | | </select> |
| | | </mapper> |
| | |
| | | @Autowired |
| | | private RmTimingReportLastMapper rmTimingReportLastDao; // 定点上报最新数据DAO |
| | | |
| | | @Autowired |
| | | private RmOpenCloseHistoryMapper rmOpenCloseHistoryDao; |
| | | @Autowired |
| | | private RmOpenCloseLastMapper rmOpenCloseLastDao; |
| | | |
| | | //@Autowired |
| | | //@Lazy |
| | | //private DbSv sv ; |
| | |
| | | this.rmOpenCloseValveHistoryMapperDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | |
| | | /** |
| | | * 保存控制器开关阀上报数据最新记录(202404) |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmOpenCloseLast(RmOpenCloseLast po){ |
| | | this.rmOpenCloseLastDao.insert(po) ; |
| | | } |
| | | |
| | | /** |
| | | * 保存控制器开关阀上报数据历史记录(202404) |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmOpenCloseHistory(RmOpenCloseHistory po){ |
| | | this.rmOpenCloseHistoryDao.insert(po) ; |
| | | } |
| | | |
| | | /** |
| | | * 得到控制器开关阀上报数据最新记录(202404) |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | public RmOpenCloseLast getRmOpenCloseLast(String rtuAddr){ |
| | | List<RmOpenCloseLast> list = rmOpenCloseLastDao.getRmOpenCloseReportLast(rtuAddr); |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | /** |
| | | * 保存控制器开关阀上报数据最新记录(202404) |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmOpenCloseLast(RmOpenCloseLast po){ |
| | | this.rmOpenCloseLastDao.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | ///////////////////////////////////////////////// |
| | | // |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.p206V202404; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd85Vo; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-06-20 13:48 |
| | | * @LastEditTime 2024-06-20 13:48 |
| | | * @Description |
| | | */ |
| | | public class TkDealCloseValveReportV202404 extends TaskSurpport { |
| | | private static final Logger log = LogManager.getLogger(TkDealTimingReportV202404.class.getName()); |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealCloseValveReportV202404"; |
| | | |
| | | /** |
| | | * 执行节点任务:关阀上报 |
| | | * |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data) data; |
| | | DataV202404 dV202404 = (DataV202404) d.getSubData(); |
| | | Object cdObj = dV202404.subData; |
| | | if (cdObj != null) { |
| | | try { |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId); |
| | | DbSv sv = (DbSv) objs[0]; |
| | | PrController controller = (PrController) objs[1]; |
| | | if (cdObj instanceof DataCd85Vo) { |
| | | DataCd85Vo cdData = (DataCd85Vo) (cdObj); |
| | | this.doDeal(sv, controller, d.getRtuAddr(), dV202404, (DataCd85Vo)cdObj); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("保存控制器开阀报数据时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 处理关阀报数据 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dataV202404 协议数据 |
| | | * @param cdData 功能数据 |
| | | */ |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd85Vo cdData) throws Exception { |
| | | this.saveOrUpdateLast(sv, controller, rtuAddr, dataV202404, cdData); |
| | | this.saveHistory(sv, controller, rtuAddr, dataV202404, cdData); |
| | | } |
| | | |
| | | /** |
| | | * 保存或更新控制器关阀报最新数据 |
| | | * @param sv 服务bean |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dataV202404 协议数据 |
| | | * @param cdData 功能数据 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd85Vo cdData)throws Exception { |
| | | RmOpenCloseLast po = sv.getRmOpenCloseLast(rtuAddr); |
| | | if(po == null){ |
| | | po = new RmOpenCloseLast(); |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | | po.valueFrom85(dataV202404, cdData); |
| | | sv.saveRmOpenCloseLast(po); |
| | | }else{ |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.valueFrom85(dataV202404, cdData); |
| | | sv.updateRmOpenCloseLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存控制器关阀报历史数据 |
| | | * @param sv 服务bean |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dataV202404 协议数据 |
| | | * @param cdData 功能数据 |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd85Vo cdData)throws Exception { |
| | | RmOpenCloseHistory po = new RmOpenCloseHistory(); |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | | po.valueFrom85(dataV202404, cdData); |
| | | sv.saveRmOpenCloseHistory(po); ; |
| | | } |
| | | } |
| | |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd84Vo; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | |
| | | * @param cdData 功能数据 |
| | | */ |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd84Vo cdData) throws Exception { |
| | | //this.saveOrUpdateLast(sv, controller, rtuAddr, dataV202404, cdData); |
| | | //this.saveHistory(sv, controller, rtuAddr, dataV202404, cdData); |
| | | this.saveOrUpdateLast(sv, controller, rtuAddr, dataV202404, cdData); |
| | | this.saveHistory(sv, controller, rtuAddr, dataV202404, cdData); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param dataV202404 协议数据 |
| | | * @param cdData 功能数据 |
| | | */ |
| | | //private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd84Vo cdData)throws Exception { |
| | | // RmTimingReportLast po = sv.getRmTimingReportLast(rtuAddr) ; |
| | | // if(po == null){ |
| | | // po = new RmTimingReportLast(); |
| | | // po.controllerId = controller==null?null:controller.getId(); |
| | | // po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | // po.rtuAddr = rtuAddr; |
| | | // po.valueFrom(dataV202404, cdData); |
| | | // sv.saveRmTimingReportLast(po) ; |
| | | // }else{ |
| | | // po.controllerId = controller==null?null:controller.getId(); |
| | | // po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | // po.valueFrom(dataV202404, cdData); |
| | | // sv.updateRmTimingReportLast(po); |
| | | // } |
| | | //} |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd84Vo cdData)throws Exception { |
| | | RmOpenCloseLast po = sv.getRmOpenCloseLast(rtuAddr); |
| | | if(po == null){ |
| | | po = new RmOpenCloseLast(); |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | | po.valueFrom84(dataV202404, cdData); |
| | | sv.saveRmOpenCloseLast(po); |
| | | }else{ |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.valueFrom84(dataV202404, cdData); |
| | | sv.updateRmOpenCloseLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存控制器工作报历史数据 |
| | |
| | | * @param dataV202404 协议数据 |
| | | * @param cdData 功能数据 |
| | | */ |
| | | //private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd84Vo cdData)throws Exception { |
| | | // RmTimingReportHistory po = new RmTimingReportHistory(); |
| | | // po.controllerId = controller==null?null:controller.getId(); |
| | | // po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | // po.rtuAddr = rtuAddr; |
| | | // po.valueFrom(dataV202404, cdData); |
| | | // sv.saveRmTimingReportHistory(po); ; |
| | | //} |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataV202404 dataV202404, DataCd84Vo cdData)throws Exception { |
| | | RmOpenCloseHistory po = new RmOpenCloseHistory(); |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | | po.valueFrom84(dataV202404, cdData); |
| | | sv.saveRmOpenCloseHistory(po); ; |
| | | } |
| | | } |
| | |
| | | <task id="TkDealWorkingReportV202404" name="控制器工作报(功能码80)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealWorkingReportV202404" /> |
| | | <task id="TkDealTimingReportV202404" name="控制器定时上报(功能码83)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealTimingReportV202404" /> |
| | | <task id="TkDealOpenValveReportV202404" name="控制器开阀上报(功能码84)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealOpenValveReportV202404" /> |
| | | <task id="TkDealCloseValveReportV202404" name="控制器关阀上报(功能码85)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealCloseValveReportV202404" /> |
| | | </task> |
| | | <!-- 识别命令响应数据 --> |
| | | <task id="TkFindComResponseV202404" name="识别响应命令数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkFindComResponseV202404"> |