package com.battery.business.mapper;
|
|
import java.util.List;
|
import java.util.Date;
|
import org.apache.ibatis.annotations.Param;
|
import com.battery.business.domain.TTest;
|
import com.battery.business.domain.TTestBattery;
|
import com.battery.business.domain.CurrentBatteryField;
|
import com.battery.business.domain.TTestChannelBinding;
|
import com.battery.business.domain.TTestCollectorChannel;
|
import com.battery.business.domain.TTestWarningThreshold;
|
import com.battery.business.domain.TTestWarningException;
|
import com.battery.business.domain.TTestLogicStepMapping;
|
import com.battery.business.domain.TDetectionChannel;
|
import com.battery.business.domain.TTestDataRevisionAction;
|
import com.battery.business.domain.DataRevisionItem;
|
import com.battery.business.domain.TTestRealtimeRecord;
|
import com.battery.business.domain.TTestStepRecord;
|
import com.battery.business.domain.TTestCycleRecord;
|
import com.battery.business.domain.vo.TestBatteryOptionVo;
|
import com.battery.business.domain.vo.TestChannelOptionVo;
|
import com.battery.business.domain.vo.TestCollectorOptionVo;
|
import com.battery.business.domain.vo.TestTypeOptionVo;
|
import com.battery.business.domain.vo.TestUserOptionVo;
|
|
/** 读写测试配置、成功接收数据、修订记录和异常处理事实。 */
|
public interface TTestMapper
|
{
|
int deleteTestWarningExceptionsByTestId(Long testId);
|
int deleteTestLogicStepMappingsByTestId(Long testId);
|
java.util.Map<String, Object> selectDataRecord(@Param("testId") Long testId, @Param("dataType") String dataType, @Param("recordId") Long recordId);
|
int updateDataRecord(@Param("testId") Long testId, @Param("dataType") String dataType, @Param("recordId") Long recordId, @Param("values") java.util.Map<String, Object> values);
|
int deleteDataRecord(@Param("testId") Long testId, @Param("dataType") String dataType, @Param("recordId") Long recordId);
|
java.util.Map<String, Object> selectImportBinding(@Param("testId") Long testId, @Param("batteryNo") String batteryNo);
|
/** 查询当前测试该类事实,供整页导入校验身份和内容冲突。 */
|
List<java.util.Map<String, Object>> selectImportDataRecords(@Param("testId") Long testId, @Param("dataType") String dataType);
|
int insertImportedDataRecord(@Param("dataType") String dataType, @Param("values") java.util.Map<String, Object> values);
|
TTest selectTestById(Long testId);
|
TTest selectTestByIdForUpdate(Long testId);
|
List<TTest> selectTestList(TTest test);
|
List<TTestBattery> selectBatteryNosByTestIds(@Param("testIds") List<Long> testIds);
|
TTest selectTestByName(String testName);
|
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 deleteTestBatteriesByTestId(Long testId);
|
|
int deleteTestThresholdsByTestId(Long testId);
|
|
int insertTestBattery(TTestBattery battery);
|
|
int insertTestChannelBinding(TTestChannelBinding binding);
|
int insertTestCollectorChannel(TTestCollectorChannel mapping);
|
int insertTestThreshold(TTestWarningThreshold threshold);
|
|
List<TTestBattery> selectTestBatteries(Long testId);
|
|
/** 读取测试所选电池组的当前字段值,不创建测试快照。 */
|
List<CurrentBatteryField> 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<com.battery.business.domain.vo.OfflineTestSource> selectOfflineTestSources(Long testId);
|
/** 以测试和来源身份聚合离线异常,不写入阈值或测量值。 */
|
int upsertOfflineException(@Param("testId") Long testId, @Param("sourceType") String sourceType,
|
@Param("sourceIdentity") String sourceIdentity, @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 insertRealtimeRecord(TTestRealtimeRecord record);
|
String selectRealtimeRecordContentHash(@Param("testId") Long testId, @Param("testBatteryId") Long testBatteryId,
|
@Param("captureSlotUtc") Date captureSlotUtc);
|
/** 按来源行身份查询已保存的实时记录摘要;逐行接收据此做幂等与冲突判定。 */
|
String selectRealtimeRecordHashBySourceRecord(@Param("testBatteryId") Long testBatteryId,
|
@Param("sourceIdentity") String sourceIdentity, @Param("sourceRecordId") String sourceRecordId);
|
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);
|
boolean wasAggregateDeleted(@Param("testId") Long testId, @Param("dataType") String dataType,
|
@Param("testBatteryId") Long testBatteryId, @Param("sourceIdentity") String sourceIdentity, @Param("dedupeKey") String dedupeKey);
|
boolean wasRealtimeSlotDeleted(@Param("testId") Long testId, @Param("testBatteryId") Long testBatteryId,
|
@Param("captureSlotMillis") long captureSlotMillis);
|
|
|
|
|
|
|
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);
|
int countBatteryInEnabledGroup(@Param("groupId") Long groupId, @Param("batteryNo") String batteryNo);
|
int countRegisteredChannel(Long channelId);
|
int countCollectorEnabled(Long collectorId);
|
Integer selectCollectorChannelCount(Long collectorId);
|
String selectCollectorCode(Long collectorId);
|
List<TestUserOptionVo> selectEnabledUserOptions();
|
List<TestTypeOptionVo> selectEnabledTestTypeOptions();
|
List<TestBatteryOptionVo> selectEnabledBatteryOptions();
|
List<TestChannelOptionVo> selectRegisteredChannelOptions();
|
List<TestCollectorOptionVo> selectEnabledCollectorOptions();
|
|
|
/** 锁定检测柜通道的最新可观测事实,供开始接收校验使用。 */
|
TDetectionChannel selectReceptionChannelForUpdate(Long channelId);
|
int hasReceivingTestForAdapter(@Param("adapterCode") String adapterCode);
|
List<TDetectionChannel> selectReceivingChannelsForAdapter(@Param("adapterCode") String adapterCode);
|
int updateReceptionStarted(@Param("testId") Long testId, @Param("startedAtUtc") Date startedAtUtc,
|
@Param("runtimeAttach") boolean runtimeAttach, @Param("updateBy") String updateBy);
|
int updateReceptionPaused(@Param("testId") Long testId, @Param("updateBy") String updateBy,
|
@Param("updatedAtUtc") Date updatedAtUtc);
|
int updateReceptionResumed(@Param("testId") Long testId, @Param("updateBy") String updateBy,
|
@Param("updatedAtUtc") Date updatedAtUtc);
|
int updateReceptionStopped(@Param("testId") Long testId, @Param("updateBy") String updateBy,
|
@Param("endedAtUtc") Date endedAtUtc);
|
|
|
|
|
|
|
|
int insertDataRevisionAction(TTestDataRevisionAction action);
|
List<TTestDataRevisionAction> selectDataRevisionActions(TTestDataRevisionAction query);
|
TTestDataRevisionAction selectDataRevisionActionById(Long actionId);
|
|
|
|
|
|
|
int deleteRealtimeRecordsByIds(@Param("testId") Long testId, @Param("recordIds") List<Long> recordIds);
|
|
int deleteStepRecordsByIds(@Param("testId") Long testId, @Param("recordIds") List<Long> recordIds);
|
int deleteCycleRecordsByIds(@Param("testId") Long testId, @Param("recordIds") List<Long> recordIds);
|
|
int deleteTestRealtimeRecordsByTestId(Long testId);
|
|
int deleteTestStepRecordsByTestId(Long testId);
|
int deleteTestCycleRecordsByTestId(Long testId);
|
int deleteTestDataRevisionActionsByTestId(Long testId);
|
|
|
|
|
|
|
|
int countTestBatteryNo(@Param("testId") Long testId, @Param("batteryNo") String batteryNo);
|
}
|