From 9b8bb10acf41929d9fa2750fa069302ad317c8cf Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期六, 06 七月 2024 14:40:26 +0800
Subject: [PATCH] 电磁锁车辆查询修改提交

---
 ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
index 3f246dc..8786af4 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.alarm.access.mapper.ArdAlarmAccessMapper">
-    
+
     <resultMap type="ArdAlarmAccess" id="ArdAlarmAccessResult">
         <result property="id"    column="id"    />
         <result property="serialNo"    column="serial_no"    />
@@ -31,16 +31,25 @@
 
     <select id="selectArdAlarmAccessList" parameterType="ArdAlarmAccess" resultMap="ArdAlarmAccessResult">
         <include refid="selectArdAlarmAccessVo"/>
-        <where>  
+        <where>
+            <if test="acsName!=null and acsName!=''">
+                AND acs_name like concat('%', #{acsName}, '%')
+            </if>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+                AND alarm_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
+            </if>
+            <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+                AND alarm_time &lt;= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
+            </if>
         </where>
         order by alarm_time desc
     </select>
-    
+
     <select id="selectArdAlarmAccessById" parameterType="String" resultMap="ArdAlarmAccessResult">
         <include refid="selectArdAlarmAccessVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertArdAlarmAccess" parameterType="ArdAlarmAccess">
         insert into ard_alarm_access
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -114,7 +123,7 @@
     </delete>
 
     <delete id="deleteArdAlarmAccessByIds" parameterType="String">
-        delete from ard_alarm_access where id in 
+        delete from ard_alarm_access where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
@@ -163,4 +172,15 @@
           and alarm_time &lt;= #{alarmTime}
           and view_time is null
     </update>
-</mapper>
\ No newline at end of file
+
+    <select id="accessYear" resultType="com.ruoyi.statistical.vo.CountVo">
+        select to_char(alarm_time::DATE, 'MM') as date,count(id)
+        from ard_alarm_access
+        where alarm_time &gt;= #{start} and  alarm_time &lt;= #{end}  group by date order by date
+    </select>
+    <select id="accessMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+        select to_char(alarm_time::DATE, 'dd') as date,count(id)
+        from ard_alarm_access
+        where alarm_time &gt;= #{start} and  alarm_time &lt;= #{end}  group by date order by date
+    </select>
+</mapper>

--
Gitblit v1.9.3