From 9f8f9d13c42ca8cdccbf351069082a5fdccef2e4 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Mon, 25 Mar 2024 17:30:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/org/springblade/modules/police/mapper/PoliceAlarmRecordsMapper.xml |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/springblade/modules/police/mapper/PoliceAlarmRecordsMapper.xml b/src/main/java/org/springblade/modules/police/mapper/PoliceAlarmRecordsMapper.xml
index 0a26fa9..6aec415 100644
--- a/src/main/java/org/springblade/modules/police/mapper/PoliceAlarmRecordsMapper.xml
+++ b/src/main/java/org/springblade/modules/police/mapper/PoliceAlarmRecordsMapper.xml
@@ -8,12 +8,16 @@
 
 
     <select id="selectPoliceAlarmRecordsPage" resultMap="policeAlarmRecordsResultMap">
-        select jpar.* from jczz_police_alarm_records jpar
+        select
+        jpar.*,
+        bdb.dict_value as alarmTypeName
+        from jczz_police_alarm_records jpar
         LEFT JOIN jczz_grid jg on jg.grid_code = jpar.grid_code and jg.is_deleted = 0
         LEFT JOIN jczz_police_affairs_grid jpag on jpar.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
         LEFT JOIN blade_region br on br.code = jpag.community_code
+        LEFT JOIN blade_dict_biz bdb ON bdb.dict_key = jpar.alarm_type and bdb.is_deleted = 0 and bdb.code = 'applyAlarmType'
         <where>
-            <if test="vo.status != null ">
+            <if test="vo.status != null">
                 and jpar.status = #{vo.status}
             </if>
             <if test="vo.alarmDescribe != null and vo.alarmDescribe != ''">
@@ -21,6 +25,21 @@
             </if>
             <if test="vo.policeName != null and vo.policeName != ''">
                 and jpar.police_name like concat('%',#{vo.policeName},'%')
+            </if>
+            <if test="vo.startTime != null and vo.startTime != ''">
+                and date_format(jpar.create_time,'%Y-%m-%d') &gt;= #{vo.startTime}
+            </if>
+            <if test="vo.endTime != null and vo.endTime != ''">
+                and date_format(jpar.create_time,'%Y-%m-%d') &lt;= #{vo.endTime}
+            </if>
+            <if test="vo.searchKey!=null and vo.searchKey!=''">
+                and CONCAT(
+                ifnull(jpar.name,''),
+                ifnull(jpar.phone,''),
+                ifnull(jpar.address,''),
+                ifnull(jpar.alarm_describe,''),
+                ifnull(jpar.police_name,'')
+                ) like CONCAT ('%', #{vo.searchKey},'%')
             </if>
             <if test="isAdministrator==2">
                 <choose>
@@ -71,14 +90,14 @@
                             <otherwise>
                                 and
                                 (
-                                jg.grid_code in ('') or jpag.community_code in in ('')
+                                jg.grid_code in ('') or jpag.community_code in ('')
                                 )
                             </otherwise>
                         </choose>
                     </otherwise>
                 </choose>
             </if>
-           and  is_deleted = 0
+           and jpar.is_deleted = 0
         </where>
     </select>
 

--
Gitblit v1.9.3