From 20b346ef9d4fcbbbe05abfe08e4f4f0303b0812e Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期日, 30 八月 2026 20:37:45 +0800
Subject: [PATCH] 实现 Ticket12 人工结束与顺序接入

---
 ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java |   11 +++++++++++
 1 files changed, 11 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 ee5884e..2dd1aeb 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
@@ -13,6 +13,7 @@
 import com.ruoyi.system.domain.TTestWarningThreshold;
 import com.ruoyi.system.domain.TTestCollectorSource;
 import com.ruoyi.system.domain.TTestCollectorExceptionInterval;
+import com.ruoyi.system.domain.TTestReceptionInterval;
 import com.ruoyi.system.domain.TDetectionChannel;
 import com.ruoyi.system.domain.vo.TestBatteryOptionVo;
 import com.ruoyi.system.domain.vo.TestChannelOptionVo;
@@ -49,6 +50,8 @@
     List<TTestChannelBinding> selectTestChannelBindings(Long testId);
     List<TTestCollectorChannel> selectTestCollectorChannels(Long testId);
     List<TTestWarningThreshold> selectTestThresholds(Long testId);
+    /** 按来源和起始边界顺序返回测试接收区间。 */
+    List<TTestReceptionInterval> selectTestReceptionIntervals(Long testId);
     List<TTestResult> selectTestResults(TTestResult result);
     int countTestTypeEnabled(Long testTypeId);
     int countUserEnabled(Long userId);
@@ -75,6 +78,14 @@
     int insertCollectorChannelLease(@Param("collectorId") Long collectorId, @Param("channelCode") String channelCode,
             @Param("testId") Long testId, @Param("bindingId") Long bindingId,
             @Param("acquiredBy") Long acquiredBy, @Param("acquiredAtUtc") Date acquiredAtUtc);
+    /** 为每个绑定来源追加一个开放接收区间;区间关闭后仅保留历史事实。 */
+    int insertReceptionInterval(@Param("testId") Long testId, @Param("bindingId") Long bindingId,
+            @Param("sourceType") String sourceType, @Param("sourceId") Long sourceId,
+            @Param("sourceChannelCode") String sourceChannelCode, @Param("actionAtUtc") Date actionAtUtc,
+            @Param("boundaryNote") String boundaryNote);
+    /** 在停止动作事务内关闭该测试全部开放区间,返回实际关闭数量。 */
+    int closeOpenReceptionIntervals(@Param("testId") Long testId, @Param("endBoundaryAtUtc") Date endBoundaryAtUtc,
+            @Param("boundaryNote") String boundaryNote);
     int deleteChannelLeasesByTestId(Long testId);
     int deleteCollectorChannelLeasesByTestId(Long testId);
     int hasReceivingTestForAdapter(@Param("adapterCode") String adapterCode);

--
Gitblit v1.7.1