DROP PROCEDURE IF EXISTS add_alarm_logs;
DELIMITER //
CREATE PROCEDURE add_alarm_logs (
IN addNum INT,
IN dateStr VARCHAR(100)
)
BEGIN
DECLARE looIndex INT DEFAULT 1;
DECLARE de BIGINT DEFAULT 1;
START TRANSACTION;
WHILE looIndex <= addNum DO
SET @sqlStr = CONCAT(‘INSERT INTO adm_log_alarm_’, dateStr, ‘(DEVICE_CODE, DEVICE_NAME, UNIT_TYPE, UNIT_SEQ, CHANNEL_SEQ, CHANNEL_NAME, ALARM_STAT, ALARM_TYPE, ALARM_DATE, ALARM_GRADE, HANDLE_USER, HANDLE_DATE, HANDLE_MESSAGE, HANDLE_STAT, ALARM_PICTURE, ALARM_PICTURE_SIZE, ALARM_CODE, MAIL_RECEIVERS, CHANNEL_ID, MEMO, GPSX, GPSY, HEIGHT, ANGLE, SPEED)
VALUES(’,looIndex,’, “模拟器NVR”, 1, 0, 0, “Channel”, 1, 1, 1635322597000, 1, NULL, NULL, NULL, 0, “”, 0, “{A443D14E-200B-48C5-A550-6400615ECC91}”, NULL, “1000000$1$0$0”, NULL, 0, 0, 0, 0, 0)’);
PREPARE stmt FROM @sqlStr;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET looIndex = looIndex + 1;
END WHILE;
COMMIT;
END//
CALL add_alarm_logs(20000,‘20211027_0’);
CALL add_alarm_logs(20000,‘20211027_1’);
CALL add_alarm_logs(20000,‘20211027_2’);
CALL add_alarm_logs(20000,‘20211027_3’);
CALL add_alarm_logs(20000,‘20211027_4’);
select * from adm_log_alarm_20211027_0;
select * from adm_log_alarm_20211027_1;
select * from adm_log_alarm_20211027_2;
select * from adm_log_alarm_20211027_3;
select * from adm_log_alarm_20211027_4;
{
“endAlarmTime”: “1635695999”,
“orderType”: “1”,
“orderDirection”: “1”,
“alarmGrade”: [],
“page”: ${page},
“alarmTypes”: [],
“pageSize”: “20”,
“currentPage”: “1”,
“splitTime”: “0”,
“splitId”: “”,
“startAlarmTime”: “1635177600”,
“handleStatus”: [],
“deviceCodes”: [],
“channelIds”: [],
“handleUser”: “”
}
/brms/api/v1.1/alarm/record/fetch/page