From c06c38ce579264ef82430b9e2f353afa97e6cafa Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期六, 28 十二月 2024 09:51:57 +0800
Subject: [PATCH] 通信中间件统计农户日用水量数据中增加次数属性,数据库中也相应增加此字段。
---
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmClientAmountDay.java | 7 ++++++-
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1/TkDealClientAmountDay.java | 5 +++++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml | 20 ++++++++++++++++----
3 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmClientAmountDay.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmClientAmountDay.java
index 3068ca8..559206d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmClientAmountDay.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmClientAmountDay.java
@@ -48,12 +48,17 @@
public Double amount;
/**
- * 鏃ュ彇鑺辫垂閲戦
+ * 鏃ュ彇姘磋姳璐归噾棰�
*/
@JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
public Double money;
/**
+ * 鏃ュ彇姘存鏁�
+ */
+ public Integer times;
+
+ /**
* 缁熻鏃ユ湡(yyyy-mm-dd)
*/
@Schema(description = "缁熻鏃ユ湡", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml
index 0c43003..23981d4 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml
@@ -8,6 +8,7 @@
<result column="client_id" jdbcType="BIGINT" property="clientId" />
<result column="amount" jdbcType="FLOAT" property="amount" />
<result column="money" jdbcType="FLOAT" property="money" />
+ <result column="times" jdbcType="INTEGER" property="times" />
<result column="dt" jdbcType="DATE" property="dt" />
<result column="open_dt_last" jdbcType="TIMESTAMP" property="openDtLast" />
<result column="close_dt_last" jdbcType="TIMESTAMP" property="closeDtLast" />
@@ -18,7 +19,7 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
- id, client_id, amount, money, dt, open_dt_last, close_dt_last, this_amount_last, this_money_last,
+ id, client_id, amount, money, times, dt, open_dt_last, close_dt_last, this_amount_last, this_money_last,
this_time_last, rtu_dt_last
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -43,11 +44,11 @@
</delete>
<insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDay">
<!--@mbg.generated-->
- insert into rm_client_amount_day (id, client_id, amount, money,
+ insert into rm_client_amount_day (id, client_id, amount, money, times,
dt, open_dt_last, close_dt_last,
this_amount_last, this_money_last, this_time_last,
rtu_dt_last)
- values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT},
+ values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT}, #{times,jdbcType=FLOAT},
#{dt,jdbcType=DATE}, #{openDtLast,jdbcType=TIMESTAMP}, #{closeDtLast,jdbcType=TIMESTAMP},
#{thisAmountLast,jdbcType=FLOAT}, #{thisMoneyLast,jdbcType=FLOAT}, #{thisTimeLast,jdbcType=INTEGER},
#{rtuDtLast,jdbcType=TIMESTAMP})
@@ -67,6 +68,9 @@
</if>
<if test="money != null">
money,
+ </if>
+ <if test="times != null">
+ times,
</if>
<if test="dt != null">
dt,
@@ -102,6 +106,9 @@
</if>
<if test="money != null">
#{money,jdbcType=FLOAT},
+ </if>
+ <if test="times != null">
+ #{times,jdbcType=INTEGER},
</if>
<if test="dt != null">
#{dt,jdbcType=DATE},
@@ -139,6 +146,9 @@
<if test="money != null">
money = #{money,jdbcType=FLOAT},
</if>
+ <if test="times != null">
+ times = #{times,jdbcType=INTEGER},
+ </if>
<if test="dt != null">
dt = #{dt,jdbcType=DATE},
</if>
@@ -169,6 +179,7 @@
set client_id = #{clientId,jdbcType=BIGINT},
amount = #{amount,jdbcType=FLOAT},
money = #{money,jdbcType=FLOAT},
+ times = #{times,jdbcType=INTEGER},
dt = #{dt,jdbcType=DATE},
open_dt_last = #{openDtLast,jdbcType=TIMESTAMP},
close_dt_last = #{closeDtLast,jdbcType=TIMESTAMP},
@@ -204,6 +215,7 @@
CAST(rcad.client_id AS char)AS clientId,
rcad.amount as amount,
rcad.money as money,
+ rcad.times as times,
rcad.dt as dt,
rcad.open_dt_last as openDtLast,
rcad.close_dt_last as closeDtLast,
@@ -236,7 +248,7 @@
<select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics">
- select client_id, sum(amount) as amount, sum(money) as money
+ select client_id, sum(amount) as amount, sum(money) as money, sum(times) as times
from rm_client_amount_day
where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT}
group by client_id
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1/TkDealClientAmountDay.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1/TkDealClientAmountDay.java
index 1f665ff..7184af6 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1/TkDealClientAmountDay.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1/TkDealClientAmountDay.java
@@ -289,6 +289,11 @@
}else{
poHistory.money = cdData.thisMoney ;
}
+ if(poHistory.times != null){
+ poHistory.times += 1 ;
+ }else{
+ poHistory.times = 1 ;
+ }
poHistory.dt = lastPo.dt ;
poHistory.openDtLast = lastPo.openDtLast ;
poHistory.closeDtLast = lastPo.closeDtLast ;
--
Gitblit v1.8.0