From dd1af98f7e679290e5280e2aff58d7ff5237c5fb Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期六, 05 九月 2026 11:17:11 +0800
Subject: [PATCH] 实现测试数据物理删除修订

---
 ruoyi-system/src/main/resources/mapper/system/TTestMapper.xml |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/TTestMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TTestMapper.xml
index ec8d3a0..e90fc6e 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TTestMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TTestMapper.xml
@@ -849,6 +849,18 @@
         delete from t_test_collector_sample where test_id = #{testId} and sample_id in
         <foreach collection="sampleIds" item="id" open="(" separator="," close=")">#{id}</foreach>
     </delete>
+    <delete id="deleteRealtimeRecordsByIds">delete from t_test_realtime_record where test_id=#{testId} and record_id in <foreach collection="recordIds" item="id" open="(" separator="," close=")">#{id}</foreach></delete>
+    <delete id="deleteRealtimeSnapshotsByIds">delete from t_test_realtime_snapshot where test_id=#{testId} and snapshot_id in <foreach collection="snapshotIds" item="id" open="(" separator="," close=")">#{id}</foreach></delete>
+    <delete id="deleteStepRecordsByIds">delete from t_test_step_record where test_id=#{testId} and step_record_id in <foreach collection="recordIds" item="id" open="(" separator="," close=")">#{id}</foreach></delete>
+    <delete id="deleteCycleRecordsByIds">delete from t_test_cycle_record where test_id=#{testId} and cycle_record_id in <foreach collection="recordIds" item="id" open="(" separator="," close=")">#{id}</foreach></delete>
+    <delete id="deleteCollectorSamplesByIdentities">delete from t_test_collector_sample where test_id=#{testId} and concat('collector:', collector_id, ':', channel_code, ':', sequence_id, ':', metric_code) in <foreach collection="identities" item="identity" open="(" separator="," close=")">#{identity}</foreach></delete>
+    <delete id="deleteTestRealtimeRecordsByTestId">delete from t_test_realtime_record where test_id=#{testId}</delete>
+    <delete id="deleteTestRealtimeSnapshotsByTestId">delete from t_test_realtime_snapshot where test_id=#{testId}</delete>
+    <delete id="deleteTestStepRecordsByTestId">delete from t_test_step_record where test_id=#{testId}</delete>
+    <delete id="deleteTestCycleRecordsByTestId">delete from t_test_cycle_record where test_id=#{testId}</delete>
+    <delete id="deleteTestDataRevisionActionsByTestId">delete from t_test_data_revision_action where test_id=#{testId}</delete>
+    <delete id="deleteTestDataOverridesByTestId">delete from t_test_data_override where test_id=#{testId}</delete>
+    <delete id="deleteTestConsoleImportRecordsByTestId">delete from t_test_console_import_record where test_id=#{testId}</delete>
     <select id="selectBtsSampleIdByDeviceChannelSequence" resultType="long">
         select sample.sample_id
         from t_test_sample sample

--
Gitblit v1.7.1