From aeb7d068be92312dcdcea75e1240bcf2a78dd0fe Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 29 Jul 2024 16:49:58 +0800
Subject: [PATCH] 代码优化

---
 src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml b/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
index 642c787..a9b6cda 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
+++ b/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
@@ -20,12 +20,23 @@
         jcir.address,
         jcir.deleted_flag,
         bu.`name`,
-        bd.region_code
+        bd.region_code,
+        br.town_name as townStreetName,
+        br.name as neiName
         FROM
         jczz_check_in_records jcir
         LEFT JOIN blade_user bu ON bu.id = jcir.create_user_id
         LEFT JOIN blade_dept bd on bd.id = bu.dept_id
+        LEFT JOIN jczz_grid jg on jg.grid_code=jcir.grid_code
+        LEFT JOIN blade_region br on br.code = jg.community_code
         <where>
+            <if test="checkInRecords.townStreetName!=null and checkInRecords.townStreetName!=''">
+                and br.town_name like concat('%',#{checkInRecords.townStreetName},'%')
+            </if>
+
+            <if test="checkInRecords.neiName!=null and checkInRecords.neiName!=''">
+                and br.name like concat('%',#{checkInRecords.neiName},'%')
+            </if>
             <if test="checkInRecords.id != null ">and jcir.id = #{checkInRecords.id}</if>
             <if test="checkInRecords.createUserId != null ">and jcir.create_user_id = #{checkInRecords.createUserId}
             </if>

--
Gitblit v1.9.3