From 76cd5948e95ddbde9dd4411b466ee75ba20b562e Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期四, 03 九月 2026 17:28:29 +0800
Subject: [PATCH] 实现测试预警异常管理
---
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java
index fce88a0..e5a2f5f 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java
@@ -11,6 +11,7 @@
import com.ruoyi.system.domain.TTestPlanStep;
import com.ruoyi.system.domain.TTestResult;
import com.ruoyi.system.domain.TTestWarningThreshold;
+import com.ruoyi.system.domain.TTestWarningException;
import com.ruoyi.system.domain.TTestLogicStepMapping;
import com.ruoyi.system.domain.TDetectionChannel;
import com.ruoyi.system.domain.TTestDataRevisionAction;
@@ -51,6 +52,20 @@
List<TTestChannelBinding> selectTestChannelBindings(Long testId);
List<TTestCollectorChannel> selectTestCollectorChannels(Long testId);
List<TTestWarningThreshold> selectTestThresholds(Long testId);
+ /** 以测试、指标和阈值规则为开放异常键原子聚合成功接收的超限值。 */
+ int upsertWarningException(@Param("testId") Long testId, @Param("thresholdId") Long thresholdId,
+ @Param("sourceType") String sourceType, @Param("sourceIdentity") String sourceIdentity,
+ @Param("metricCode") String metricCode, @Param("value") java.math.BigDecimal value,
+ @Param("unit") String unit, @Param("ruleSnapshot") String ruleSnapshot,
+ @Param("severity") String severity, @Param("occurredAt") Date occurredAt);
+ /** 查询异常事实;不从设备状态或缺失数据推导异常。 */
+ List<TTestWarningException> selectWarningExceptions(@Param("testId") Long testId,
+ @Param("status") String status);
+ TTestWarningException selectWarningExceptionById(Long exceptionId);
+ /** 仅将开放异常转为已关闭,原始异常事实仍保留。 */
+ int closeWarningException(@Param("exceptionId") Long exceptionId, @Param("handledBy") Long handledBy,
+ @Param("handledByName") String handledByName, @Param("handledAt") Date handledAt,
+ @Param("handlingNote") String handlingNote);
/** 查询当前正在接收的测试,供接收调度绑定测试事实。 */
List<Long> selectReceivingTestIds();
int insertRealtimeSnapshot(@Param("testId") Long testId, @Param("bindingId") Long bindingId,
--
Gitblit v1.7.1