From c4d56f4a2c7687739f3bf0f43bcc1f35c9bbeb8b Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 14 五月 2025 15:18:44 +0800
Subject: [PATCH] 1、表阀一体协议解析同步新版本;2、默认设备是表阀一体(0x02)

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SpecialMapper.xml |  102 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 88 insertions(+), 14 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SpecialMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SpecialMapper.xml
index 7e9c338..01a5a70 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SpecialMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SpecialMapper.xml
@@ -8,25 +8,30 @@
         from rm_open_close_valve_history mTb
         left join pr_intake piTb on piTb.id = mTb.intake_id
         left join se_client scTb on scTb.id = mTb.client_id
-        <where>
-            <if test = "fromDate != null">
-                mTb.cl_dt <![CDATA[>=]]> #{fromDate, javaType=DATE, jdbcType=TIMESTAMP}
+        where mTb.cl_this_money = 0.0
+        <trim prefix="and" suffixOverrides="and">
+            <if test = "duration != null">
+                mTb.cl_this_time > #{duration, javaType=INTEGER, jdbcType=INTEGER} and
+            </if>
+           <if test = "fromDate != null">
+                mTb.cl_dt <![CDATA[>=]]> #{fromDate, javaType=DATE, jdbcType=TIMESTAMP} and
             </if>
             <if test = "intakeNum != null and intakeNum != '' ">
-                and piTb.name = #{intakeNum, jdbcType=VARCHAR}
+                piTb.name = #{intakeNum, jdbcType=VARCHAR} and
             </if>
             <if test = "clientNum != null and clientNum != '' ">
-                and scTb.clientNum = #{clientNum, jdbcType=VARCHAR}
+                scTb.clientNum = #{clientNum, jdbcType=VARCHAR} and
             </if>
             <if test = "clientName != null and clientName != '' ">
-                and scTb.name = #{clientName, jdbcType=VARCHAR}
+                scTb.name = #{clientName, jdbcType=VARCHAR} and
             </if>
-        </where>
+        </trim>
     </select>
+
 
     <select id="selectStealSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voSpecial.VoSteal">
         select mTb.id as id, mTb.intake_id as intakeId, mTb.client_id as clientId,
-        piTb.name as intakeNum,
+        piTb.name as intakeNum, piTb.lng as intakeLng, piTb.lat as intakeLat,
         scTb.name as clientName, scTb.clientNum as clientNum,
         mTb.op_dt as openDt, mTb.op_type as opType, mTb.op_total_amount as openTotalAmount, mTb.op_remain_money as openRemainMoney,
         mTb.cl_dt as closeDt, mTb.cl_type as clType, mTb.cl_total_amount as closeTotalAmount, mTb.cl_remain_money as closeRemainMoney,
@@ -34,20 +39,24 @@
         from rm_open_close_valve_history mTb
         left join pr_intake piTb on piTb.id = mTb.intake_id
         left join se_client scTb on scTb.id = mTb.client_id
-        <where>
+        where mTb.cl_this_money = 0.0
+        <trim prefix="and" suffixOverrides="and">
+            <if test = "duration != null">
+                mTb.cl_this_time > #{duration, javaType=INTEGER, jdbcType=INTEGER} and
+            </if>
             <if test = "fromDate != null">
-                mTb.cl_dt <![CDATA[>=]]> #{fromDate, javaType=DATE, jdbcType=TIMESTAMP}
+                mTb.cl_dt <![CDATA[>=]]> #{fromDate, javaType=DATE, jdbcType=TIMESTAMP} and
             </if>
             <if test = "intakeNum != null and intakeNum != '' ">
-                and piTb.name = #{intakeNum, jdbcType=VARCHAR}
+                piTb.name = #{intakeNum, jdbcType=VARCHAR} and
             </if>
             <if test = "clientNum != null and clientNum != '' ">
-                and scTb.clientNum = #{clientNum, jdbcType=VARCHAR}
+                scTb.clientNum = #{clientNum, jdbcType=VARCHAR} and
             </if>
             <if test = "clientName != null and clientName != '' ">
-                and scTb.name = #{clientName, jdbcType=VARCHAR}
+                scTb.name = #{clientName, jdbcType=VARCHAR} and
             </if>
-        </where>
+        </trim>
         order by mTb.id DESC
         <trim prefix="limit " >
             <if test="start != null and count != null">
@@ -55,4 +64,69 @@
             </if>
         </trim>
     </select>
+
+
+    <select id="selectAbnormalCloseValveTotal" parameterType="java.util.Map" resultType="java.lang.Long">
+        select
+        count(*)
+        from rm_open_close_valve_history mTb
+        left join pr_intake piTb on piTb.id = mTb.intake_id
+        left join se_client scTb on scTb.id = mTb.client_id
+        where mTb.cl_type != 2
+        <trim prefix="and" suffixOverrides="and">
+            <if test = "atDateStart != null">
+                mTb.cl_dt <![CDATA[>=]]> #{atDateStart, javaType=DATE, jdbcType=TIMESTAMP} and
+            </if>
+            <if test = "atDateEnd != null">
+                mTb.cl_dt <![CDATA[<=]]> #{atDateEnd, javaType=DATE, jdbcType=TIMESTAMP} and
+            </if>
+            <if test = "intakeNum != null and intakeNum != '' ">
+                piTb.name = #{intakeNum, jdbcType=VARCHAR} and
+            </if>
+            <if test = "clientNum != null and clientNum != '' ">
+                scTb.clientNum = #{clientNum, jdbcType=VARCHAR} and
+            </if>
+            <if test = "clientName != null and clientName != '' ">
+                scTb.name = #{clientName, jdbcType=VARCHAR} and
+            </if>
+        </trim>
+    </select>
+
+
+    <select id="selectAbnormalCloseValveSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voSpecial.VoAbnormalCloseValve">
+        select mTb.id as id, mTb.intake_id as intakeId, mTb.client_id as clientId,
+        piTb.name as intakeNum, piTb.lng as intakeLng, piTb.lat as intakeLat,
+        scTb.name as clientName, scTb.clientNum as clientNum,
+        mTb.op_dt as openDt, mTb.op_type as opType, mTb.op_total_amount as openTotalAmount, mTb.op_remain_money as openRemainMoney,
+        mTb.cl_dt as closeDt, mTb.cl_type as clType, mTb.cl_total_amount as closeTotalAmount, mTb.cl_remain_money as closeRemainMoney,
+        mTb.cl_this_amount as thisAmount, mTb.cl_this_money as thisMoney, mTb.cl_this_time as thisTime
+        from rm_open_close_valve_history mTb
+        left join pr_intake piTb on piTb.id = mTb.intake_id
+        left join se_client scTb on scTb.id = mTb.client_id
+        where mTb.cl_type != 2
+        <trim prefix="and" suffixOverrides="and">
+            <if test = "atDateStart != null">
+                mTb.cl_dt <![CDATA[>=]]> #{atDateStart, javaType=DATE, jdbcType=TIMESTAMP} and
+            </if>
+            <if test = "atDateEnd != null">
+                mTb.cl_dt <![CDATA[<=]]> #{atDateEnd, javaType=DATE, jdbcType=TIMESTAMP} and
+            </if>
+            <if test = "intakeNum != null and intakeNum != '' ">
+                piTb.name = #{intakeNum, jdbcType=VARCHAR} and
+            </if>
+            <if test = "clientNum != null and clientNum != '' ">
+                scTb.clientNum = #{clientNum, jdbcType=VARCHAR} and
+            </if>
+            <if test = "clientName != null and clientName != '' ">
+                scTb.name = #{clientName, jdbcType=VARCHAR} and
+            </if>
+        </trim>
+        order by mTb.id DESC
+        <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

--
Gitblit v1.8.0