From bc352eb500297445631fb02351e0c64e09631a3d Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期四, 08 八月 2024 11:08:10 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayIntakeAmount.java | 62 +++
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/DayIntakeAmountQO.java | 25 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml | 4
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java | 16
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeVirtualCardMapper.java | 14
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/dbSv/DbSv.java | 71 +++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml | 30 +
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java | 16
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml | 628 +++++++++++++++++++++----------
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealIcRemainMoney.java | 167 ++++++++
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java | 26
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/RtuDataDealTree.xml | 3
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java | 49 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml | 42 +
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo1.java | 25 +
15 files changed, 920 insertions(+), 258 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java
index 7b8e54a..8b80aa8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java
@@ -2,9 +2,9 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay;
+import com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics;
-import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -91,4 +91,18 @@
*/
List<VoIntakeAmountStatistics> statisticsByIntake(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ;
+ /**
+ * 鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲忚褰曟暟閲�
+ * @param params
+ * @return
+ */
+ Long getDayIntakeAmountCount(Map<?, ?> params);
+
+ /**
+ * 缁熻鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲�
+ * @param params
+ * @return
+ */
+ List<VoDayIntakeAmount> getDayIntakeAmount(Map<?, ?> params);
+
}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java
index c8817bc..8596575 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java
@@ -4,6 +4,7 @@
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voSe.VoCardInfo;
+import com.dy.pipIrrGlobal.voSe.VoCardInfo1;
import com.dy.pipIrrGlobal.voSe.VoCards;
import com.dy.pipIrrGlobal.voSe.VoCards2;
import com.dy.pipIrrGlobal.voSt.VoICCard;
@@ -70,6 +71,14 @@
* @return
*/
Map getClientIdAndNameByCardAddrAndCardNo(@Param("cardAddr") String cardAddr, @Param("cardNum") Long cardNum);
+
+ /**
+ * 寰楀埌姘村崱瀵硅薄
+ * @param cardAddr
+ * @param cardNum
+ * @return
+ */
+ List<VoCardInfo1> getCardsByAddrAndNum(@Param("cardAddr") String cardAddr, @Param("cardNum") Long cardNum);
/**
* 鏍规嵁鍐滄埛涓婚敭鑾峰彇姘村崱鍒楄〃
@@ -169,6 +178,13 @@
List<VoCards3> getCardsByClientID(String clientId);
/**
+ * 鏇存柊瀹炰綋鍗″墿浣欓噾棰�
+ * @param id
+ * @param money
+ */
+ void updateMoney(@Param("id")Long id , @Param("money")Double money);
+
+ /**
* 鎸囧畾鏃堕棿娈靛唴寮�鍗℃�绘暟閲忥紙鐗╃悊鍗★級
* @param params
* @return
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeVirtualCardMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeVirtualCardMapper.java
index 5f456fc..7e4033b 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeVirtualCardMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeVirtualCardMapper.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
+import com.dy.pipIrrGlobal.voSe.VoCardInfo1;
import com.dy.pipIrrGlobal.voSe.VoVcRecharge;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import org.apache.ibatis.annotations.Mapper;
@@ -66,6 +67,12 @@
*/
Map getClientIdAndNameByVsCardNo(@Param("vcNum") Long vcNum);
+ /**
+ * 寰楀埌姘村崱瀵硅薄
+ * @param cardNum
+ * @return
+ */
+ List<VoCardInfo1> getCardsByNum(@Param("cardNum") Long cardNum);
/**
* 鏍规嵁铏氭嫙鍗$紪鍙疯幏鍙栬櫄鎷熷崱ID
@@ -100,4 +107,11 @@
* @return
*/
Long getRechargeRecordCount(Map<?, ?> params);
+
+ /**
+ * 鏇存柊瀹炰綋鍗″墿浣欓噾棰�
+ * @param id
+ * @param money
+ */
+ void updateMoney(@Param("id")Long id , @Param("money")Double money);
}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo1.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo1.java
new file mode 100644
index 0000000..c94d8de
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo1.java
@@ -0,0 +1,25 @@
+package com.dy.pipIrrGlobal.voSe;
+
+import com.dy.common.po.BaseEntity;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2023-12-27 19:22
+ * @LastEditTime 2023-12-27 19:22
+ * @Description
+ */
+
+@Data
+@Schema(title = "IC鍗¤鍥惧璞�1")
+public class VoCardInfo1 implements BaseEntity {
+ private static final long serialVersionUID = 202408071750001L;
+
+ @Schema(title = "涓婚敭")
+ public Long id ;
+
+ @Schema(title = "浣欓")
+ public Float money;
+
+}
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayIntakeAmount.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayIntakeAmount.java
new file mode 100644
index 0000000..5043751
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayIntakeAmount.java
@@ -0,0 +1,62 @@
+package com.dy.pipIrrGlobal.voSt;
+
+import com.alibaba.fastjson2.annotation.JSONField;
+import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import lombok.Data;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2024-08-08 9:31
+ * @LastEditTime 2024-08-08 9:31
+ * @Description 鍙栨按鍙f棩鐢ㄦ按瑙嗗浘
+ */
+
+@Data
+@JsonPropertyOrder({ "intakeId", "intakeNum", "amount1" , "amount2" , "amount3" , "amount4" , "amount5" , "amount6" , "amount7" , "amount8" , "amount9" , "amount10" , "amount11" , "amount12" , "amount13" , "amount14" , "amount15" , "amount16" , "amount17" , "amount18" , "amount19" , "amount20" , "amount21" , "amount22" , "amount23" , "amount24" , "amount25" , "amount26" , "amount27" , "amount28" , "amount29" , "amount30" , "amount31" })
+public class VoDayIntakeAmount {
+ private static final long serialVersionUID = 202408080933001L;
+
+ /**
+ * 鍙栨按鍙D
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ private Long intakeId;
+
+ /**
+ * 鍙栨按鍙g紪鍙�
+ */
+ private String intakeNum;
+
+ private Double amount1;
+ private Double amount2;
+ private Double amount3;
+ private Double amount4;
+ private Double amount5;
+ private Double amount6;
+ private Double amount7;
+ private Double amount8;
+ private Double amount9;
+ private Double amount10;
+ private Double amount11;
+ private Double amount12;
+ private Double amount13;
+ private Double amount14;
+ private Double amount15;
+ private Double amount16;
+ private Double amount17;
+ private Double amount18;
+ private Double amount19;
+ private Double amount20;
+ private Double amount21;
+ private Double amount22;
+ private Double amount23;
+ private Double amount24;
+ private Double amount25;
+ private Double amount26;
+ private Double amount27;
+ private Double amount28;
+ private Double amount29;
+ private Double amount30;
+ private Double amount31;
+}
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
index 4b4bcd7..f2a1069 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
@@ -52,7 +52,7 @@
phone = #{phone,jdbcType=VARCHAR} and
</if>
<if test="area != null">
- area = ${area} and
+ area = #{area,jdbcType=INTEGER} and
</if>
</trim>
</select>
@@ -73,7 +73,7 @@
phone = #{phone,jdbcType=VARCHAR} and
</if>
<if test="area != null">
- area = ${area} and
+ area = #{area,jdbcType=INTEGER} and
</if>
</trim>
order by id DESC
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
index 96ecc72..5b247fb 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
@@ -1,219 +1,439 @@
<?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.RmIntakeAmountDayMapper">
- <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
- <!--@mbg.generated-->
- <!--@Table rm_intake_amount_day-->
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="intake_id" jdbcType="BIGINT" property="intakeId" />
- <result column="dt" jdbcType="DATE" property="dt" />
- <result column="amount" jdbcType="DOUBLE" property="amount" />
- <result column="dt_last" jdbcType="TIMESTAMP" property="dtLast" />
- <result column="rtu_addr_last" jdbcType="VARCHAR" property="rtuAddrLast" />
- <result column="controller_id_last" jdbcType="BIGINT" property="controllerIdLast" />
- <result column="total_amount_last" jdbcType="FLOAT" property="totalAmountLast" />
- <result column="rtu_dt_last" jdbcType="TIMESTAMP" property="rtuDtLast" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id, intake_id, dt, amount, dt_last, rtu_addr_last, controller_id_last, total_amount_last,
- rtu_dt_last
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- <!--@mbg.generated-->
- select
- <include refid="Base_Column_List" />
- from rm_intake_amount_day
- 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_intake_amount_day
- where dt = #{dt,jdbcType=DATE}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- <!--@mbg.generated-->
- delete from rm_intake_amount_day
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
- <!--@mbg.generated-->
- insert into rm_intake_amount_day (id, intake_id, dt,
- amount, dt_last,
- rtu_addr_last, controller_id_last, total_amount_last,
- rtu_dt_last)
- values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{dt,jdbcType=DATE},
- #{amount,jdbcType=DOUBLE}, #{dtLast,jdbcType=TIMESTAMP},
- #{rtuAddrLast,jdbcType=VARCHAR}, #{controllerIdLast,jdbcType=BIGINT}, #{totalAmountLast,jdbcType=FLOAT},
- #{rtuDtLast,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
- <!--@mbg.generated-->
- insert into rm_intake_amount_day
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
+ <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
+ <!--@mbg.generated-->
+ <!--@Table rm_intake_amount_day-->
+ <id column="id" jdbcType="BIGINT" property="id"/>
+ <result column="intake_id" jdbcType="BIGINT" property="intakeId"/>
+ <result column="dt" jdbcType="DATE" property="dt"/>
+ <result column="amount" jdbcType="DOUBLE" property="amount"/>
+ <result column="dt_last" jdbcType="TIMESTAMP" property="dtLast"/>
+ <result column="rtu_addr_last" jdbcType="VARCHAR" property="rtuAddrLast"/>
+ <result column="controller_id_last" jdbcType="BIGINT" property="controllerIdLast"/>
+ <result column="total_amount_last" jdbcType="FLOAT" property="totalAmountLast"/>
+ <result column="rtu_dt_last" jdbcType="TIMESTAMP" property="rtuDtLast"/>
+ </resultMap>
+ <sql id="Base_Column_List">
+ <!--@mbg.generated-->
id,
- </if>
- <if test="intakeId != null">
intake_id,
- </if>
- <if test="dt != null">
dt,
- </if>
- <if test="amount != null">
amount,
- </if>
- <if test="dtLast != null">
dt_last,
- </if>
- <if test="rtuAddrLast != null">
rtu_addr_last,
- </if>
- <if test="controllerIdLast != null">
controller_id_last,
- </if>
- <if test="totalAmountLast != null">
total_amount_last,
- </if>
- <if test="rtuDtLast != null">
- rtu_dt_last,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="intakeId != null">
- #{intakeId,jdbcType=BIGINT},
- </if>
- <if test="dt != null">
- #{dt,jdbcType=DATE},
- </if>
- <if test="amount != null">
- #{amount,jdbcType=DOUBLE},
- </if>
- <if test="dtLast != null">
- #{dtLast,jdbcType=TIMESTAMP},
- </if>
- <if test="rtuAddrLast != null">
- #{rtuAddrLast,jdbcType=VARCHAR},
- </if>
- <if test="controllerIdLast != null">
- #{controllerIdLast,jdbcType=BIGINT},
- </if>
- <if test="totalAmountLast != null">
- #{totalAmountLast,jdbcType=FLOAT},
- </if>
- <if test="rtuDtLast != null">
- #{rtuDtLast,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
- <!--@mbg.generated-->
- update rm_intake_amount_day
- <set>
- <if test="intakeId != null">
- intake_id = #{intakeId,jdbcType=BIGINT},
- </if>
- <if test="dt != null">
- dt = #{dt,jdbcType=DATE},
- </if>
- <if test="amount != null">
- amount = #{amount,jdbcType=DOUBLE},
- </if>
- <if test="dtLast != null">
- dt_last = #{dtLast,jdbcType=TIMESTAMP},
- </if>
- <if test="rtuAddrLast != null">
- rtu_addr_last = #{rtuAddrLast,jdbcType=VARCHAR},
- </if>
- <if test="controllerIdLast != null">
- controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
- </if>
- <if test="totalAmountLast != null">
- total_amount_last = #{totalAmountLast,jdbcType=FLOAT},
- </if>
- <if test="rtuDtLast != null">
- rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
- <!--@mbg.generated-->
- update rm_intake_amount_day
- set intake_id = #{intakeId,jdbcType=BIGINT},
- dt = #{dt,jdbcType=DATE},
- amount = #{amount,jdbcType=DOUBLE},
- dt_last = #{dtLast,jdbcType=TIMESTAMP},
- rtu_addr_last = #{rtuAddrLast,jdbcType=VARCHAR},
- controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
- total_amount_last = #{totalAmountLast,jdbcType=FLOAT},
- rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟-->
- <select id="getRecordCount" resultType="java.lang.Long">
- select count(*)
- from rm_intake_amount_day riad
- Left join pr_intake pint on pint.id = riad.intake_id
- <where>
- <if test="intakeId != null and intakeId != '' ">
- and rash.intake_id = #{intakeId}
- </if>
- <if test="intakeName != null and intakeName != '' ">
- and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
- </if>
- <if test="startDt != null">
- and riad.dt >= #{startDt,jdbcType=DATE}
- </if>
- <if test="endDt != null">
- and riad.dt <= #{endDt,jdbcType=DATE}
- </if>
- </where>
+ rtu_dt_last
+ </sql>
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List"/>
+ from rm_intake_amount_day
+ where id = #{id,jdbcType=BIGINT}
</select>
- <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍-->
- <select id="getIntakeAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay">
- select
- CAST(riad.intake_id AS char)AS intakeId,
- pint.name as intakeName,
- riad.dt as dt,
- riad.amount as amount,
- riad.dt_last as dtLast,
- riad.rtu_addr_last as rtuAddrLast,
- CAST(riad.controller_id_last AS char)AS controllerIdLast,
- riad.total_amount_last as totalAmountLast,
- riad.rtu_dt_last as rtuDtLast
- from rm_intake_amount_day riad
- Left join pr_intake pint on pint.id = riad.intake_id
- <where>
- <if test="intakeId != null and intakeId != '' ">
- and rash.intake_id = #{intakeId}
- </if>
- <if test="intakeName != null and intakeName != '' ">
- and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
- </if>
- <if test="startDt != null">
- and riad.dt >= #{startDt,jdbcType=DATE}
- </if>
- <if test="endDt != null">
- and riad.dt <= #{endDt,jdbcType=DATE}
- </if>
- </where>
- ORDER BY riad.id DESC
- <if test="pageCurr != null and pageSize != null">
- LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
- </if>
- </select>
+ <select id="selectByDate" parameterType="java.util.Date" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List"/>
+ from rm_intake_amount_day
+ where dt = #{dt,jdbcType=DATE}
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ delete
+ from rm_intake_amount_day
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+ <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
+ <!--@mbg.generated-->
+ insert into rm_intake_amount_day (id, intake_id, dt,
+ amount, dt_last,
+ rtu_addr_last, controller_id_last, total_amount_last,
+ rtu_dt_last)
+ values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{dt,jdbcType=DATE},
+ #{amount,jdbcType=DOUBLE}, #{dtLast,jdbcType=TIMESTAMP},
+ #{rtuAddrLast,jdbcType=VARCHAR}, #{controllerIdLast,jdbcType=BIGINT}, #{totalAmountLast,jdbcType=FLOAT},
+ #{rtuDtLast,jdbcType=TIMESTAMP})
+ </insert>
+ <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
+ <!--@mbg.generated-->
+ insert into rm_intake_amount_day
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="intakeId != null">
+ intake_id,
+ </if>
+ <if test="dt != null">
+ dt,
+ </if>
+ <if test="amount != null">
+ amount,
+ </if>
+ <if test="dtLast != null">
+ dt_last,
+ </if>
+ <if test="rtuAddrLast != null">
+ rtu_addr_last,
+ </if>
+ <if test="controllerIdLast != null">
+ controller_id_last,
+ </if>
+ <if test="totalAmountLast != null">
+ total_amount_last,
+ </if>
+ <if test="rtuDtLast != null">
+ rtu_dt_last,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=BIGINT},
+ </if>
+ <if test="intakeId != null">
+ #{intakeId,jdbcType=BIGINT},
+ </if>
+ <if test="dt != null">
+ #{dt,jdbcType=DATE},
+ </if>
+ <if test="amount != null">
+ #{amount,jdbcType=DOUBLE},
+ </if>
+ <if test="dtLast != null">
+ #{dtLast,jdbcType=TIMESTAMP},
+ </if>
+ <if test="rtuAddrLast != null">
+ #{rtuAddrLast,jdbcType=VARCHAR},
+ </if>
+ <if test="controllerIdLast != null">
+ #{controllerIdLast,jdbcType=BIGINT},
+ </if>
+ <if test="totalAmountLast != null">
+ #{totalAmountLast,jdbcType=FLOAT},
+ </if>
+ <if test="rtuDtLast != null">
+ #{rtuDtLast,jdbcType=TIMESTAMP},
+ </if>
+ </trim>
+ </insert>
+ <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
+ <!--@mbg.generated-->
+ update rm_intake_amount_day
+ <set>
+ <if test="intakeId != null">
+ intake_id = #{intakeId,jdbcType=BIGINT},
+ </if>
+ <if test="dt != null">
+ dt = #{dt,jdbcType=DATE},
+ </if>
+ <if test="amount != null">
+ amount = #{amount,jdbcType=DOUBLE},
+ </if>
+ <if test="dtLast != null">
+ dt_last = #{dtLast,jdbcType=TIMESTAMP},
+ </if>
+ <if test="rtuAddrLast != null">
+ rtu_addr_last = #{rtuAddrLast,jdbcType=VARCHAR},
+ </if>
+ <if test="controllerIdLast != null">
+ controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
+ </if>
+ <if test="totalAmountLast != null">
+ total_amount_last = #{totalAmountLast,jdbcType=FLOAT},
+ </if>
+ <if test="rtuDtLast != null">
+ rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
+ <!--@mbg.generated-->
+ update rm_intake_amount_day
+ set intake_id = #{intakeId,jdbcType=BIGINT},
+ dt = #{dt,jdbcType=DATE},
+ amount = #{amount,jdbcType=DOUBLE},
+ dt_last = #{dtLast,jdbcType=TIMESTAMP},
+ rtu_addr_last = #{rtuAddrLast,jdbcType=VARCHAR},
+ controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
+ total_amount_last = #{totalAmountLast,jdbcType=FLOAT},
+ rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟-->
+ <select id="getRecordCount" resultType="java.lang.Long">
+ select count(*)
+ from rm_intake_amount_day riad
+ Left join pr_intake pint on pint.id = riad.intake_id
+ <where>
+ <if test="intakeId != null and intakeId != ''">
+ and riad.intake_id = #{intakeId}
+ </if>
+ <if test="intakeName != null and intakeName != ''">
+ and pint.name like CONCAT('%', #{intakeName,jdbcType=VARCHAR}, '%')
+ </if>
+ <if test="startDt != null">
+ and riad.dt >= #{startDt,jdbcType=DATE}
+ </if>
+ <if test="endDt != null">
+ and riad.dt <= #{endDt,jdbcType=DATE}
+ </if>
+ </where>
+ </select>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍-->
+ <select id="getIntakeAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay">
+ select CAST(riad.intake_id AS char) AS intakeId,
+ pint.name as intakeName,
+ riad.dt as dt,
+ riad.amount as amount,
+ riad.dt_last as dtLast,
+ riad.rtu_addr_last as rtuAddrLast,
+ CAST(riad.controller_id_last AS char) AS controllerIdLast,
+ riad.total_amount_last as totalAmountLast,
+ riad.rtu_dt_last as rtuDtLast
+ from rm_intake_amount_day riad
+ Left join pr_intake pint on pint.id = riad.intake_id
+ <where>
+ <if test="intakeId != null and intakeId != ''">
+ and riad.intake_id = #{intakeId}
+ </if>
+ <if test="intakeName != null and intakeName != ''">
+ and pint.name like CONCAT('%', #{intakeName,jdbcType=VARCHAR}, '%')
+ </if>
+ <if test="startDt != null">
+ and riad.dt >= #{startDt,jdbcType=DATE}
+ </if>
+ <if test="endDt != null">
+ and riad.dt <= #{endDt,jdbcType=DATE}
+ </if>
+ </where>
+ ORDER BY riad.id DESC
+<!-- <if test="pageCurr != null and pageSize != null">-->
+<!-- LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}-->
+<!-- </if>-->
+ <trim prefix="limit " >
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
- <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics">
- select intake_id, sum(amount) amount
- from rm_intake_amount_day
- where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT}
- group by intake_id
- </select>
+ <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics">
+ select intake_id, sum(amount) amount
+ from rm_intake_amount_day
+ where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT}
+ and id <![CDATA[<]]> #{endId, jdbcType=BIGINT}
+ group by intake_id
+ </select>
+
+ <!--鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲忚褰曟暟閲�-->
+ <select id="getDayIntakeAmountCount" resultType="java.lang.Long">
+ SELECT COUNT(*) AS recordCount
+ FROM pr_intake inta
+ WHERE inta.deleted = 0
+ </select>
+
+ <!--缁熻鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲�-->
+ <select id="getDayIntakeAmount" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount">
+ SELECT inta.id AS intakeId,
+ inta.name AS intakeNum,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 1), 0) AS amount1,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 2), 0) AS amount2,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 3), 0) AS amount3,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 4), 0) AS amount4,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 5), 0) AS amount5,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 6), 0) AS amount6,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 7), 0) AS amount7,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 8), 0) AS amount8,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 9), 0) AS amount9,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 10), 0) AS amount10,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 11), 0) AS amount11,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 12), 0) AS amount12,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 13), 0) AS amount13,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 14), 0) AS amount14,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 15), 0) AS amount15,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 16), 0) AS amount16,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 17), 0) AS amount17,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 18), 0) AS amount18,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 19), 0) AS amount19,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 20), 0) AS amount20,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 21), 0) AS amount21,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 22), 0) AS amount22,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 23), 0) AS amount23,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 24), 0) AS amount24,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 25), 0) AS amount25,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 26), 0) AS amount26,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 27), 0) AS amount27,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 28), 0) AS amount28,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 29), 0) AS amount29,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 30), 0) AS amount30,
+ IFNULL((SELECT IFNULL(amount, 0)
+ FROM rm_intake_amount_day intaDay
+ WHERE intaDay.intake_id = inta.id
+ AND YEAR(intaDay.dt) = #{year}
+ AND MONTH(intaDay.dt) = #{month}
+ AND DAY(intaDay.dt) = 31), 0) AS amount31
+ FROM pr_intake inta
+ WHERE inta.deleted = 0
+ ORDER BY inta.id
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
</mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
index 8f850a9..c617340 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
@@ -75,6 +75,16 @@
WHERE card.cardAddr = #{cardAddr} and card.cardNum = #{cardNum}
</select>
+
+ <!-- 鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱 -->
+ <select id="getCardsByAddrAndNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1">
+ SELECT
+ id,
+ money
+ FROM se_client_card
+ WHERE cardAddr = #{cardAddr} and cardNum = #{cardNum}
+ </select>
+
<!--鏍规嵁琛屾斂鍖哄垝涓叉ā绯婃煡璇㈡按鍗$紪鍙�-->
<select id="getCardNumOfMax" resultType="java.lang.String">
SELECT cardNum
@@ -104,6 +114,9 @@
<!--@mbg.generated-->
insert into se_client_card
<trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
<if test="protocol != null">
protocol,
</if>
@@ -160,6 +173,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=BIGINT},
+ </if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
@@ -280,8 +296,8 @@
<update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard">
<!--@mbg.generated-->
update se_client_card
- set protocol = #{protocol,jdbcType=VARCHAR}
- cardAddr = #{cardaddr,jdbcType=VARCHAR},
+ set protocol = #{protocol,jdbcType=VARCHAR},
+ cardAddr = #{cardaddr,jdbcType=VARCHAR},
cardNum = #{cardnum,jdbcType=BIGINT},
clientId = #{clientid,jdbcType=BIGINT},
money = #{money,jdbcType=FLOAT},
@@ -300,7 +316,11 @@
remarks = #{remarks,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
-
+ <update id="updateMoney" >
+ update se_client_card
+ set money = #{money,jdbcType=FLOAT}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
<!--鏍规嵁鍐滄埛涓婚敭鑾峰彇姘村崱鍒楄〃-->
<select id="getCardInfoByClientId" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo">
SELECT
@@ -308,22 +328,22 @@
'鐢ㄦ埛鍗�' AS cardType,
money,
(CASE
- WHEN state = 1 THEN "姝e父"
- WHEN state = 2 THEN "宸叉敞閿�"
- ELSE "宸叉寕澶�"
+ WHEN state = 1 THEN '姝e父'
+ WHEN state = 2 THEN '宸叉敞閿�'
+ ELSE '宸叉寕澶�'
END) AS state
FROM se_client_card
- WHERE clientId = ${clientId}
+ WHERE clientId = #{clientId,jdbcType=BIGINT}
</select>
<!--鏍规嵁姘村崱缂栧彿鑾峰彇鎿嶄綔璁板綍鍒楄〃-->
<select id="getOperateRecordsByCardNum" resultType="java.util.HashMap">
- SELECT * FROM v_operate WHERE cardNum = ${cardNum}
+ SELECT * FROM v_operate WHERE cardNum = #{cardNum,jdbcType=BIGINT}
</select>
<!--鏍规嵁姘村崱缂栧彿鑾峰彇浣欓-->
<select id="getMoneyByCardNum" resultType="java.lang.Float">
- SELECT money FROM se_client_card WHERE cardNum = ${cardNum}
+ SELECT money FROM se_client_card WHERE cardNum = #{cardNum,jdbcType=BIGINT}
</select>
<!--鏍规嵁姘村崱缂栧彿鑾峰彇鍏呭�兼�婚-->
@@ -332,7 +352,7 @@
SUM(his.amount) AS amount
FROM se_recharge_history his
INNER JOIN se_client_card card ON his.cardId = card.id
- WHERE card.cardNum = ${cardNum}
+ WHERE card.cardNum = #{cardNum,jdbcType=BIGINT}
</select>
<!--鏍规嵁姘村崱缂栧彿鑾峰彇鍗$墖鐘舵�侊細1-寮�鍗★紝2-琛ュ崱锛�3-鍏呭�硷紝4-鎸傚け锛�5-娉ㄩ攢锛�6-瑙i攣锛�7-鍐叉锛�8-娑堣垂-->
@@ -357,7 +377,7 @@
WHEN state = 3 THEN '宸叉寕澶�'
END) AS stateName
FROM se_client_card
- WHERE cardNum = ${cardNum}
+ WHERE cardNum = #{cardNum,jdbcType=BIGINT}
</select>
<!--鏍规嵁鎸囧畾鏉′欢鑾峰彇姘村崱鍒楄〃璁板綍鏁帮紝搴旂敤绋嬪簭浣跨敤-->
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
index cbe262b..895b2d3 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
@@ -152,6 +152,11 @@
intake_id = null
where intake_id = #{intakeId,jdbcType=BIGINT}
</update>
+ <update id="updateMoney" >
+ update se_virtual_card
+ set money = #{money,jdbcType=FLOAT}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
<!--楠岃瘉鍐滄埛鏄惁鎷ユ湁鎸囧畾鍚嶇О鐨勮櫄鎷熷崱-->
<select id="getRecordCountByName" resultType="java.lang.Integer">
SELECT COUNT(*) AS recordCount
@@ -176,8 +181,8 @@
money,
in_use AS inUse,
(CASE
- WHEN in_use = 0 THEN "鏈娇鐢�"
- WHEN in_use = 1 THEN "浣跨敤涓�"
+ WHEN in_use = 0 THEN '鏈娇鐢�'
+ WHEN in_use = 1 THEN '浣跨敤涓�'
END) AS inUseName
FROM se_virtual_card
<where>
@@ -196,8 +201,8 @@
money,
in_use AS inUse,
(CASE
- WHEN in_use = 0 THEN "鏈娇鐢�"
- WHEN in_use = 1 THEN "浣跨敤涓�"
+ WHEN in_use = 0 THEN '鏈娇鐢�'
+ WHEN in_use = 1 THEN '浣跨敤涓�'
END) AS inUseName
FROM se_virtual_card
WHERE id = #{vcId}
@@ -225,6 +230,15 @@
WHERE card.vc_num = #{vcNum}
</select>
+ <!-- 鏍规嵁姘村崱缂栧彿鑾峰彇铏氭嫙姘村崱 -->
+ <select id="getCardsByNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1">
+ SELECT
+ id,
+ money
+ FROM se_virtual_card
+ WHERE vc_num = #{cardNum}
+ </select>
+
<!--鏍规嵁琛屾斂鍖哄垝涓叉ā绯婃煡璇㈣櫄鎷熷崱缂栧彿-->
<select id="getVcCardNumOfMax" resultType="java.lang.String">
SELECT vc_num
@@ -248,14 +262,14 @@
recharge_time AS rechargeTime,
order_state AS orderState,
(CASE
- WHEN order_state = 1 THEN "鏈敮浠�"
- WHEN order_state = 2 THEN "宸叉敮浠�"
+ WHEN order_state = 1 THEN '鏈敮浠�'
+ WHEN order_state = 2 THEN '宸叉敮浠�'
END) AS orderStateName
FROM se_vc_recharge
where order_state = 2
order by recharge_time DESC
- <if test="pageCurr != null and pageSize != null">
- LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
+ <if test="start != null and count != null">
+ LIMIT #{start}, #{count}
</if>
</select>
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/dbSv/DbSv.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/dbSv/DbSv.java
index 97bada3..4c6687c 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/dbSv/DbSv.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/dbSv/DbSv.java
@@ -10,6 +10,8 @@
import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp;
import com.dy.pipIrrGlobal.pojoRm.*;
import com.dy.pipIrrGlobal.pojoSe.SeClient;
+import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
+import com.dy.pipIrrGlobal.voSe.VoCardInfo1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -27,9 +29,9 @@
@Service()
public class DbSv {
@Autowired
- private SeClientCardMapper seClientCardMapperDao;//鍐滄埛姘村崱DAO
+ private SeClientCardMapper seClientCardDao;//鍐滄埛姘村崱DAO
@Autowired
- private SeVirtualCardMapper seVirtualCardMapper;//鍐滄埛铏氭嫙姘村崱DAO
+ private SeVirtualCardMapper seVirtualCardDao ;//铏氭嫙鍗$浉鍏矰AO
@Autowired
private PrControllerTrampMapper prControllerTrampMapperDao;//娴佹氮鎺у埗鍣―AO
@Autowired
@@ -60,8 +62,6 @@
private RmLossDayMapper rmLossHistoryMapperDao ;//鎺у埗鍣ㄦ紡鎹熸按閲忕粺璁″巻鍙叉暟鎹瓺AO
@Autowired
private RmCommandHistoryMapper rmCommandHistoryDao ;//杩滅▼鍛戒护鏃ュ織鐩稿叧
- @Autowired
- private SeVirtualCardMapper seVirtualCardDao ;//铏氭嫙鍗$浉鍏�
@Autowired
private RmTimingReportHistoryMapper rmTimingReportHistoryDao; // 瀹氱偣涓婃姤鍘嗗彶鏁版嵁DAO
@@ -72,6 +72,7 @@
private RmOnHourReportHistoryMapper rmOnHourReportHistoryDao; // 鏁寸偣涓婃姤鍘嗗彶鏁版嵁DAO
@Autowired
private RmOnHourReportLastMapper rmOnHourReportLastDao; // 鏁寸偣涓婃姤鏈�鏂版暟鎹瓺AO
+
//@Autowired
//@Lazy
@@ -93,7 +94,7 @@
SeClient vo = null ;
if(NumUtil.isPlusIntNumber(icCardNo)){
Long icCardNoLong = Long.parseLong(icCardNo) ;
- Map<String, Object> map = seClientCardMapperDao.getClientIdAndNameByCardAddrAndCardNo(icCardAddr, icCardNoLong) ;
+ Map<String, Object> map = seClientCardDao.getClientIdAndNameByCardAddrAndCardNo(icCardAddr, icCardNoLong) ;
if(map != null && map.size() > 0) {
vo = new SeClient() ;
vo.setId(Long.parseLong(map.get("clientId").toString()));
@@ -111,7 +112,7 @@
SeClient vo = null ;
if(NumUtil.isPlusIntNumber(icCardNo)){
Long icCardNoLong = Long.parseLong(icCardNo) ;
- Map<String, Object> map = seVirtualCardMapper.getClientIdAndNameByVsCardNo(icCardNoLong) ;
+ Map<String, Object> map = seVirtualCardDao.getClientIdAndNameByVsCardNo(icCardNoLong) ;
if(map != null && map.size() > 0) {
vo = new SeClient() ;
vo.setId(Long.parseLong(map.get("clientId").toString()));
@@ -634,12 +635,70 @@
//////////////////////////////////////////////////////
//
+ // IC鍗$浉鍏�
+ //
+ //////////////////////////////////////////////////////
+ /**
+ * 寰楀埌鍐滄埛鍗�
+ * @param cardAddr
+ * @param cardNo
+ * @return
+ */
+ public VoCardInfo1 getIcCard(String cardAddr, String cardNo){
+ if(NumUtil.isPlusIntNumber(cardNo)){
+ Long icCardNoLong = Long.parseLong(cardNo) ;
+ List<VoCardInfo1> list = seClientCardDao.getCardsByAddrAndNum(cardAddr, icCardNoLong) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ }
+ return null ;
+ }
+ /**
+ * 寰楀埌鍐滄埛铏氭嫙鍗�
+ * @param cardNo
+ * @return
+ */
+ public VoCardInfo1 getVirIcCard(String cardNo){
+ if(NumUtil.isPlusIntNumber(cardNo)){
+ Long icCardNoLong = Long.parseLong(cardNo) ;
+ List<VoCardInfo1> list = seVirtualCardDao.getCardsByNum(icCardNoLong) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ }
+ return null ;
+ }
+
+ /**
+ * 鏇存柊瀹炰綋鍗″墿浣欓噾棰�
+ * @param id
+ * @param remainMoney
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void updateIcCardRemainMoney(Long id , Double remainMoney){
+ seClientCardDao.updateMoney(id,remainMoney);
+ }
+
+ /**
+ * 鏇存柊铏氭嫙鍗″墿浣欓噾棰�
+ * @param id
+ * @param remainMoney
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void updateVirIcCardRemainMoney(Long id , Double remainMoney){
+ seVirtualCardDao.updateMoney(id,remainMoney);
+ }
+
+ //////////////////////////////////////////////////////
+ //
// 鍛戒护鏃ュ織鐩稿叧
//
//////////////////////////////////////////////////////
public RmCommandHistory getCommandLog(String commandId){
return rmCommandHistoryDao.selectByPrimaryKey(Long.parseLong(commandId)) ;
}
+ @Transactional(rollbackFor = Exception.class)
public void updateCommandLog(RmCommandHistory po){
rmCommandHistoryDao.updateByPrimaryKey(po) ;
}
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealIcRemainMoney.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealIcRemainMoney.java
new file mode 100644
index 0000000..f15c4c8
--- /dev/null
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealIcRemainMoney.java
@@ -0,0 +1,167 @@
+package com.dy.rtuMw.server.rtuData.p206V1_0_0;
+
+import com.dy.common.mw.protocol.Data;
+import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1;
+import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd83CloseVo;
+import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd83OpenVo;
+import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd84Vo;
+import com.dy.pipIrrGlobal.voSe.VoCardInfo1;
+import com.dy.rtuMw.server.rtuData.TaskSurpport;
+import com.dy.rtuMw.server.rtuData.dbSv.DbSv;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/8/7 17:05
+ * @Description 澶勭悊IC鍗″墿浣欓噾棰�
+ */
+public class TkDealIcRemainMoney extends TaskSurpport {
+
+ private static final Logger log = LogManager.getLogger(TkDealIcRemainMoney.class.getName());
+
+ //绫籌D锛屼竴瀹氫笌Tree.xml閰嶇疆鏂囦欢涓厤缃竴鑷�
+ public static final String taskId = "TkDealIcRemainMoney";
+
+ /**
+ * 鎵ц鑺傜偣浠诲姟: 鍙栨按鍙f棩鐢ㄦ按閲忓拰婕忔崯閲�
+ *
+ * @param data 闇�瑕佸鐞嗙殑鏁版嵁
+ */
+ @Override
+ public void execute(Object data) {
+ Data d = (Data) data;
+ DataV1_0_1 dV1_0_1 = (DataV1_0_1) d.getSubData();//鍓嶉潰浠诲姟宸茬粡鍒ゆ柇涓嶄负null
+ Object cdObj = dV1_0_1.subData;
+ if (cdObj != null && (cdObj instanceof DataCd84Vo
+ || cdObj instanceof DataCd83OpenVo
+ || cdObj instanceof DataCd83CloseVo)){
+ Object[] objs = this.getTaskResults(TkPreGenObjs.taskId) ;
+ DbSv sv = (DbSv)objs[0] ;
+ try{
+ TkDealIcRemainMoney.UpDataVo vo = new TkDealIcRemainMoney.UpDataVo() ;
+ if(cdObj instanceof DataCd84Vo){
+ vo.valueFrom( (DataCd84Vo)cdObj, null, null);
+ }else if(cdObj instanceof DataCd83OpenVo){
+ vo.valueFrom(null, (DataCd83OpenVo)cdObj,null);
+ }else if(cdObj instanceof DataCd83CloseVo){
+ vo.valueFrom(null,null, (DataCd83CloseVo)cdObj);
+ }
+ this.doDeal(sv, dV1_0_1, vo);
+ }catch (Exception e){
+ log.error("淇濆瓨鍙栨按鍙f棩鐢ㄦ按閲忓拰婕忔崯閲忔暟鎹椂鍙戠敓寮傚父", e);
+ }
+ }
+ }
+
+ /**
+ * 涓氬姟澶勭悊
+ * @param sv 鏈嶅姟
+ * @param dV1_0_1 涓婃姤鏁版嵁
+ * @param dataVo 涓婃姤鏁版嵁瀵硅薄
+ */
+ private void doDeal(DbSv sv, DataV1_0_1 dV1_0_1, TkDealIcRemainMoney.UpDataVo dataVo) throws Exception {
+ if(dataVo.icCardNo != null){
+ if(!dataVo.isVirIcCard){
+ //瀹炰綋鍗�
+ if(dataVo.remainMoney != null){
+ VoCardInfo1 vo = sv.getIcCard(dataVo.icCardAddr, dataVo.icCardNo) ;
+ if(vo != null && vo.id != null){
+ if(vo.money != null){
+ if(vo.money > dataVo.remainMoney){
+ //鏈湴鐨勫墿浣欓噾棰� 澶т簬 RTU涓婃姤鐨勫墿浣欓噾棰�
+ this.updateIcCardRemainMoney(sv, vo.id, dataVo.remainMoney);
+ }else{
+ //鏈湴鐨勫墿浣欓噾棰� 灏忎簬 RTU涓婃姤鐨勫墿浣欓噾棰濓紝璇存槑褰撳墠涓婃姤鍙兘鏄ˉ鎶ユ垨鍏朵粬鍘熷洜閫犳垚鐨勭幇璞�
+ //涓嶅仛澶勭悊
+ }
+ }else{
+ //杩欑鎯呭喌涓�鑸笉浼氬瓨鍦紝闄ら潪鏈変粈涔堣鎿嶄綔閫犳垚
+ this.updateIcCardRemainMoney(sv, vo.id, dataVo.remainMoney);
+ }
+ }
+ }
+ }else{
+ //铏氭嫙鍗�
+ if(dataVo.remainMoney != null){
+ VoCardInfo1 vo = sv.getVirIcCard(dataVo.icCardNo) ;
+ if(vo != null && vo.id != null){
+ if(vo.money != null){
+ if(vo.money > dataVo.remainMoney){
+ //鏈湴鐨勫墿浣欓噾棰� 澶т簬 RTU涓婃姤鐨勫墿浣欓噾棰�
+ this.updateVirIcCardRemainMoney(sv, vo.id, dataVo.remainMoney);
+ }else{
+ //鏈湴鐨勫墿浣欓噾棰� 灏忎簬 RTU涓婃姤鐨勫墿浣欓噾棰濓紝璇存槑褰撳墠涓婃姤鍙兘鏄ˉ鎶ユ垨鍏朵粬鍘熷洜閫犳垚鐨勭幇璞�
+ //涓嶅仛澶勭悊
+ }
+ }else{
+ //杩欑鎯呭喌涓�鑸笉浼氬瓨鍦紝闄ら潪鏈変粈涔堣鎿嶄綔閫犳垚
+ this.updateVirIcCardRemainMoney(sv, vo.id, dataVo.remainMoney);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * 鏇存柊瀹炰綋鍗″墿浣欓噾棰�
+ * @param id
+ * @param remainMoney
+ */
+ private void updateIcCardRemainMoney(DbSv sv, Long id , Double remainMoney){
+ sv.updateIcCardRemainMoney(id,remainMoney);
+ }
+
+ /**
+ * 鏇存柊铏氭嫙鍗″墿浣欓噾棰�
+ * @param id
+ * @param remainMoney
+ */
+ private void updateVirIcCardRemainMoney(DbSv sv, Long id , Double remainMoney){
+ sv.updateVirIcCardRemainMoney(id, remainMoney);
+ }
+
+
+ private class UpDataVo{
+ public Boolean isVirIcCard ;//鏄惁涓鸿櫄鎷熷崱
+ public String icCardAddr ;//鍗″湴鍧�
+ public String icCardNo ;//鍗$紪鍙�
+ public Double remainMoney ; //鍓╀綑閲戦
+
+ public void valueFrom(DataCd84Vo vo84, DataCd83OpenVo vo83Op, DataCd83CloseVo vo83Cl){
+ if(this.isAll0(this.icCardAddr)){
+ this.isVirIcCard = true ;
+ }else{
+ this.isVirIcCard = false ;
+ }
+ if(vo84 != null){
+ this.icCardAddr = vo84.cardAddr ;
+ this.icCardNo = vo84.cardNo ;
+ this.remainMoney = vo84.remainMoney ;
+ }else if(vo83Op != null){
+ this.icCardAddr = vo83Op.icCardAddr ;
+ this.icCardNo = vo83Op.icCardNo ;
+ this.remainMoney = vo83Op.remainMoney ;
+ }else if(vo83Cl != null){
+ this.icCardAddr = vo83Cl.icCardAddr ;
+ this.icCardNo = vo83Cl.icCardNo ;
+ this.remainMoney = vo83Cl.remainMoney ;
+ }
+ }
+
+ private boolean isAll0(String s){
+ if(s != null && !s.trim().equals("")){
+ s = s.replaceAll("0", "") ;
+ if(s.equals("")){
+ return true ;
+ }else{
+ return false ;
+ }
+ }
+ return false ;
+ }
+ }
+
+
+}
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/RtuDataDealTree.xml b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/RtuDataDealTree.xml
index 55cd26e..c46cc46 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/RtuDataDealTree.xml
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/RtuDataDealTree.xml
@@ -22,7 +22,8 @@
<task id="TkDealCloseValveReport" name="鎺у埗鍣ㄥ叧闃�涓婃姤(鍔熻兘鐮�83)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealCloseValveReport" />
<task id="TkDealLoss" name="鍙栨按鍙f棩婕忔崯閲�(鍔熻兘鐮丆0)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealLoss" />
<task id="TkDealIntakeAmountDay" name="鍙栨按鍙f棩鐢ㄦ按閲�(鍔熻兘鐮�84銆佸姛鑳界爜83銆佸姛鑳界爜C0)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealIntakeAmountDay" />
- <task id="TkDealClientAmountDay" name="鍐滄埛鏃ョ敤姘撮噺(鍔熻兘鐮�84銆佸姛鑳界爜83銆佸姛鑳界爜C0)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealClientAmountDay" />
+ <task id="TkDealClientAmountDay" name="鍐滄埛鏃ョ敤姘撮噺(鍔熻兘鐮�83)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealClientAmountDay" />
+ <task id="TkDealIcRemainMoney" name="IC鍗″墿浣欓噾棰�(鍔熻兘鐮�84銆佸姛鑳界爜83)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealIcRemainMoney" />
</task>
<!-- 璇嗗埆鍛戒护鍝嶅簲鏁版嵁 -->
<task id="TkFindComResponse" name="璇嗗埆鍝嶅簲鍛戒护鏁版嵁" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkFindComResponse">
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
index 4dbc9b0..74b0257 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
@@ -1,22 +1,9 @@
package com.dy.pipIrrStatistics.intake;
import com.dy.common.webUtil.QueryResultVo;
-import com.dy.pipIrrGlobal.daoRm.RmOnHourReportHistoryMapper;
-import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper;
-import com.dy.pipIrrGlobal.daoRm.RmOnHourReportLastMapper;
-import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper;
+import com.dy.pipIrrGlobal.daoRm.*;
import com.dy.pipIrrGlobal.voSt.*;
import com.dy.pipIrrStatistics.intake.qo.*;
-import com.dy.pipIrrGlobal.voSt.VoBatteryVolt;
-import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow;
-import com.dy.pipIrrGlobal.voSt.VoIntake;
-import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount;
-import com.dy.pipIrrGlobal.voSt.VoSignalIntensity;
-import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO;
-import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO;
-import com.dy.pipIrrStatistics.intake.qo.IntakeCountValueQO;
-import com.dy.pipIrrStatistics.intake.qo.CommonQO;
-import com.dy.pipIrrStatistics.intake.qo.SignalIntensityQO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +12,8 @@
import java.text.DecimalFormat;
import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -45,9 +34,11 @@
private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper;
@Autowired
private RmOnHourReportLastMapper rmOnHourReportLastMapper;
-
@Autowired
private RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper;
+
+ @Autowired
+ private RmIntakeAmountDayMapper rmIntakeAmountDayMapper;
@Value("${rtu.batteryVolt}")
private Double batteryVolt;
@@ -649,4 +640,32 @@
rsVo.obj = rmOpenCloseValveHistoryMapper.getNoOpenHaveCloseIntakes(params);
return rsVo ;
}
+
+ /**
+ * 缁熻鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲�
+ * @param qo
+ * @return
+ */
+ public QueryResultVo<List<VoDayIntakeAmount>> getDayIntakeAmount(DayIntakeAmountQO qo) {
+ Calendar calendar = Calendar.getInstance();
+ Integer year = Optional.ofNullable(qo.getYear()).orElse(calendar.get(Calendar.YEAR));
+ Integer month = Optional.ofNullable(qo.getMonth()).orElse(calendar.get(Calendar.MONTH));
+ qo.setYear(year);
+ qo.setMonth(month);
+
+ // 鐢熸垚鏌ヨ鍙傛暟
+ Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+ // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+ Long itemTotal = Optional.ofNullable(rmIntakeAmountDayMapper.getDayIntakeAmountCount(params)).orElse(0L);
+
+ QueryResultVo<List<VoDayIntakeAmount>> rsVo = new QueryResultVo<>() ;
+
+ rsVo.pageSize = qo.pageSize ;
+ rsVo.pageCurr = qo.pageCurr ;
+
+ rsVo.calculateAndSet(itemTotal, params);
+ rsVo.obj = rmIntakeAmountDayMapper.getDayIntakeAmount(params);
+ return rsVo ;
+ }
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
index 6c4997e..ca2a113 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
@@ -6,16 +6,6 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.voSt.*;
import com.dy.pipIrrStatistics.intake.qo.*;
-import com.dy.pipIrrGlobal.voSt.VoBatteryVolt;
-import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow;
-import com.dy.pipIrrGlobal.voSt.VoIntake;
-import com.dy.pipIrrGlobal.voSt.VoSignalIntensity;
-import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO;
-import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount;
-import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO;
-import com.dy.pipIrrStatistics.intake.qo.SignalIntensityQO;
-import com.dy.pipIrrStatistics.intake.qo.IntakeCountValueQO;
-import com.dy.pipIrrStatistics.result.StatisticlResultCode;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -336,4 +326,20 @@
return BaseResponseUtils.buildException(e.getMessage()) ;
}
}
+
+ /**
+ * 缁熻鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲�
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "/getDayIntakeAmount")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoDayIntakeAmount>>> getDayIntakeAmount(DayIntakeAmountQO qo) {
+ try {
+ return BaseResponseUtils.buildSuccess(intakeSv.getDayIntakeAmount(qo));
+ } catch (Exception e) {
+ log.error("鑾峰彇璁板綍寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/DayIntakeAmountQO.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/DayIntakeAmountQO.java
new file mode 100644
index 0000000..47a6ed5
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/DayIntakeAmountQO.java
@@ -0,0 +1,25 @@
+package com.dy.pipIrrStatistics.intake.qo;
+
+import com.dy.common.webUtil.QueryConditionVo;
+import lombok.Data;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2024-08-08 9:59
+ * @LastEditTime 2024-08-08 9:59
+ * @Description
+ */
+
+@Data
+public class DayIntakeAmountQO extends QueryConditionVo {
+
+ /**
+ * 骞�
+ */
+ private Integer year;
+
+ /**
+ * 鏈�
+ */
+ private Integer month;
+}
--
Gitblit v1.8.0