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/ArdAlarmCameraMapper.xml | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml index 702bd6d..2f919b5 100644 --- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml +++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml @@ -2,7 +2,7 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.ruoyi.alarm.cameraAlarm.mapper.ArdAlarmCameraMapper"> +<mapper namespace="com.ruoyi.alarm.camera.mapper.ArdAlarmCameraMapper"> <resultMap type="ArdAlarmCamera" id="ArdAlarmCameraResult"> <result property="id" column="id" /> @@ -159,4 +159,17 @@ WHERE aac.alarm_time >= CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE and aac.view_time is null </select> + <update id="updateViewTimeByCameraName" parameterType="String"> + update ard_alarm_camera + set view_time=#{viewTime} + where camera_name = #{cameraName} + and alarm_time<=#{alarmTime} + and view_time is null + </update> + + <select id="cameraYear" resultType="com.ruoyi.statistical.vo.CountVo"> + select to_char(alarm_time::DATE, 'MM') as month,count(id) + from ard_alarm_camera + 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