yeg
2026-09-05 dd1af98f7e679290e5280e2aff58d7ff5237c5fb
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java
@@ -11,11 +11,15 @@
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;
import com.ruoyi.system.domain.TTestConsoleImportRecord;
import com.ruoyi.system.domain.TTestDataOverride;
import com.ruoyi.system.domain.TTestRealtimeRecord;
import com.ruoyi.system.domain.TTestStepRecord;
import com.ruoyi.system.domain.TTestCycleRecord;
import com.ruoyi.system.domain.vo.TestBatteryOptionVo;
import com.ruoyi.system.domain.vo.TestChannelOptionVo;
import com.ruoyi.system.domain.vo.TestCollectorOptionVo;
@@ -33,6 +37,7 @@
    int insertTest(TTest test);
    int updateTest(TTest test);
    int deleteTestById(@Param("testId") Long testId, @Param("updateBy") String updateBy);
    int deleteTestThresholdRowsByTestId(Long testId);
    int deleteTestBindingsByTestId(Long testId);
    int deleteTestCollectorChannelsByTestId(Long testId);
    int deleteTestPlanStepsByTestId(Long testId);
@@ -48,11 +53,53 @@
    List<TTestPlanStep> selectTestPlanSteps(Long testId);
    List<TTestBattery> selectTestBatteries(Long testId);
    List<TTestBatteryField> selectTestBatteryFields(Long testId);
    /** 读取测试所选电池组的当前字段值,不创建测试快照。 */
    List<TTestBatteryField> selectCurrentBatteryFields(Long testId);
    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,
            @Param("channelId") Long channelId, @Param("collectorId") Long collectorId,
            @Param("captureSlotUtc") Date captureSlotUtc, @Param("cabinetSequenceId") Long cabinetSequenceId,
            @Param("cabinetDeviceTimeUtc") Date cabinetDeviceTimeUtc, @Param("cabinetDeviceTimeRaw") String cabinetDeviceTimeRaw,
            @Param("collectorSequenceId") Long collectorSequenceId, @Param("collectorDeviceTimeUtc") Date collectorDeviceTimeUtc,
            @Param("collectorDeviceTimeRaw") String collectorDeviceTimeRaw, @Param("serverReceivedAtUtc") Date serverReceivedAtUtc,
            @Param("cycleNo") Integer cycleNo, @Param("stepNo") Integer stepNo, @Param("stepType") String stepType,
            @Param("stepName") String stepName, @Param("voltageV") java.math.BigDecimal voltageV,
            @Param("currentA") java.math.BigDecimal currentA, @Param("capacityAh") java.math.BigDecimal capacityAh,
            @Param("energyWh") java.math.BigDecimal energyWh, @Param("temperature") java.math.BigDecimal temperature,
            @Param("positivePotential") java.math.BigDecimal positivePotential,
            @Param("negativePotential") java.math.BigDecimal negativePotential,
            @Param("extensionMeasurementsJson") String extensionMeasurementsJson, @Param("contentSha256") byte[] contentSha256);
    int insertRealtimeRecord(TTestRealtimeRecord record);
    String selectRealtimeRecordContentHash(@Param("testId") Long testId, @Param("testBatteryId") Long testBatteryId,
            @Param("captureSlotUtc") Date captureSlotUtc);
    int insertStepRecord(TTestStepRecord record);
    int insertCycleRecord(TTestCycleRecord record);
    String selectStepRecordContentHash(@Param("testBatteryId") Long testBatteryId,
            @Param("sourceIdentity") String sourceIdentity, @Param("dedupeKey") String dedupeKey);
    String selectCycleRecordContentHash(@Param("testBatteryId") Long testBatteryId,
            @Param("sourceIdentity") String sourceIdentity, @Param("dedupeKey") String dedupeKey);
    List<java.util.Map<String, Object>> selectPersistedFinalRealtimeRecords(@Param("testId") Long testId);
    List<java.util.Map<String, Object>> selectPersistedFinalStepRecords(@Param("testId") Long testId);
    List<java.util.Map<String, Object>> selectPersistedFinalCycleRecords(@Param("testId") Long testId);
    List<java.util.Map<String, Object>> selectPersistedRealtimeSnapshots(@Param("testId") Long testId);
    List<java.util.Map<String, Object>> selectPersistedRecords(@org.apache.ibatis.annotations.Param("testId") Long testId);
    List<java.util.Map<String, Object>> selectPersistedCollectorRecords(@org.apache.ibatis.annotations.Param("testId") Long testId);
    List<java.util.Map<String, Object>> selectPersistedSteps(@org.apache.ibatis.annotations.Param("testId") Long testId);
@@ -60,6 +107,8 @@
    List<TTestResult> selectTestResults(TTestResult result);
    String selectLogicStepMappingsJson(Long testId);
    int updateLogicStepMappings(@Param("testId") Long testId, @Param("mappingsJson") String mappingsJson,
            @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
    int updateConsoleDetail(@Param("testId") Long testId, @Param("detailJson") String detailJson,
            @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
    int countTestTypeEnabled(Long testTypeId);
    int countUserEnabled(Long userId);
@@ -127,6 +176,18 @@
    int deleteBtsSamplesByIds(@Param("testId") Long testId, @Param("sampleIds") List<Long> sampleIds);
    int deleteBtsMeasurementsBySampleIds(@Param("sampleIds") List<Long> sampleIds);
    int deleteCollectorSamplesByIds(@Param("testId") Long testId, @Param("sampleIds") List<Long> sampleIds);
    int deleteRealtimeRecordsByIds(@Param("testId") Long testId, @Param("recordIds") List<Long> recordIds);
    int deleteRealtimeSnapshotsByIds(@Param("testId") Long testId, @Param("snapshotIds") List<Long> snapshotIds);
    int deleteStepRecordsByIds(@Param("testId") Long testId, @Param("recordIds") List<Long> recordIds);
    int deleteCycleRecordsByIds(@Param("testId") Long testId, @Param("recordIds") List<Long> recordIds);
    int deleteCollectorSamplesByIdentities(@Param("testId") Long testId, @Param("identities") List<String> identities);
    int deleteTestRealtimeRecordsByTestId(Long testId);
    int deleteTestRealtimeSnapshotsByTestId(Long testId);
    int deleteTestStepRecordsByTestId(Long testId);
    int deleteTestCycleRecordsByTestId(Long testId);
    int deleteTestDataRevisionActionsByTestId(Long testId);
    int deleteTestDataOverridesByTestId(Long testId);
    int deleteTestConsoleImportRecordsByTestId(Long testId);
    Long selectBtsSampleIdByDeviceChannelSequence(@Param("testId") Long testId,
            @Param("deviceId") Long deviceId, @Param("channelNo") Long channelNo,
            @Param("sequenceId") Long sequenceId);