From c7a6bf5ef91e1cd73e7d95eb8d8626c53f097481 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Sat, 14 Feb 2026 22:54:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(aiot):=20=E5=91=8A=E8=AD=A6=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=92=8C=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E6=91=84?= =?UTF-8?q?=E5=83=8F=E5=A4=B4=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AiAlert添加cameraName字段 - Mapper查询时LEFT JOIN wvp_stream_proxy表获取gb_name - 通过camera_code关联查询 - 优先显示cameraName,降级显示cameraId Co-Authored-By: Claude Opus 4.6 --- .../com/genersoft/iot/vmp/aiot/bean/AiAlert.java | 3 +++ .../genersoft/iot/vmp/aiot/dao/AiAlertMapper.java | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/aiot/bean/AiAlert.java b/src/main/java/com/genersoft/iot/vmp/aiot/bean/AiAlert.java index 81f6fac7b..624e87f93 100644 --- a/src/main/java/com/genersoft/iot/vmp/aiot/bean/AiAlert.java +++ b/src/main/java/com/genersoft/iot/vmp/aiot/bean/AiAlert.java @@ -16,6 +16,9 @@ public class AiAlert { @Schema(description = "摄像头ID") private String cameraId; + @Schema(description = "摄像头名称(关联查询)") + private String cameraName; + @Schema(description = "ROI区域ID") private String roiId; diff --git a/src/main/java/com/genersoft/iot/vmp/aiot/dao/AiAlertMapper.java b/src/main/java/com/genersoft/iot/vmp/aiot/dao/AiAlertMapper.java index 5ce51a849..34d8d0ac8 100644 --- a/src/main/java/com/genersoft/iot/vmp/aiot/dao/AiAlertMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/aiot/dao/AiAlertMapper.java @@ -15,17 +15,20 @@ public interface AiAlertMapper { @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id") int add(AiAlert alert); - @Select("SELECT a.*, r.name AS roi_name FROM wvp_ai_alert a " + + @Select("SELECT a.*, r.name AS roi_name, sp.gb_name AS camera_name FROM wvp_ai_alert a " + "LEFT JOIN wvp_ai_roi r ON a.roi_id = r.roi_id " + + "LEFT JOIN wvp_stream_proxy sp ON a.camera_id = sp.camera_code " + "WHERE a.alert_id=#{alertId}") @Results({ - @Result(property = "roiName", column = "roi_name") + @Result(property = "roiName", column = "roi_name"), + @Result(property = "cameraName", column = "camera_name") }) AiAlert queryByAlertId(@Param("alertId") String alertId); @Select(value = {""}) @Results({ - @Result(property = "roiName", column = "roi_name") + @Result(property = "roiName", column = "roi_name"), + @Result(property = "cameraName", column = "camera_name") }) List queryList(@Param("cameraId") String cameraId, @Param("alertType") String alertType,