From c7c8554e2b9809bc90ac4a43fdaa39dfe16f4ab0 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 09 五月 2025 14:09:32 +0800
Subject: [PATCH] “远程测控”功能返回数据中增加protocol和protocolVersion属性,以备前端做多协议兼容。

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml |  111 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 107 insertions(+), 4 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
index 0172422..5b0014b 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
@@ -302,9 +302,33 @@
   </select>
 
   <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛璁板綍鏁�-->
-  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
-    SELECT
-        COUNT(*) AS recordCount
+<!--  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">-->
+  <select id="getRecordCount" resultType="com.dy.pipIrrGlobal.voSe.VoClient">
+<!--    SELECT-->
+<!--        COUNT(*) AS recordCount-->
+    SELECT DISTINCT
+        cli.countyId,
+        dis_con.name AS countryName,
+        cli.townId,
+        dis_town.name AS townName,
+        cli.villageId,
+        dis_village.name AS villageName,
+        cli.blockId,
+        blo.name AS blockName,
+        cli.divideId,
+        divi.name AS divideName,
+        cli.typeId,
+        wat.typeName AS waterTypeName,
+        cli.id AS clientId,
+        cli.name,
+        cli.clientNum,
+        cli.phone,
+        cli.idCard,
+        cli.area,
+        (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id)+(SELECT COUNT(*) FROM se_virtual_card WHERE client_id = cli.id) AS cardCount,
+        cli.address,
+        cli.remarks,
+        cli.operateDt
     FROM se_client cli
         LEFT JOIN ba_district dis_con ON cli.countyId = dis_con.id
         LEFT JOIN ba_district dis_town ON cli.townId = dis_town.id
@@ -351,7 +375,7 @@
 
   <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏁版嵁-->
   <select id="getClients" resultType="com.dy.pipIrrGlobal.voSe.VoClient">
-    SELECT
+    SELECT DISTINCT
         cli.countyId,
         dis_con.name AS countryName,
         cli.townId,
@@ -525,4 +549,83 @@
       </if>
     </trim>
   </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛璁板綍鏁癬鍏呭�兼満-->
+  <select id="getTermClientCount" resultType="java.lang.Long">
+    SELECT
+      count(*)
+    FROM se_client cli
+        LEFT JOIN ba_district dis_village ON cli.villageId = dis_village.id
+    <where>
+      AND cli.disabled = 0
+      AND cli.deleted = 0
+      <if test = "name != null and name !=''">
+        AND cli.name like CONCAT('%',#{name},'%')
+      </if>
+
+      <if test = "clientNum != null and clientNum !=''">
+        AND cli.clientNum like CONCAT('%',#{clientNum},'%')
+      </if>
+
+      <if test = "phone != null and phone !=''">
+        AND cli.phone like CONCAT('%',#{phone},'%')
+      </if>
+    </where>
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏁版嵁_鍏呭�兼満-->
+  <select id="getTermClients" resultType="com.dy.pipIrrGlobal.voSe.VoTermClient">
+    SELECT
+        cli.id AS clientId,
+        cli.clientNum,
+        cli.name,
+        cli.phone,
+        cli.idCard,
+        dis_village.name AS villageName,
+        cli.address,
+        (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id)+(SELECT COUNT(*) FROM se_virtual_card WHERE client_id = cli.id) AS cardCount,
+        cli.operateDt,
+        cli.districtNum
+    FROM se_client cli
+        LEFT JOIN ba_district dis_village ON cli.villageId = dis_village.id
+    <where>
+      AND cli.disabled = 0
+      AND cli.deleted = 0
+      <if test = "name != null and name !=''">
+        AND cli.name like CONCAT('%',#{name},'%')
+      </if>
+
+      <if test = "clientNum != null and clientNum !=''">
+        AND cli.clientNum like CONCAT('%',#{clientNum},'%')
+      </if>
+
+      <if test = "phone != null and phone !=''">
+        AND cli.phone like CONCAT('%',#{phone},'%')
+      </if>
+    </where>
+    ORDER BY cli.operateDt DESC
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+
+  <!--鏍规嵁鍐滄埛ID鑾峰彇涓�涓啘鎴锋暟鎹甠鍏呭�兼満-->
+  <select id="getTermOneClient" resultType="com.dy.pipIrrGlobal.voSe.VoTermClient">
+    SELECT
+      cli.id AS clientId,
+      cli.clientNum,
+      cli.name,
+      cli.phone,
+      cli.idCard,
+      dis_village.name AS villageName,
+      cli.address,
+      (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id)+(SELECT COUNT(*) FROM se_virtual_card WHERE client_id = cli.id) AS cardCount,
+      cli.operateDt,
+      cli.districtNum
+    FROM se_client cli
+           LEFT JOIN ba_district dis_village ON cli.villageId = dis_village.id
+    WHERE cli.disabled = 0 AND cli.deleted = 0 AND cli.id = #{clientId}
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0