From 55d677758efadb6d42e6d4e595cecc2c50c20d5a Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Sat, 23 Dec 2023 17:19:12 +0800
Subject: [PATCH] bug修复

---
 src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml |   45 +++++++++++++++++++++++++++++++++------------
 1 files changed, 33 insertions(+), 12 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 7568f8e..b2ac464 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
+++ b/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
@@ -3,23 +3,44 @@
 <mapper namespace="org.springblade.modules.checkInRecords.mapper.CheckInRecordsMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="checkInRecordsResultMap" type="org.springblade.modules.checkInRecords.entity.CheckInRecordsEntity">
+    <resultMap id="checkInRecordsResultMap" type="org.springblade.modules.checkInRecords.vo.CheckInRecordsVO">
     </resultMap>
 
 
     <select id="selectCheckInRecordsPage" resultMap="checkInRecordsResultMap">
-        select * from jczz_check_in_records
+        SELECT
+        jcir.id,
+        jcir.create_user_id,
+        jcir.create_time,
+        jcir.work_theme,
+        jcir.work_content,
+        jcir.img,
+        jcir.lng,
+        jcir.lat,
+        jcir.address,
+        jcir.deleted_flag,
+        bu.`name`
+        FROM
+        jczz_check_in_records jcir
+        LEFT JOIN blade_user bu ON bu.id = jcir.create_user_id
         <where>
-            <if test="checkInRecords.id != null "> and id = #{checkInRecords.id}</if>
-            <if test="checkInRecords.createUserId != null "> and create_user_id = #{checkInRecords.createUserId}</if>
-            <if test="checkInRecords.createTime != null "> and create_time = #{checkInRecords.createTime}</if>
-            <if test="checkInRecords.workTheme != null  and workTheme != ''"> and work_theme = #{checkInRecords.workTheme}</if>
-            <if test="checkInRecords.workContent != null  and workContent != ''"> and work_content = #{checkInRecords.workContent}</if>
-            <if test="checkInRecords.img != null  and img != ''"> and img = #{checkInRecords.img}</if>
-            <if test="checkInRecords.lng != null  and lng != ''"> and lng = #{checkInRecords.lng}</if>
-            <if test="checkInRecords.lat != null  and lat != ''"> and lat = #{checkInRecords.lat}</if>
-            <if test="checkInRecords.address != null  and address != ''"> and address = #{checkInRecords.address}</if>
-            <if test="checkInRecords.deletedFlag != null "> and deleted_flag = #{checkInRecords.deletedFlag}</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>
+            <if test="checkInRecords.createTime != null "> and jcir.create_time = #{checkInRecords.createTime}</if>
+            <if test="checkInRecords.workTheme != null  and checkInRecords.workTheme != ''"> and jcir.work_theme = #{checkInRecords.workTheme}</if>
+            <if test="checkInRecords.workContent != null  and checkInRecords.workContent != ''"> and jcir.work_content = #{checkInRecords.workContent}</if>
+            <if test="checkInRecords.img != null  and checkInRecords.img != ''"> and jcir.img = #{checkInRecords.img}</if>
+            <if test="checkInRecords.lng != null  and checkInRecords.lng != ''"> and jcir.lng = #{checkInRecords.lng}</if>
+            <if test="checkInRecords.lat != null  and checkInRecords.lat != ''"> and jcir.lat = #{checkInRecords.lat}</if>
+            <if test="checkInRecords.address != null  and checkInRecords.address != ''"> and jcir.address = #{checkInRecords.address}</if>
+            <if test="checkInRecords.deletedFlag != null "> and jcir.deleted_flag = #{checkInRecords.deletedFlag}</if>
+            <if test="checkInRecords.name != null and checkInRecords.name !='' "> and bu.name like concat('%',#{checkInRecords.name},'%') </if>
+            <if test="checkInRecords.startTime!=null and checkInRecords.startTime!=''">
+                AND date_format(jcir.create_time,'%Y-%m-%d')&gt;= #{checkInRecords.startTime}
+            </if>
+            <if test="checkInRecords.endTime!=null and checkInRecords.endTime!=''">
+                AND date_format(jcir.create_time,'%Y-%m-%d')&lt;= #{checkInRecords.endTime}
+            </if>
         </where>
 
     </select>

--
Gitblit v1.9.3