From b195148e1b60361197cfb5abe6e283f2cd5a7454 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 07 Mar 2023 17:02:03 +0800
Subject: [PATCH] 火灾补录

---
 src/main/java/org/springblade/modules/fire/mapper/FireMapper.xml |   37 ++++++++++++++++++++++++++++++++++---
 1 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/springblade/modules/fire/mapper/FireMapper.xml b/src/main/java/org/springblade/modules/fire/mapper/FireMapper.xml
index c89abc8..4621d96 100644
--- a/src/main/java/org/springblade/modules/fire/mapper/FireMapper.xml
+++ b/src/main/java/org/springblade/modules/fire/mapper/FireMapper.xml
@@ -3,7 +3,7 @@
 <mapper namespace="org.springblade.modules.fire.mapper.FireMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="fireResultMap" type="org.springblade.modules.fire.entity.FireEntity">
+    <resultMap id="fireResultMap" type="org.springblade.modules.fire.vo.FireVO">
         <result column="id" property="id"/>
         <result column="no" property="no"/>
         <result column="location" property="location" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
@@ -20,13 +20,44 @@
         <result column="update_time" property="updateTime"/>
         <result column="is_deleted" property="isDeleted"/>
         <result column="tenant_id" property="tenantId"/>
+        <result column="supplementId" property="supplementId"/>
     </resultMap>
 
 
     <select id="selectFirePage" resultMap="fireResultMap">
-        select * from sys_fire where is_deleted = 0
+        select fire.*,sup.id supplementId from sys_fire fire
+        LEFT JOIN sys_fire_supplement sup ON sup.fire_id = fire.id AND sup.is_deleted = 0
+        where fire.is_deleted = 0
         <if test="fire.location !=null and fire.location !='' ">
-            AND location = #{fire.location,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler}
+            AND fire.location = #{fire.location,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler}
+        </if>
+        <if test="fire.no !=null and fire.no !=''">
+            AND fire.no LIKE CONCAT('%',#{fire.no},'%')
+        </if>
+        <if test="fire.address !=null and fire.address !=''">
+            AND fire.address LIKE CONCAT('%',#{fire.address},'%')
+        </if>
+        <if test="fire.findWay!=null and fire.findWay !=''">
+            AND fire.find_way = #{fire.findWay}
+        </if>
+        <if test="fire.status!=null and fire.status !=''">
+            AND fire.status = #{fire.status}
+        </if>
+        <if test="fire.alarmTimeStart !=null and fire.alarmTimeStart !=''">
+            AND DATE_FORMAT(fire.alarm_time,'%Y-%m-%d') &gt;= #{fire.alarmTimeStart}
+        </if>
+        <if test="fire.alarmTimeEnd !=null and fire.alarmTimeEnd !=''">
+            AND DATE_FORMAT(fire.alarm_time,'%Y-%m-%d') &lt;= #{fire.alarmTimeEnd}
+        </if>
+
+
+    </select>
+    <select id="getAll" resultMap="fireResultMap">
+        select fire.*,sup.id supplementId from sys_fire fire
+        LEFT JOIN sys_fire_supplement sup ON sup.fire_id = fire.id AND sup.is_deleted = 0
+        where fire.is_deleted = 0 AND sup.id IS NULL
+        <if test="fire.no !=null and fire.no !=''">
+            AND fire.no LIKE CONCAT('%',#{fire.no},'%')
         </if>
 
     </select>

--
Gitblit v1.9.3