From 5a18d863778ffabcc45da185f7f77e7462289bb9 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期四, 27 八月 2026 20:45:31 +0800
Subject: [PATCH] feat(test): implement test configuration and channel binding

---
 ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java |   40 ++++++++++++++++++++++++++++------------
 1 files changed, 28 insertions(+), 12 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 8a1225a..f5ba595 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
@@ -5,37 +5,53 @@
 import com.ruoyi.system.domain.TTest;
 import com.ruoyi.system.domain.TTestBattery;
 import com.ruoyi.system.domain.TTestBatteryField;
+import com.ruoyi.system.domain.TTestChannelBinding;
+import com.ruoyi.system.domain.TTestPlanStep;
 import com.ruoyi.system.domain.TTestResult;
 import com.ruoyi.system.domain.TTestWarningThreshold;
+import com.ruoyi.system.domain.vo.TestBatteryOptionVo;
+import com.ruoyi.system.domain.vo.TestChannelOptionVo;
+import com.ruoyi.system.domain.vo.TestCollectorOptionVo;
+import com.ruoyi.system.domain.vo.TestTypeOptionVo;
+import com.ruoyi.system.domain.vo.TestUserOptionVo;
 
-/** 测试管理数据访问接口。 */
+/** 测试配置及其只追加审计的数据访问接口。 */
 public interface TTestMapper
 {
     TTest selectTestById(Long testId);
+    TTest selectTestByIdForUpdate(Long testId);
     List<TTest> selectTestList(TTest test);
     TTest selectTestByName(String testName);
     int insertTest(TTest test);
     int updateTest(TTest test);
-    int updateTestStatus(@Param("testId") Long testId, @Param("status") String status, @Param("updateBy") String updateBy);
     int deleteTestById(@Param("testId") Long testId, @Param("updateBy") String updateBy);
-    int deleteTestBatteriesByTestId(@Param("testId") Long testId, @Param("updateBy") String updateBy);
-    int deleteTestFieldsByTestId(@Param("testId") Long testId, @Param("updateBy") String updateBy);
-    int deleteTestThresholdsByTestId(@Param("testId") Long testId, @Param("updateBy") String updateBy);
+    int deleteTestBindingsByTestId(Long testId);
+    int deleteTestPlanStepsByTestId(Long testId);
+    int deleteTestBatteriesByTestId(Long testId);
+    int deleteTestFieldsByTestId(Long testId);
+    int deleteTestThresholdsByTestId(Long testId);
+    int insertTestPlanStep(TTestPlanStep step);
     int insertTestBattery(TTestBattery battery);
     int insertTestBatteryField(TTestBatteryField field);
+    int insertTestChannelBinding(TTestChannelBinding binding);
     int insertTestThreshold(TTestWarningThreshold threshold);
+    List<TTestPlanStep> selectTestPlanSteps(Long testId);
     List<TTestBattery> selectTestBatteries(Long testId);
     List<TTestBatteryField> selectTestBatteryFields(Long testId);
+    List<TTestChannelBinding> selectTestChannelBindings(Long testId);
     List<TTestWarningThreshold> selectTestThresholds(Long testId);
     List<TTestResult> selectTestResults(TTestResult result);
-    int countTestingByBatteryNo(@Param("batteryNo") String batteryNo, @Param("testId") Long testId);
-    int countTestingByCabinetChannel(@Param("cabinetId") Long cabinetId, @Param("channelNo") Integer channelNo, @Param("testId") Long testId);
-    int countTestBatteryRelation(@Param("testId") Long testId, @Param("relationId") Long relationId);
-    int countTestBatteryFields(@Param("testId") Long testId, @Param("relationId") Long relationId, @Param("fieldName") String fieldName);
-    int countTestThreshold(@Param("testId") Long testId, @Param("thresholdType") String thresholdType, @Param("thresholdId") Long thresholdId);
     int countTestTypeEnabled(Long testTypeId);
     int countUserEnabled(Long userId);
     int countBatteryInEnabledGroup(@Param("groupId") Long groupId, @Param("batteryNo") String batteryNo);
-    int countCabinetEnabled(Long cabinetId);
-    int countCollectorEnabled(@Param("collectorId") Long collectorId, @Param("cabinetId") Long cabinetId);
+    int countRegisteredChannel(Long channelId);
+    int countCollectorEnabled(Long collectorId);
+    List<TestUserOptionVo> selectEnabledUserOptions();
+    List<TestTypeOptionVo> selectEnabledTestTypeOptions();
+    List<TestBatteryOptionVo> selectEnabledBatteryOptions();
+    List<TestChannelOptionVo> selectRegisteredChannelOptions();
+    List<TestCollectorOptionVo> selectEnabledCollectorOptions();
+    int insertTestAudit(@Param("testId") Long testId, @Param("eventType") String eventType,
+            @Param("actorId") Long actorId, @Param("actorName") String actorName,
+            @Param("previousValue") String previousValue, @Param("newValue") String newValue);
 }

--
Gitblit v1.7.1