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,