From 92aa6fde1b2a9f7eb36bc892a72f52ab24842f5a Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期四, 05 九月 2024 19:51:55 +0800
Subject: [PATCH] 大华视频接口
---
ycl-platform/src/main/resources/mapper/equipment/OrgGridMapper.xml | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/ycl-platform/src/main/resources/mapper/equipment/OrgGridMapper.xml b/ycl-platform/src/main/resources/mapper/equipment/OrgGridMapper.xml
index 2b20916..6ef5073 100644
--- a/ycl-platform/src/main/resources/mapper/equipment/OrgGridMapper.xml
+++ b/ycl-platform/src/main/resources/mapper/equipment/OrgGridMapper.xml
@@ -15,5 +15,30 @@
<sql id="Base_Column_List">
id, worker, contact, area, region
</sql>
+ <select id="statisticsGridMap" resultType="com.ycl.vo.cockpit.statisticsEvents.GridMapVO">
+ SELECT
+ *
+ FROM
+ (
+ SELECT
+ og.id,
+ og.`name`,
+ og.region,
+ COUNT( DISTINCT v.id ) eventCount ,
+ sum(case WHEN v.video_point_id is not null then 1 else 0 END ) aiCount
+ FROM
+ ums_org_grid og
+ LEFT JOIN ums_base_case bc ON og.id = bc.grid_id
+ LEFT JOIN ums_violations v ON v.id = bc.id
+
+ <if test="beginTime!=null">
+ and bc.alarm_time BETWEEN #{beginTime} and #{endTime}
+ </if>
+ GROUP BY
+ og.id,
+ og.`name`
+ ) v_case
+ LEFT JOIN ( SELECT grid_id, COUNT( id ) videoCount FROM ums_video_point GROUP BY grid_id ) AS v_video ON v_case.id = v_video.grid_id
+ </select>
</mapper>
--
Gitblit v1.8.0