-- ============================================================================
-- OARMS - CW-1 固化取证管理 初始数据
-- Database: DM8 (达梦)
-- Schema: OARMS
-- Version: V7.0.1
-- Date: 2026-05-25
-- Description: 基于 V5.0.1 违规监控记录生成的 5 条取证记录 + 状态历史
-- Note:
--   1. 取证记录来源于状态为 4(违规) 的监控记录
--   2. 包含不同取证状态(1=待关联规则, 2=已关联规则, 3=已生成线索)
-- ============================================================================

-- 1. 天河路正佳广场虚假广告 → 待关联规则(1)
INSERT INTO OARMS.CW_EVIDENCE_RECORD (
    ID, MONITOR_RECORD_ID, SCREEN_ID, SCREEN_NAME, SCREEN_ADDRESS, DISTRICT,
    EVIDENCE_VIDEO_FILE, CLIP_START_TIME, CLIP_END_TIME, CLIP_DURATION,
    EVIDENCE_STATUS, EVIDENCE_PERSON, EVIDENCED_AT,
    SOURCE_MONITOR_PERSON, SOURCE_MONITOR_TIME, SOURCE_MONITOR_REMARK,
    CREATE_BY, CREATE_TIME, CREATE_NAME, UPDATE_BY, UPDATE_TIME, UPDATE_NAME
) VALUES (
    'CW-ER-001', 'AM-MR-002', 'BS-SCR-001',
    '天河路正佳广场LED大屏', '广州市天河区天河路228号正佳广场', '440106',
    '/evidence/2026-05-25/CW-ER-001.mp4', '07:32:00', '07:38:00', 360,
    1, '张三', TO_TIMESTAMP('2026-05-25 08:10:00', 'YYYY-MM-DD HH24:MI:SS'),
    '张三', TO_TIMESTAMP('2026-05-25 08:05:00', 'YYYY-MM-DD HH24:MI:SS'), '发现疑似虚假医疗广告',
    'system', TO_TIMESTAMP('2026-05-25 08:10:00', 'YYYY-MM-DD HH24:MI:SS'), '系统',
    'system', TO_TIMESTAMP('2026-05-25 08:10:00', 'YYYY-MM-DD HH24:MI:SS'), '系统'
);

-- 2. 江南西路海珠万达绝对化用语 → 已关联规则(2)
INSERT INTO OARMS.CW_EVIDENCE_RECORD (
    ID, MONITOR_RECORD_ID, SCREEN_ID, SCREEN_NAME, SCREEN_ADDRESS, DISTRICT,
    EVIDENCE_VIDEO_FILE, CLIP_START_TIME, CLIP_END_TIME, CLIP_DURATION,
    EVIDENCE_STATUS, EVIDENCE_PERSON, EVIDENCED_AT,
    SOURCE_MONITOR_PERSON, SOURCE_MONITOR_TIME, SOURCE_MONITOR_REMARK,
    CREATE_BY, CREATE_TIME, CREATE_NAME, UPDATE_BY, UPDATE_TIME, UPDATE_NAME
) VALUES (
    'CW-ER-002', 'AM-MR-005', 'BS-SCR-003',
    '江南西路海珠万达广场LED大屏', '广州市海珠区江南西路46号海珠万达广场', '440105',
    '/evidence/2026-05-25/CW-ER-002.mp4', '08:28:00', '08:33:00', 300,
    2, '王五', TO_TIMESTAMP('2026-05-25 08:40:00', 'YYYY-MM-DD HH24:MI:SS'),
    '王五', TO_TIMESTAMP('2026-05-25 08:35:00', 'YYYY-MM-DD HH24:MI:SS'), '发现绝对化用语"全国最佳"',
    'system', TO_TIMESTAMP('2026-05-25 08:40:00', 'YYYY-MM-DD HH24:MI:SS'), '系统',
    'system', TO_TIMESTAMP('2026-05-25 08:50:00', 'YYYY-MM-DD HH24:MI:SS'), '系统'
);

-- 3. 白云万达虚假宣传 → 已生成线索(3)
INSERT INTO OARMS.CW_EVIDENCE_RECORD (
    ID, MONITOR_RECORD_ID, SCREEN_ID, SCREEN_NAME, SCREEN_ADDRESS, DISTRICT,
    EVIDENCE_VIDEO_FILE, CLIP_START_TIME, CLIP_END_TIME, CLIP_DURATION,
    EVIDENCE_STATUS, EVIDENCE_PERSON, EVIDENCED_AT,
    SOURCE_MONITOR_PERSON, SOURCE_MONITOR_TIME, SOURCE_MONITOR_REMARK,
    CREATE_BY, CREATE_TIME, CREATE_NAME, UPDATE_BY, UPDATE_TIME, UPDATE_NAME
) VALUES (
    'CW-ER-003', 'AM-MR-010', 'BS-SCR-005',
    '白云大道白云万达广场LED大屏', '广州市白云区云城东路501号白云万达广场', '440111',
    '/evidence/2026-05-25/CW-ER-003.mp4', '08:55:00', '09:02:00', 420,
    3, '李四', TO_TIMESTAMP('2026-05-25 09:10:00', 'YYYY-MM-DD HH24:MI:SS'),
    '李四', TO_TIMESTAMP('2026-05-25 09:05:00', 'YYYY-MM-DD HH24:MI:SS'), '发现虚假宣传"包治百病"',
    'system', TO_TIMESTAMP('2026-05-25 09:10:00', 'YYYY-MM-DD HH24:MI:SS'), '系统',
    'system', TO_TIMESTAMP('2026-05-25 09:30:00', 'YYYY-MM-DD HH24:MI:SS'), '系统'
);

-- 4. 天河路正佳广场(前一天) → 已关联规则(2)
INSERT INTO OARMS.CW_EVIDENCE_RECORD (
    ID, MONITOR_RECORD_ID, SCREEN_ID, SCREEN_NAME, SCREEN_ADDRESS, DISTRICT,
    EVIDENCE_VIDEO_FILE, CLIP_START_TIME, CLIP_END_TIME, CLIP_DURATION,
    EVIDENCE_STATUS, EVIDENCE_PERSON, EVIDENCED_AT,
    SOURCE_MONITOR_PERSON, SOURCE_MONITOR_TIME, SOURCE_MONITOR_REMARK,
    CREATE_BY, CREATE_TIME, CREATE_NAME, UPDATE_BY, UPDATE_TIME, UPDATE_NAME
) VALUES (
    'CW-ER-004', 'AM-MR-001', 'BS-SCR-001',
    '天河路正佳广场LED大屏', '广州市天河区天河路228号正佳广场', '440106',
    '/evidence/2026-05-24/CW-ER-004.mp4', '07:25:00', '07:28:00', 180,
    2, '张三', TO_TIMESTAMP('2026-05-24 07:40:00', 'YYYY-MM-DD HH24:MI:SS'),
    '张三', TO_TIMESTAMP('2026-05-24 07:35:00', 'YYYY-MM-DD HH24:MI:SS'), '疑似虚假宣传待进一步核实',
    'system', TO_TIMESTAMP('2026-05-24 07:40:00', 'YYYY-MM-DD HH24:MI:SS'), '系统',
    'system', TO_TIMESTAMP('2026-05-24 08:00:00', 'YYYY-MM-DD HH24:MI:SS'), '系统'
);

-- 5. 江南西路海珠万达(前一天) → 待关联规则(1)
INSERT INTO OARMS.CW_EVIDENCE_RECORD (
    ID, MONITOR_RECORD_ID, SCREEN_ID, SCREEN_NAME, SCREEN_ADDRESS, DISTRICT,
    EVIDENCE_VIDEO_FILE, CLIP_START_TIME, CLIP_END_TIME, CLIP_DURATION,
    EVIDENCE_STATUS, EVIDENCE_PERSON, EVIDENCED_AT,
    SOURCE_MONITOR_PERSON, SOURCE_MONITOR_TIME, SOURCE_MONITOR_REMARK,
    CREATE_BY, CREATE_TIME, CREATE_NAME, UPDATE_BY, UPDATE_TIME, UPDATE_NAME
) VALUES (
    'CW-ER-005', 'AM-MR-006', 'BS-SCR-003',
    '江南西路海珠万达广场LED大屏', '广州市海珠区江南西路46号海珠万达广场', '440105',
    '/evidence/2026-05-24/CW-ER-005.mp4', '08:50:00', '08:55:00', 300,
    1, '王五', TO_TIMESTAMP('2026-05-24 09:10:00', 'YYYY-MM-DD HH24:MI:SS'),
    '王五', TO_TIMESTAMP('2026-05-24 09:05:00', 'YYYY-MM-DD HH24:MI:SS'), '广告内容存疑需进一步分析',
    'system', TO_TIMESTAMP('2026-05-24 09:10:00', 'YYYY-MM-DD HH24:MI:SS'), '系统',
    'system', TO_TIMESTAMP('2026-05-24 09:10:00', 'YYYY-MM-DD HH24:MI:SS'), '系统'
);

-- ===================== 状态变更历史 =====================

-- CW-ER-002: 待关联规则(1) → 已关联规则(2)
INSERT INTO OARMS.CW_EVIDENCE_STATUS_HISTORY (
    ID, EVIDENCE_ID, FROM_STATUS, TO_STATUS, CHANGED_AT, CHANGED_BY
) VALUES (
    'CW-ESH-001', 'CW-ER-002', 1, 2,
    TO_TIMESTAMP('2026-05-25 08:50:00', 'YYYY-MM-DD HH24:MI:SS'), 'admin'
);

-- CW-ER-003: 待关联规则(1) → 已关联规则(2)
INSERT INTO OARMS.CW_EVIDENCE_STATUS_HISTORY (
    ID, EVIDENCE_ID, FROM_STATUS, TO_STATUS, CHANGED_AT, CHANGED_BY
) VALUES (
    'CW-ESH-002', 'CW-ER-003', 1, 2,
    TO_TIMESTAMP('2026-05-25 09:15:00', 'YYYY-MM-DD HH24:MI:SS'), 'admin'
);

-- CW-ER-003: 已关联规则(2) → 已生成线索(3)
INSERT INTO OARMS.CW_EVIDENCE_STATUS_HISTORY (
    ID, EVIDENCE_ID, FROM_STATUS, TO_STATUS, CHANGED_AT, CHANGED_BY
) VALUES (
    'CW-ESH-003', 'CW-ER-003', 2, 3,
    TO_TIMESTAMP('2026-05-25 09:30:00', 'YYYY-MM-DD HH24:MI:SS'), 'admin'
);

-- CW-ER-004: 待关联规则(1) → 已关联规则(2)
INSERT INTO OARMS.CW_EVIDENCE_STATUS_HISTORY (
    ID, EVIDENCE_ID, FROM_STATUS, TO_STATUS, CHANGED_AT, CHANGED_BY
) VALUES (
    'CW-ESH-004', 'CW-ER-004', 1, 2,
    TO_TIMESTAMP('2026-05-24 08:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'admin'
);
