From 66e3ab4b7439ca0f5abbfa9021b07f93a5100375 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Sat, 14 Feb 2026 22:49:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(aiot):=20=E5=91=8A=E8=AD=A6=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=98=BE=E7=A4=BAROI=E5=90=8D=E7=A7=B0=E8=80=8C?= =?UTF-8?q?=E9=9D=9Ebbox=E5=9D=90=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AiAlert实体类添加roiName字段 - Mapper查询时LEFT JOIN wvp_ai_roi表获取ROI名称 - 前端详情页显示'检测区域:ROI名称',删除'(bbox)' Co-Authored-By: Claude Opus 4.6 --- .../genersoft/iot/vmp/aiot/bean/AiAlert.java | 3 +++ .../iot/vmp/aiot/dao/AiAlertMapper.java | 24 +++++++++++++------ 2 files changed, 20 insertions(+), 7 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 1cef4b12d..81f6fac7b 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 @@ -19,6 +19,9 @@ public class AiAlert { @Schema(description = "ROI区域ID") private String roiId; + @Schema(description = "ROI区域名称(关联查询)") + private String roiName; + @Schema(description = "绑定ID") private String bindId; 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 ae58d09eb..5ce51a849 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,27 @@ public interface AiAlertMapper { @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id") int add(AiAlert alert); - @Select("SELECT * FROM wvp_ai_alert WHERE alert_id=#{alertId}") + @Select("SELECT a.*, r.name AS roi_name FROM wvp_ai_alert a " + + "LEFT JOIN wvp_ai_roi r ON a.roi_id = r.roi_id " + + "WHERE a.alert_id=#{alertId}") + @Results({ + @Result(property = "roiName", column = "roi_name") + }) AiAlert queryByAlertId(@Param("alertId") String alertId); @Select(value = {""}) + @Results({ + @Result(property = "roiName", column = "roi_name") + }) List queryList(@Param("cameraId") String cameraId, @Param("alertType") String alertType, @Param("startTime") String startTime,