From 83871ec0498b78bdecf5d550051e3d971f7470c9 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 20 九月 2024 10:23:08 +0800
Subject: [PATCH] 优化代码 获取农户数据

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 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 cfebc59..003c4b4 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
@@ -351,7 +351,7 @@
         cli.phone,
         cli.idCard,
         cli.area,
-        (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id) AS cardCount,
+        (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
@@ -380,6 +380,16 @@
       <if test = "address != null and address !=''">
         AND cli.address like CONCAT('%',#{address},'%')
       </if>
+
+      <if test = "villageId != null and villageId !=''">
+        AND cli.villageId =  #{villageId}
+      </if>
+      <if test = "blockId != null and blockId !=''">
+        AND cli.blockId =  #{blockId}
+      </if>
+      <if test = "divideId != null and divideId !=''">
+        AND cli.divideId =  #{divideId}
+      </if>
     </where>
     ORDER BY cli.operateDt DESC
     <trim prefix="limit " >

--
Gitblit v1.8.0