From 2b29a4a26019e3d1692c4b4c76746dba9fac7b22 Mon Sep 17 00:00:00 2001 From: aijinhui <aijinhui> Date: 星期六, 07 十月 2023 14:39:16 +0800 Subject: [PATCH] 报警数量统计年 --- ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml index f02b6c3..b70d798 100644 --- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml +++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml @@ -31,8 +31,15 @@ <select id="selectArdAlarmAccessList" parameterType="ArdAlarmAccess" resultMap="ArdAlarmAccessResult"> <include refid="selectArdAlarmAccessVo"/> - <where> + <where> + <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� --> + AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss') + </if> + <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� --> + AND alarm_time <= 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"> @@ -162,4 +169,10 @@ and alarm_time <= #{alarmTime} and view_time is null </update> + + <select id="accessYear" resultType="com.ruoyi.statistical.vo.CountVo"> + select to_char(alarm_time::DATE, 'MM') as month,count(id) + from ard_alarm_access + where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3