From c3b04f92b4c196644a80a912a601b5c29194f71b Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期六, 05 八月 2023 09:37:52 +0800
Subject: [PATCH] 增加线程池配置信息 修改雷达数据最近一次引导从redis获取
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml | 34 +++++++++++++++++++++++-----------
1 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml
index 9d29056..d46eeaf 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" />
@@ -16,7 +16,6 @@
<result property="latitude" column="latitude" />
<result property="ruleId" column="rule_id" />
<result property="picUrl" column="pic_url" />
- <result property="recordUrl" column="record_url" />
<result property="viewTime" column="view_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@@ -25,7 +24,7 @@
</resultMap>
<sql id="selectArdAlarmCameraVo">
- select id, camera_id, camera_name, camera_channel, camera_type, alarm_type, alarm_time, longitude, latitude, rule_id, pic_url, record_url, view_time, create_by, create_time, user_id, dept_id from ard_alarm_camera
+ select id, camera_id, camera_name, camera_channel, camera_type, alarm_type, alarm_time, longitude, latitude, rule_id, pic_url, view_time, create_by, create_time, user_id, dept_id from ard_alarm_camera
</sql>
<select id="selectArdAlarmCameraList" parameterType="ArdAlarmCamera" resultMap="ArdAlarmCameraResult">
@@ -36,16 +35,21 @@
<if test="cameraChannel != null "> and camera_channel = #{cameraChannel}</if>
<if test="cameraType != null and cameraType != ''"> and camera_type = #{cameraType}</if>
<if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if>
- <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>
+ <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>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="ruleId != null "> and rule_id = #{ruleId}</if>
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl}</if>
- <if test="recordUrl != null and recordUrl != ''"> and record_url = #{recordUrl}</if>
<if test="viewTime != null "> and view_time = #{viewTime}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
</where>
+ order by alarm_time desc
</select>
<select id="selectArdAlarmCameraById" parameterType="String" resultMap="ArdAlarmCameraResult">
@@ -67,7 +71,6 @@
<if test="latitude != null">latitude,</if>
<if test="ruleId != null">rule_id,</if>
<if test="picUrl != null">pic_url,</if>
- <if test="recordUrl != null">record_url,</if>
<if test="viewTime != null">view_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@@ -86,7 +89,6 @@
<if test="latitude != null">#{latitude},</if>
<if test="ruleId != null">#{ruleId},</if>
<if test="picUrl != null">#{picUrl},</if>
- <if test="recordUrl != null">#{recordUrl},</if>
<if test="viewTime != null">#{viewTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@@ -108,7 +110,6 @@
<if test="latitude != null">latitude = #{latitude},</if>
<if test="ruleId != null">rule_id = #{ruleId},</if>
<if test="picUrl != null">pic_url = #{picUrl},</if>
- <if test="recordUrl != null">record_url = #{recordUrl},</if>
<if test="viewTime != null">view_time = #{viewTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@@ -129,8 +130,7 @@
</foreach>
</delete>
<select id="selectListAllByCommand" resultMap="ArdAlarmCameraResult">
- SELECT T
- .*
+ SELECT T.*
FROM
(
SELECT
@@ -140,7 +140,6 @@
aac.alarm_time,
aac.longitude,
aac.latitude,
- aac.record_url,
ROW_NUMBER () OVER ( PARTITION BY aac.camera_id ORDER BY aac.alarm_time DESC ) AS rn,
COUNT ( CASE WHEN aac.view_time IS NULL THEN 1 END ) OVER ( PARTITION BY aac.camera_id ) AS COUNT,
COUNT ( aac.alarm_time ) OVER ( PARTITION BY camera_id ) AS total
@@ -154,4 +153,17 @@
WHERE
T.rn = 1
</select>
+ <select id="selectCountByAlarmTime" resultType="Integer">
+ SELECT COUNT(DISTINCT aac.camera_name)
+ FROM ard_alarm_camera aac
+ 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>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3