-- Active: 1752718919967@@192.1.2.61@5236@EQM_CESHI


#对比项
SELECT *
FROM tACACompareItems;


#对比项通道信息
SELECT *
FROM tACACompareItemRoad;


#ACA系统设置信息
SELECT *
FROM tACASystemConfig;


#对比项一致性对比时段信息
SELECT *
FROM tACADetectPeriod;


#报警信息
SELECT *
FROM tACAAlarmInfo;





#清空报警信息内容
DELETE FROM tACAAlarmInfo;


#插入报警信息
INSERT INTO tACAAlarmInfo (
    ItemID, ItemName, AlarmType, SoundCardNum, SoundCardName, SoundCardRoadNum, CompareRoadNum, CompareRoadName, CompareRoadType, 
    AlarmStartTime, AlarmEndTime, AlarmDuration, AlarmFilePath, FileAlarmStartPos, MainRoadPKID )
VALUES (
    @itemID, @itemName, @alarmType, @soundCardNum, @soundCardName, @soundCardRoadNum, @compareRoadNum, @compareRoadName, @compareRoadType, 
    @alarmStartTime, @alarmEndTime, @alarmDuration, @alarmFilePath, @fileAlarmStartPos, @mainRoadPKID);
SELECT LAST_INSERT_ID() AS pkid;

#同时插入两条报警信息
-- 先插入主通道报警信息, 获取其主键 pkid
INSERT INTO tACAAlarmInfo (
    ItemID, ItemName, AlarmType, SoundCardNum, SoundCardName, SoundCardRoadNum, CompareRoadNum, CompareRoadName, CompareRoadType, 
    AlarmStartTime, AlarmEndTime, AlarmDuration, AlarmFilePath, FileAlarmStartPos)
VALUES (
    @itemID1, @itemName1, @alarmType1, @soundCardNum1, @soundCardName1, @soundCardRoadNum1, @compareRoadNum1, @compareRoadName1, @compareRoadType1, 
    @alarmStartTime1, @alarmEndTime1, @alarmDuration1, @alarmFilePath1, @fileAlarmStartPos1);
-- 获取主通道报警信息的
SELECT SCOPE_IDENTITY() AS pkid;
-- 插入第二条报警信息，MainRoadPKID 就是上面获取的 pkid
INSERT INTO tACAAlarmInfo (
    ItemID, ItemName, AlarmType, SoundCardNum, SoundCardName, SoundCardRoadNum, CompareRoadNum, CompareRoadName, CompareRoadType, 
    AlarmStartTime, AlarmEndTime, AlarmDuration, AlarmFilePath, FileAlarmStartPos, MainRoadPKID)
VALUES (
    @itemID2, @itemName2, @alarmType2, @soundCardNum2, @soundCardName2, @soundCardRoadNum2, @compareRoadNum2, @compareRoadName2, @compareRoadType2,
    @alarmStartTime2, @alarmEndTime2, @alarmDuration2, @alarmFilePath2, @fileAlarmStartPos2, pkid);


