-- ============================================================================
-- 教育培训 + 监督检查 + 标准化管理 三个模块假数据
-- 列名已对齐数据库实际结构（Oracle->PG 转换后的原始列名）
-- ============================================================================

-- ============================================================================
-- 一、教育培训模块 (eutr)
-- ============================================================================

-- 1. 课程类别
INSERT INTO slaj.bis_eutr_cour_cate (guid, eutr_cate_name, p_guid, note, coll_time, upd_time, rec_pers) VALUES
('cate_001', '安全生产法规',      NULL, '基础必修', '2025-01-01 08:00:00', NULL, '管理员'),
('cate_002', '水利工程安全管理',   NULL, '专业必修', '2025-01-01 08:00:00', NULL, '管理员'),
('cate_003', '应急管理与救援',     NULL, '选修',     '2025-01-01 08:00:00', NULL, '管理员'),
('cate_004', '安全技术规范',       NULL, '选修',     '2025-01-01 08:00:00', NULL, '管理员');

-- 2. 课程对象
INSERT INTO slaj.obj_eutr_cour (guid, eutr_cour_code, eutr_cour_name, cate_guid, train_cont, eutr_cour_hour, cour_type, cour_appl_pers, sub_org_guid, sub_time, veri_org_guid, veri_time, note, coll_time, upd_time, rec_pers, veri_resu, browse_volume, like_volume, cour_come, push) VALUES
('cour_001', 'COUR-001', '安全生产法解读',          'cate_001', '《安全生产法》最新修订解读',          8,  '1', '李明',   'org_001', '2025-02-01 09:00:00', 'org_001', '2025-02-01 09:00:00', NULL, '2025-02-01 09:00:00', NULL, '管理员', '1', 0, 0, '1', '1'),
('cour_002', 'COUR-002', '水利工程危险源辨识',      'cate_002', '水利工程危险源辨识方法',              12, '1', '王建国', 'org_001', '2025-02-10 09:00:00', 'org_001', '2025-02-10 09:00:00', NULL, '2025-02-10 09:00:00', NULL, '管理员', '1', 0, 0, '1', '1'),
('cour_003', 'COUR-003', '防汛应急预案编制',        'cate_003', '水库大坝防汛应急预案编制指南',         6,  '1', '赵强',   'org_002', '2025-03-05 10:00:00', 'org_002', '2025-03-05 10:00:00', NULL, '2025-03-05 10:00:00', NULL, '管理员', '1', 0, 0, '1', '1'),
('cour_004', 'COUR-004', '建筑施工安全技术规范',    'cate_004', 'JGJ/80 建筑施工高处作业安全技术规范',  10, '1', '陈志远', 'org_002', '2025-03-15 09:00:00', 'org_002', '2025-03-15 09:00:00', NULL, '2025-03-15 09:00:00', NULL, '管理员', '0', 0, 0, '1', '0'),
('cour_005', 'COUR-005', '水利安全生产标准化',      'cate_002', '水利安全生产标准化建设与评审',        16, '1', '周伟',   'org_001', '2025-04-01 08:00:00', 'org_001', '2025-04-01 08:00:00', NULL, '2025-04-01 08:00:00', NULL, '管理员', '1', 0, 0, '1', '1');

-- 3. 课程参与记录
INSERT INTO slaj.bis_eutr_cour_rec (guid, pers_guid, cour_guid, last_stu_time, study_start_time, study_comp_time, eutr_time, eutr_huor, note, coll_time, upd_time, rec_pers) VALUES
('courrec_001', 'pers_001', 'cour_001', '2025-02-01 17:00:00', '2025-02-01 09:00:00', '2025-02-01 17:00:00', 8, 8, NULL, '2025-02-01 10:00:00', NULL, '管理员'),
('courrec_002', 'pers_002', 'cour_001', '2025-02-01 17:00:00', '2025-02-01 09:30:00', '2025-02-01 17:00:00', 8, 8, NULL, '2025-02-01 10:30:00', NULL, '管理员'),
('courrec_003', 'pers_001', 'cour_002', '2025-02-10 17:00:00', '2025-02-10 09:00:00', '2025-02-10 17:00:00', 12, 12, NULL, '2025-02-10 09:00:00', NULL, '管理员'),
('courrec_004', 'pers_003', 'cour_003', '2025-03-10 10:00:00', '2025-03-05 10:00:00', NULL, 4, 3.6, '学习中', '2025-03-05 10:00:00', NULL, '管理员'),
('courrec_005', 'pers_002', 'cour_005', NULL, '2025-04-01 08:00:00', NULL, 0, 0, '未开始', '2025-04-01 08:00:00', NULL, '管理员');

-- 4. 培训计划
INSERT INTO slaj.bis_eutr_plan (guid, plan_org_guid, eutr_plan_title, plan_exec_date, plan_pers_count, plan_total_hours, esta_pers, esta_time, rep_stat, note, coll_time, upd_time, rec_pers) VALUES
('plan_001', 'org_001', '2025年度安全生产培训计划',     '2025-01-01 00:00:00', 200, 480, '李明',   '2024-12-15 00:00:00', '0', NULL, '2024-12-15 00:00:00', NULL, '管理员'),
('plan_002', 'org_002', '2025年防汛专项培训计划',       '2025-04-01 00:00:00', 80,  160, '王建国', '2025-03-10 00:00:00', '0', NULL, '2025-03-10 00:00:00', NULL, '管理员'),
('plan_003', 'org_001', '2025年新员工安全入职培训',     '2025-03-01 00:00:00', 30,  24,  '赵强',   '2025-02-20 00:00:00', '0', NULL, '2025-02-20 00:00:00', NULL, '管理员');

-- 5. 培训记录
INSERT INTO slaj.bis_eutr_rec (guid, cour_guid, plan_guid, tr_time, tr_addr, tr_cont, tr_type, tr_stat, org_guid, teac_name, tr_pers_num, note, coll_time, upd_time, rec_pers) VALUES
('rec_001', 'cour_001', 'plan_001', '2025-02-01 09:00:00', '局机关三楼会议室',     '《安全生产法》解读培训',    '线下', '已完成', 'org_001', '李明',   '50', NULL, '2025-02-01 09:00:00', NULL, '管理员'),
('rec_002', 'cour_002', 'plan_001', '2025-02-10 09:00:00', '水库管理站培训室',     '危险源辨识现场培训',        '线下', '已完成', 'org_001', '王建国', '35', NULL, '2025-02-10 09:00:00', NULL, '管理员'),
('rec_003', 'cour_003', 'plan_002', '2025-03-05 10:00:00', '在线学习平台',         '防汛应急预案线上课程',       '线上', '已完成', 'org_002', '赵强',   '80', NULL, '2025-03-05 10:00:00', NULL, '管理员'),
('rec_004', 'cour_004', 'plan_001', '2025-03-15 09:00:00', '施工项目部安全体验馆',  '高处作业安全规范培训',      '线下', '待评估', 'org_002', '陈志远', '25', NULL, '2025-03-15 09:00:00', NULL, '管理员');

-- 6. 考试
INSERT INTO slaj.bis_eutr_exam (guid, cour_guid, eutr_exam_guid, eutr_exam_name, exam_hours, pass_get_hours, exam_total_score, pass_mark, exam_make_pers, note, coll_time, upd_time, rec_pers) VALUES
('exam_001', 'cour_001', 'E1', '安全生产法知识考试',     60,  60, 100, 60, '李明',   NULL, '2025-02-01 17:00:00', NULL, '管理员'),
('exam_002', 'cour_002', 'E2', '危险源辨识考核',         90,  90, 100, 70, '王建国', NULL, '2025-02-10 17:00:00', NULL, '管理员'),
('exam_003', 'cour_003', 'E3', '防汛预案知识测试',       45,  45, 100, 60, '赵强',   NULL, '2025-03-05 17:00:00', NULL, '管理员'),
('exam_004', 'cour_005', 'E4', '水利标准化评审考试',     120, 120, 100, 70, '周伟',   NULL, '2025-04-10 14:00:00', NULL, '管理员');

-- 7. 考试策略
INSERT INTO slaj.bis_eutr_exam_stra (guid, exam_guid, stra_name, stra_type, eq_num, eq_score, note, coll_time, upd_time, rec_pers) VALUES
('stra_001', 'exam_001', '随机抽题策略',     '随机', '20', '5', '从题库随机抽取20题',    '2025-01-20 08:00:00', NULL, '管理员'),
('stra_002', 'exam_002', '固定题目策略',     '固定', '15', '6', '固定15道单选+5多选',    '2025-01-25 08:00:00', NULL, '管理员'),
('stra_003', 'exam_003', '随机+固定混合',    '混合', '10', '10','10道固定+10道随机',    '2025-02-20 08:00:00', NULL, '管理员');

-- 8. 题库
INSERT INTO slaj.bis_eutr_eq (guid, cour_guid, eutr_eq_code, eutr_eq_name, exam_type, exam_diff_type, eq_score, eq_answ, is_use, note, coll_time, upd_time, rec_pers) VALUES
('eq_001', 'cour_001', 'EQ-001', '安全生产法的立法宗旨',       '1', '1', '5', 'A', '1', NULL, '2025-01-10 08:00:00', NULL, '管理员'),
('eq_002', 'cour_001', 'EQ-002', '危险源辨识的首要步骤',       '1', '2', '5', 'B', '1', NULL, '2025-01-10 08:00:00', NULL, '管理员'),
('eq_003', 'cour_002', 'EQ-003', '水利工程重大危险源（多选）', '2', '2', '10', 'A,B', '1', NULL, '2025-01-15 08:00:00', NULL, '管理员'),
('eq_004', 'cour_002', 'EQ-004', '所有工程须编制防汛应急预案',  '3', '1', '5', 'A', '1', NULL, '2025-01-15 08:00:00', NULL, '管理员'),
('eq_005', 'cour_004', 'EQ-005', '高处作业高度标准',           '1', '1', '5', 'B', '0', NULL, '2025-01-10 08:00:00', NULL, '管理员');

-- 9. 题目选项（答案内嵌在 eq_answ 字段中）
INSERT INTO slaj.bis_eutr_tque_opt (guid, eq_guid, opt_label, opt_cont, is_corr, opt_sort, note) VALUES
('opt_001', 'eq_001', 'A', '保护劳动者在生产过程中的安全与健康',           '1', '1', NULL),
('opt_002', 'eq_001', 'B', '提高企业经济效益',                            '0', '2', NULL),
('opt_003', 'eq_001', 'C', '规范安全生产监督管理体制',                    '0', '3', NULL),
('opt_004', 'eq_001', 'D', '促进社会经济发展',                            '0', '4', NULL),
('opt_005', 'eq_002', 'A', '编制应急预案',                                '0', '1', NULL),
('opt_006', 'eq_002', 'B', '危险源识别与风险分析',                        '1', '2', NULL),
('opt_007', 'eq_002', 'C', '制定管控措施',                                '0', '3', NULL),
('opt_008', 'eq_002', 'D', '开展安全培训',                                '0', '4', NULL),
('opt_009', 'eq_003', 'A', '坝高超过30米的水库大坝',                      '1', '1', NULL),
('opt_010', 'eq_003', 'B', '库容超过100万立方米的水库',                   '1', '2', NULL),
('opt_011', 'eq_003', 'C', '所有在建水利工程',                            '0', '3', NULL),
('opt_012', 'eq_003', 'D', '城市供水管道',                                '0', '4', NULL),
('opt_013', 'eq_004', 'A', '正确',                                        '1', '1', NULL),
('opt_014', 'eq_004', 'B', '错误',                                        '0', '2', NULL),
('opt_015', 'eq_005', 'A', '1米',                                         '0', '1', NULL),
('opt_016', 'eq_005', 'B', '2米',                                         '1', '2', NULL),
('opt_017', 'eq_005', 'C', '3米',                                         '0', '3', NULL),
('opt_018', 'eq_005', 'D', '5米',                                         '0', '4', NULL);

-- 10. 答题记录（选项内联 asnw_a/b/c/d）
INSERT INTO slaj.bis_eutr_eq_answ (guid, eq_guid, answ_a, answ_c, answ_b, answ_d, note, coll_time, upd_time, rec_pers) VALUES
('answ_001', 'eq_001', 'A',  '', '', '', '张三答题', '2025-02-01 17:10:00', NULL, '管理员'),
('answ_002', 'eq_002', '',  '', 'B', '', '张三答题', '2025-02-01 17:12:00', NULL, '管理员'),
('answ_003', 'eq_001', 'A',  '', '', '', '李四答题', '2025-02-01 17:11:00', NULL, '管理员'),
('answ_004', 'eq_002', '',  '', '', 'D','李四答错', '2025-02-01 17:13:00', NULL, '管理员'),
('answ_005', 'eq_003', 'A',  '', 'B', '', '张三多选题', '2025-02-10 17:20:00', NULL, '管理员');

-- 11. 课程-试题关联
INSERT INTO slaj.bis_eutr_cour_to_eq (guid, cour_guid, eq_guid, sort, note) VALUES
('cte_001', 'cour_001', 'eq_001', '1', NULL),
('cte_002', 'cour_001', 'eq_002', '2', NULL),
('cte_003', 'cour_002', 'eq_003', '1', NULL),
('cte_004', 'cour_002', 'eq_004', '2', NULL),
('cte_005', 'cour_004', 'eq_005', '1', NULL);

-- 12. 课程-科目关联
INSERT INTO slaj.bis_eutr_subject_of_cour (guid, cour_guid, subj_guid, subj_name, sort, note) VALUES
('soc_001', 'cour_001', NULL, '安全法律法规', '1', NULL),
('soc_002', 'cour_002', NULL, '危险源辨识',   '1', NULL),
('soc_003', 'cour_003', NULL, '应急管理',     '1', NULL),
('soc_004', 'cour_004', NULL, '施工安全',     '1', NULL);

-- 13. 线下培训记录
INSERT INTO slaj.bis_eutr_offl_rec (guid, org_guid, eutr_them, eutr_type, eutr_num, eutr_start_date, eutr_end_date, eutr_huor, eutr_loc, eutr_cont, note, coll_time, upd_time, rec_pers) VALUES
('off_001', 'org_001', '水利工程危险源辨识',     '线下', 35, '2025-02-10 09:00:00', '2025-02-10 17:00:00', '8',  '水库管理站培训室',   '危险源辨识现场培训',        '效果良好', '2025-02-10 09:00:00', NULL, '管理员'),
('off_002', 'org_002', '高处作业安全操作',       '线下', 25, '2025-03-15 09:00:00', '2025-03-15 17:00:00', '8',  '施工项目部安全体验馆','高处作业安全操作实操培训',  '已拍照存档', '2025-03-15 09:00:00', NULL, '管理员'),
('off_003', 'org_002', '危险源辨识补充培训',     '线下', 15, '2025-04-20 14:00:00', '2025-04-20 17:00:00', '3',  '河湖管理处会议室',   '危险源辨识补充培训第二期',  NULL,       '2025-04-20 14:00:00', NULL, '管理员');

-- ============================================================================
-- 二、监督检查模块 (sins)
-- ============================================================================

-- 1. 安全检查方案
INSERT INTO slaj.obj_sins (guid, sins_depl_name, sins_start_time, sins_comp_time, sins_range, sins_lare_id, sins_not_time, p_guid, note, coll_time, upd_time, rec_pers, not_issu_guid, sche_model, if_send_down) VALUES
('sins_001', '2025年春季水利工程安全大检查',      '2025-03-01 00:00:00', '2025-04-30 00:00:00', '全辖区',     'LARE-01', '2025-02-20 00:00:00', NULL, NULL, '2025-02-20 00:00:00', NULL, '管理员', NULL, '1', '1'),
('sins_002', '2025年汛前水库专项安全检查',        '2025-05-01 00:00:00', '2025-05-31 00:00:00', '水库大坝',   'LARE-02', '2025-04-10 00:00:00', NULL, NULL, '2025-04-10 00:00:00', NULL, '管理员', NULL, '1', '1'),
('sins_003', '2025年施工安全日常巡查方案',        '2025-01-01 00:00:00', '2025-12-31 00:00:00', '在建工程',   'LARE-03', '2025-01-01 00:00:00', NULL, NULL, '2025-01-01 00:00:00', NULL, '管理员', NULL, '2', '1'),
('sins_004', '2025年电气安全专项整治方案',        '2025-02-01 00:00:00', '2025-02-28 00:00:00', '电气设施',   'LARE-04', '2025-01-15 00:00:00', NULL, NULL, '2025-01-15 00:00:00', NULL, '管理员', NULL, '1', '0');

-- 2. 检查方案明细
INSERT INTO slaj.bis_sins_sche (guid, sins_guid, sche_name, sche_start_time, sche_comp_time, sche_cont, sche_make_time, sche_is_comp, note, coll_time, upd_time, rec_pers, sche_make_guid) VALUES
('sche_001', 'sins_001', '大坝安全检查',       '2025-03-01 00:00:00', '2025-03-15 00:00:00', '坝体结构安全,SL 319-2018', '2025-02-20 00:00:00', '0', NULL, '2025-02-20 00:00:00', NULL, '管理员', NULL),
('sche_002', 'sins_001', '泄洪设施检查',       '2025-03-01 00:00:00', '2025-03-20 00:00:00', '泄洪闸门与启闭机',       '2025-02-20 00:00:00', '0', NULL, '2025-02-20 00:00:00', NULL, '管理员', NULL),
('sche_003', 'sins_002', '水库水位监测',       '2025-05-01 00:00:00', '2025-05-15 00:00:00', '水位计运行状态',         '2025-04-10 00:00:00', '0', NULL, '2025-04-10 00:00:00', NULL, '管理员', NULL),
('sche_004', 'sins_003', '施工现场安全防护',   '2025-01-01 00:00:00', '2025-12-31 00:00:00', '脚手架与临边防护',       '2025-01-01 00:00:00', '0', NULL, '2025-01-01 00:00:00', NULL, '管理员', NULL),
('sche_005', 'sins_004', '配电箱安全检查',     '2025-02-01 00:00:00', '2025-02-28 00:00:00', '配电箱接地与漏保',       '2025-01-15 00:00:00', '1', NULL, '2025-01-15 00:00:00', NULL, '管理员', NULL);

-- 3. 检查组
INSERT INTO slaj.bis_sins_sche_grop (guid, sche_guid, group_name, group_leader, group_leader_wiun, sche_model, sche_path, sche_path_detl, note, coll_time, upd_time, rec_pers) VALUES
('grop_001', 'sche_001', '第一检查组（坝工）',     '王建国', '13800001111', '1', '青山水库', '坝体、泄洪设施', NULL, '2025-02-20 00:00:00', NULL, '管理员'),
('grop_002', 'sche_002', '第二检查组（机电）',     '陈志远', '13800002222', '1', '碧湖水库', '机电设备',       NULL, '2025-02-20 00:00:00', NULL, '管理员'),
('grop_003', 'sche_004', '日常巡查组',             '赵强',   '13800003333', '2', '全区',     '日常巡查',       NULL, '2025-01-01 00:00:00', NULL, '管理员'),
('grop_004', 'sche_003', '汛前检查专家组',         '周伟',   '13800004444', '1', '龙潭水库', '大坝安全',       NULL, '2025-04-10 00:00:00', NULL, '管理员');

-- 4. 检查报告
INSERT INTO slaj.bis_sins_report (guid, report_name, sht_filename, sht_url, rpx_filename, rpx_url, objsinsguid, note, coll_time, upd_time, rec_pers, report_code) VALUES
('rep_001', '电气安全专项整治报告',        'report_001.xls', '/files/report_001.xls', 'report_001.pdf', '/files/report_001.pdf', 'sins_004', '发现5处隐患已全部整改',     '2025-02-28 17:00:00', NULL, '管理员', 'REP-2025-001'),
('rep_002', '春季安全检查中期报告',        'report_002.xls', '/files/report_002.xls', 'report_002.pdf', '/files/report_002.pdf', 'sins_001', '检查进度50%发现隐患12处',    '2025-03-31 17:00:00', NULL, '管理员', 'REP-2025-002'),
('rep_003', '施工安全日常巡查周报第8周',   'report_003.xls', '/files/report_003.xls', NULL, NULL,           'sins_003', '本周未发现重大隐患',          '2025-03-01 17:00:00', NULL, '管理员', 'REP-2025-003');

-- 5. 专家信息
INSERT INTO slaj.obj_expert (guid, pers_guid, cit_num, pers_name, org_guid, sex, born_date, major, cur_major, cur_major_year, adm_duty, tech_tit, poaf_code, addr, zip, offi_tel, moph, home_tel, expert_grad, expert_resid, work_resum, wins_job_eava, appl_ins_post, sins_expert_type, sins_job_eava, bank_code, bank_depo, bank_card_num, note, coll_time, upd_time, rec_pers) VALUES
('exp_001', 'pers_001', '110101199001011234', '王建国', NULL, '1', '1965-05-15 00:00:00', '水利工程', '水利工程安全管理', 25, '总工程师', '高级工程师', '1', '北京市海淀区', '100001', '010-88881111', '13900001111', '010-66661111', '1', 'BJ-EXP-001', '30年水利工程安全管理经验', NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, '2025-01-01 00:00:00', NULL, '管理员'),
('exp_002', 'pers_002', '320101197203203456', '李教授', NULL, '1', '1972-03-20 00:00:00', '安全管理', '安全管理',  22, '教授',   '教授',       '1', '郑州市金水区', '450001', '0371-88882222', '13900002222', NULL, '1', 'HN-EXP-002', '安全管理学术带头人',   NULL, NULL, '2', NULL, NULL, NULL, NULL, NULL, '2025-01-01 00:00:00', NULL, '管理员'),
('exp_003', 'pers_003', '440101197812015678', '陈志远', NULL, '1', '1978-12-01 00:00:00', '机电工程', '机电安全',    18, '主任工程师', '高级工程师', '1', '广州市天河区', '510001', '020-88883333', '13900003333', NULL, '2', 'GD-EXP-003', '电力系统安全专家',     NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, '2025-01-01 00:00:00', NULL, '管理员'),
('exp_004', NULL, '320201198008089876', '张老师', NULL, '2', '1980-08-08 00:00:00', '应急救援', '应急管理',    15, '副教授', '副教授',     '1', '南京市鼓楼区', '210001', '025-88884444', '13900004444', NULL, '2', 'JS-EXP-004', '应急救援培训专家',     NULL, NULL, '2', NULL, NULL, NULL, NULL, NULL, '2025-01-01 00:00:00', NULL, '管理员');

-- 6. 执法案件
INSERT INTO slaj.obj_case (guid, case_num, case_name, case_sour, case_time, case_prog, case_proc, liti_type, sune_org_guid, pun_form, pun_time, pun_fund, contra1, contra_num1, fili_time, clos_time, arch_time, arch_num, if_recon_hear, if_enfor, if_review, if_arch, case_liti_name, case_liti_mobi, case_leg, case_liti_addr, post_code, case_cous, case_fili_basi, case_situ, pun_bais, pun_desc, note, coll_time, upd_time, rec_pers, org_guid, unit_type, ad_area, sce_pun_time, sce_fou_pro, sce_deci, soc_cre_code, domain_class, is_break_pro) VALUES
('case_001', 'CASE-2025-001', '某水利工程施工安全隐患案',     '日常巡查发现', '2025-01-10 00:00:00', '1', '1', '1', 'org_001', '罚款', '2025-02-20 00:00:00', 20000, 'XX建设公司', 'ORG-001', '2025-01-10 00:00:00', '2025-02-20 00:00:00', '2025-02-20 00:00:00', 'ARCH-001', '1', '1', '0', '1', 'XX建设公司', '13800001111', '张三', 'XX市XX路1号', '100001', '水利工程安全管理', '施工现场未设置警示标志', '违反安全生产法', '罚款2万元', NULL, '2025-01-10 00:00:00', NULL, '管理员', 'org_001', '1', '北京市海淀区', NULL, NULL, NULL, NULL, NULL, NULL),
('case_002', 'CASE-2025-002', '某水库未按规定开展巡查案',   '上级督办',     '2025-02-05 00:00:00', '0', '0', '1', 'org_002', NULL, NULL, NULL, 'XX水库管理处', 'ORG-002', '2025-02-05 00:00:00', NULL, NULL, NULL, '0', '0', '0', '0', 'XX水库管理处', '13900002222', '李四', 'XX市XX路2号', '200001', '安全监管', '未按巡查制度执行日常巡查', NULL, NULL, NULL, '2025-02-05 00:00:00', NULL, '管理员', 'org_002', '2', '武汉市武昌区', NULL, NULL, NULL, NULL, NULL, NULL),
('case_003', 'CASE-2025-003', '无证上岗违规案',             '专项检查发现', '2025-03-01 00:00:00', '1', '1', '1', 'org_001', '罚款', '2025-03-20 00:00:00', 5000, 'XX施工队',   'ORG-003', '2025-03-01 00:00:00', '2025-03-20 00:00:00', '2025-03-20 00:00:00', 'ARCH-003', '0', '1', '0', '0', 'XX施工队',   '13800003333', '王五', 'XX市XX路3号', '300001', '资质管理', '特种作业人员无证上岗', '违反安全生产法', '罚款5千元限期取证', NULL, '2025-03-01 00:00:00', NULL, '管理员', 'org_001', '1', '广州市天河区', NULL, NULL, NULL, NULL, NULL, NULL);

-- 7. 不良行为记录
INSERT INTO slaj.bis_wiun_bere_bad (guid, org_guid, bood_beh_type, rete_peri, cred_grad, lake_id, entr_pers, disp_time, bad_beh_desc, disp_deci, disp_org, disp_basis, disp_disc, stat, note, coll_time, upd_time, rec_pers, date_scou, bood_beh_group, admin_org_guid, start_time, end_time, behav_code, is_illegal, suen_guid) VALUES
('bad_001', 'org_001', '1', '2025Q1', '1', 'LAKE-01', '王建国', '2025-02-15 00:00:00', '未按期整改安全隐患',       '通报批评限期整改',    '水利工程管理局', '安全生产条例第35条', '书面警告', '1', NULL, '2025-02-15 00:00:00', NULL, '管理员', '5', '1', 'org_001', '2025-02-15 00:00:00', '2025-03-15 00:00:00', 'BAD-001', '1', NULL),
('bad_002', 'org_002', '2', '2025Q1', '2', 'LAKE-02', '陈志远', '2025-03-20 00:00:00', '发生轻伤事故未及时上报',   '记入信用档案',        '河湖管理处',     '安全生产法第99条',     '信用降级', '0', NULL, '2025-03-20 00:00:00', NULL, '管理员', '10','2', 'org_002', '2025-03-20 00:00:00', NULL, 'BAD-002', '1', NULL),
('bad_003', 'org_001', '1', '2025Q1', '1', 'LAKE-03', '赵强',   '2025-01-05 00:00:00', '安全培训记录造假',         '约谈负责人重新培训',  '水利工程管理局', '安全生产条例第28条', '口头警告', '1', NULL, '2025-01-05 00:00:00', NULL, '管理员', '3', '1', 'org_001', '2025-01-05 00:00:00', '2025-02-05 00:00:00', 'BAD-003', '1', NULL);

-- 8. 水库工程属性
INSERT INTO slaj.att_eng_res (guid, p_guid, eng_name, eng_guid, impo_grad, appr_budg, start_date, comp_date, eng_stat, org_guid, oflp_code, if_rein_force, proj_guid, stat, res_code, cen_long, cen_lat, res_loc, rv_guid, ad_guid, eng_grad, eng_scal, dam_type_mat, dam_type_str, dam_size_hig, dam_size_len, dam_cre_elv, des_fl_stand, fl_low_lim_lev, fl_low_lim_lev_start, fl_low_lim_lev_end, des_fl_stag, main_fl_type, dead_lev, tot_cap, dead_cap, flco_cap, note, coll_time, upd_time, rec_pers, eng_rein_force_guid) VALUES
('res_001', NULL, '青山水库',  'ENG001','1', 50000000, '2010-03-15 00:00:00', '2015-06-30 00:00:00', '1', 'org_001', 'OFLP-001', '0', NULL, '1', 'RES-001', 118.5, 32.3, '安徽省青阳县', NULL, NULL, '2', '大2型', '砼', '重力坝', 68, 520, 185.5, 0.01, 150.0, '2025-04-01 00:00:00', '2025-10-31 00:00:00', 182.0, '1', 150.0, 12000, 800, 200, NULL, '2025-01-01 00:00:00', NULL, '管理员', NULL),
('res_002', NULL, '碧湖水库',  'ENG002','2', 30000000, '2012-05-20 00:00:00', '2017-12-31 00:00:00', '1', 'org_002', 'OFLP-002', '0', NULL, '1', 'RES-002', 114.2, 30.5, '湖北省武汉市', NULL, NULL, '3', '中型', '土石', '土石坝', 42, 380, 120.3, 0.01, 95.0,  '2025-04-01 00:00:00', '2025-10-31 00:00:00', 118.0, '1', 95.0,  3200, 300,  80,  NULL, '2025-01-01 00:00:00', NULL, '管理员', NULL),
('res_003', NULL, '龙潭水库',  'ENG003','1', 80000000, '2015-08-10 00:00:00', '2020-09-30 00:00:00', '1', 'org_001', 'OFLP-003', '0', NULL, '1', 'RES-003', 110.8, 28.1, '湖南省长沙市', NULL, NULL, '1', '大1型', '砼', '拱坝',   120,680, 356.0, 0.005, 310.0, '2025-04-01 00:00:00', '2025-10-31 00:00:00', 350.0, '1', 310.0, 35000, 2500, 600, NULL, '2025-01-01 00:00:00', NULL, '管理员', NULL);

-- 9. 工程机构关联
INSERT INTO slaj.rel_eng_org (guid, eng_guid, org_guid, from_date, to_date) VALUES
('reo_001', 'ENG001', 'org_001', '2020-01-01 00:00:00', '2025-12-31 00:00:00'),
('reo_002', 'ENG002', 'org_002', '2020-01-01 00:00:00', '2025-12-31 00:00:00'),
('reo_003', 'ENG003', 'org_001', '2022-06-01 00:00:00', '2026-06-01 00:00:00');

-- 10. 检查方案机构关联
INSERT INTO slaj.rel_sins_org (guid, sins_guid, org_guid, from_date, to_date, stat) VALUES
('rso_001', 'sins_001', 'org_001', '2025-03-01 00:00:00', '2025-04-30 00:00:00', '0'),
('rso_002', 'sins_001', 'org_002', '2025-03-01 00:00:00', '2025-04-30 00:00:00', '0'),
('rso_003', 'sins_002', 'org_002', '2025-05-01 00:00:00', '2025-05-31 00:00:00', '0'),
('rso_004', 'sins_003', 'org_001', '2025-01-01 00:00:00', '2025-12-31 00:00:00', '0');

-- 11. 检查组专家关联
INSERT INTO slaj.rel_sins_group_expe (guid, group_guid, expe_guid, from_date, to_date) VALUES
('rsge_001', 'grop_001', 'exp_001', '2025-03-01 00:00:00', '2025-03-15 00:00:00'),
('rsge_002', 'grop_001', 'exp_002', '2025-03-01 00:00:00', '2025-03-15 00:00:00'),
('rsge_003', 'grop_002', 'exp_003', '2025-03-01 00:00:00', '2025-03-20 00:00:00'),
('rsge_004', 'grop_004', 'exp_001', '2025-05-01 00:00:00', '2025-05-15 00:00:00'),
('rsge_005', 'grop_004', 'exp_004', '2025-05-01 00:00:00', '2025-05-15 00:00:00');

-- 12. 检查组人员关联
INSERT INTO slaj.rel_sins_group_pers (guid, group_guid, pers_guid, from_date, to_date) VALUES
('rsgp_001', 'grop_001', 'pers_001', '2025-03-01 00:00:00', '2025-03-15 00:00:00'),
('rsgp_002', 'grop_001', 'pers_002', '2025-03-01 00:00:00', '2025-03-15 00:00:00'),
('rsgp_003', 'grop_002', 'pers_003', '2025-03-01 00:00:00', '2025-03-20 00:00:00'),
('rsgp_004', 'grop_003', 'pers_001', '2025-01-01 00:00:00', '2025-12-31 00:00:00');

-- 13. 检查组安全元素关联
INSERT INTO slaj.rel_sins_group_wiun (guid, group_guid, obj_guid, from_date, to_date, stat, sins_type) VALUES
('rsgw_001', 'grop_001', 'ENG-001', '2025-03-01 00:00:00', '2025-03-15 00:00:00', '0', '1'),
('rsgw_002', 'grop_001', 'ENG-002', '2025-03-01 00:00:00', '2025-03-15 00:00:00', '0', '1'),
('rsgw_003', 'grop_002', 'ENG-003', '2025-03-01 00:00:00', '2025-03-20 00:00:00', '0', '1'),
('rsgw_004', 'grop_003', 'ENG-004', '2025-01-01 00:00:00', '2025-12-31 00:00:00', '0', '2');

-- 14. SBLZ配置
INSERT INTO slaj.rel_sblz_config (guid, sche_guid, expert_guid, config_info, from_date, to_date, group_guid, leader_org_guid) VALUES
('sblz_001', 'sche_001', 'exp_001', '{"check_interval":7,"alarm_threshold":3}',  '2025-03-01 00:00:00', '2025-03-15 00:00:00', 'grop_001', 'org_001'),
('sblz_002', 'sche_002', 'exp_003', '{"check_interval":7,"auto_assign":true}',     '2025-03-01 00:00:00', '2025-03-20 00:00:00', 'grop_002', 'org_001'),
('sblz_003', 'sche_003', 'exp_001', '{"check_interval":14,"report_template":"A"}','2025-05-01 00:00:00', '2025-05-15 00:00:00', 'grop_004', 'org_002'),
('sblz_004', 'sche_004', NULL,      '{"check_interval":1,"auto_assign":true}',     '2025-01-01 00:00:00', '2025-12-31 00:00:00', 'grop_003', 'org_001');

-- 15. SAWF信用安全评估
INSERT INTO slaj.sawf_cred_sapr (guid, unit_name, unit_soc_cre_code, black_list_start_date, black_list_end_date, black_list_rele_wiun, black_list_reas, note, coll_time, upd_time, rec_pers) VALUES
('sawf_001', 'XX建设公司',    'SCC-001', '2025-01-01 00:00:00', '2025-12-31 00:00:00', '水利部安监司', '安全检查不合格',     NULL, '2025-01-01 00:00:00', NULL, '管理员'),
('sawf_002', 'XX水库管理处',  'SCC-002', '2025-03-01 00:00:00', '2025-09-30 00:00:00', '省水利厅',     '巡查记录缺失',       NULL, '2025-03-01 00:00:00', NULL, '管理员'),
('sawf_003', 'XX施工队',      'SCC-003', NULL, NULL, NULL, NULL, NULL, '2025-01-01 00:00:00', NULL, '管理员');

-- ============================================================================
-- 三、标准化管理模块 (stan)
-- ============================================================================

-- 1. 标准化证书
INSERT INTO slaj.bis_stan_cert (guid, stan_cert_code, stan_revi_guid, org_guid, stan_grad, issue_time, cert_expi_time, issue_wiun_code, cert_stat, note, coll_time, upd_time, rec_pers) VALUES
('cert_001', 'STAN-2025-0001', NULL, 'org_001', '1', '2025-01-01 00:00:00', '2028-01-01 00:00:00', '水利部', '1', NULL, '2025-01-01 00:00:00', NULL, '管理员'),
('cert_002', 'STAN-2025-0002', NULL, 'org_002', '2', '2025-02-01 00:00:00', '2028-02-01 00:00:00', '省水利厅', '1', NULL, '2025-02-01 00:00:00', NULL, '管理员'),
('cert_003', 'STAN-2024-0058', NULL, 'org_001', '3', '2024-06-01 00:00:00', '2027-06-01 00:00:00', '流域机构', '2', '即将到期', '2024-06-01 00:00:00', NULL, '管理员');

-- 2. 证书变更申请
INSERT INTO slaj.bis_stan_cert_cha_appl (guid, stan_cert_guid, chan_name, appl_pers, org_guid, chan_type, risk_ana, cont_meas, apll_time, veri_time, veri_pers, if_agree, wiun_opin, appr_time, appr_pers, appr_if_agree, appr_wiun_opin, note, coll_time, upd_time, rec_pers) VALUES
('cha_001', 'cert_003', '机构名称变更', '张三', 'org_002', '1', '低风险', '更新证书信息', '2025-03-01 00:00:00', '2025-03-10 00:00:00', '王建国', '1', '同意变更', NULL, NULL, NULL, NULL, NULL, '2025-03-01 00:00:00', NULL, '管理员'),
('cha_002', 'cert_001', '业务范围扩展', '李四', 'org_001', '2', '低风险', '增加运行管理', '2025-04-01 00:00:00', '2025-04-05 00:00:00', '陈志远', '1', '同意变更', '2025-04-10 00:00:00', '周伟', '1', '同意通过', NULL, '2025-04-01 00:00:00', NULL, '管理员');

-- 3. 证书延期申请
INSERT INTO slaj.bis_stan_cert_ext_appl (guid, stan_cert_guid, org_guid, ext_exp, apll_time, veri_time, if_agree, veri_wiun, appr_pers, appr_if_agree, appr_wiun, note, coll_time, upd_time, rec_pers) VALUES
('ext_001', 'cert_003', 'org_001', '延期3年', '2025-03-15 00:00:00', '2025-03-20 00:00:00', '1', '同意延期', '周伟', '1', '同意通过', NULL, '2025-03-15 00:00:00', NULL, '管理员'),
('ext_002', 'cert_002', 'org_002', '延期3年', '2025-05-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-05-01 00:00:00', NULL, '管理员');

-- 4. 证书审核
INSERT INTO slaj.bis_stan_cert_rev (guid, stan_cert_guid, rev_reas, rev_time, note, coll_time, upd_time, rec_pers) VALUES
('rev_001', 'cert_003', '证书变更审核', '2025-03-10 00:00:00', '资料齐全同意变更', '2025-03-10 00:00:00', NULL, '管理员'),
('rev_002', 'cert_001', '证书变更审核', '2025-04-05 00:00:00', '变更内容符合要求', '2025-04-05 00:00:00', NULL, '管理员'),
('rev_003', 'cert_003', '证书延期审核', '2025-03-20 00:00:00', '材料初审通过',     '2025-03-20 00:00:00', NULL, '管理员');

-- 5. 标准化评审记录
INSERT INTO slaj.bis_stan_revi_rec (guid, stan_revi_guid, revi_wiun_code, revi_type, conf_time, conf_loc, part_pers, if_site_revi, start_time, end_time, revi_chief, revi_vice_chief, revi_group_mem, if_agree, revi_opin, recom_level, veri_time, pers_expert_guid, site_revi_note, revi_note, note, coll_time, upd_time, rec_pers, revi_grade) VALUES
('sr_001', 'SR001', 'REVI-001', '1', '2025-01-20 00:00:00', '水利工程管理局三楼会议室', '李教授,王建国,陈志远', '1', '2025-01-20 09:00:00', '2025-01-20 17:00:00', '李教授', '王建国', '陈志远,张老师', '1', '建议通过一级标准化认证', '1', NULL, 'exp_002', NULL, NULL, '初次评审', '2025-01-20 00:00:00', NULL, '管理员', 'A'),
('sr_002', 'SR002', 'REVI-002', '2', '2025-06-15 00:00:00', '青山水库管理站', '王建国,陈志远', '1', '2025-06-15 09:00:00', '2025-06-15 17:00:00', '王建国', '陈志远', '', '1', '年度复审通过', NULL, NULL, 'exp_001', NULL, NULL, '年度复审', '2025-06-15 00:00:00', NULL, '管理员', 'B'),
('sr_003', 'SR003', 'REVI-003', '3', '2025-02-10 00:00:00', '河湖管理处办公室', '陈志远,周伟', '0', NULL, NULL, '陈志远', '周伟', '', '0', '需补充安全制度文件', NULL, NULL, 'exp_003', NULL, '未通过', '专项评审', '2025-02-10 00:00:00', NULL, '管理员', 'C');

-- 6. 标准化评分
INSERT INTO slaj.bis_stan_score (guid, p_guid, name, stan_score, rese_score, act_score, scor_rate, stan_stan_guid, bis_stan_self_eva, stan_revi_guid, stan_self_eva_score_guid, note, coll_time, upd_time, rec_pers) VALUES
('sc_001', NULL, '组织机构与职责',     10, 10, 10, 1, NULL, NULL, NULL, NULL, NULL, '2025-01-20 00:00:00', NULL, '管理员'),
('sc_002', NULL, '安全管理制度建设',   15, 12, 12, 0.80,  NULL, NULL, NULL, NULL, '部分制度未更新', '2025-01-20 00:00:00', NULL, '管理员'),
('sc_003', NULL, '安全教育培训',       15, 15, 15, 1, NULL, NULL, NULL, NULL, NULL, '2025-01-20 00:00:00', NULL, '管理员'),
('sc_004', NULL, '隐患排查治理',       20, 18, 18, 0.90,  NULL, NULL, NULL, NULL, '2项隐患整改超期', '2025-01-20 00:00:00', NULL, '管理员'),
('sc_005', NULL, '应急管理',           10, 8,  8,  0.80,  NULL, NULL, NULL, NULL, '演练频次不足', '2025-01-20 00:00:00', NULL, '管理员');

-- 7. 标准化自评报告
INSERT INTO slaj.bis_stan_self_eva_rep (guid, elf_eva_scor, year, rep_wiun_code, stan_grad, rep_time, revi_opin, note, coll_time, upd_time, rec_pers) VALUES
('ser_001', 88, 2025, 'SLJ-001', '1', '2025-03-31 00:00:00', '自评达标', NULL, '2025-03-31 00:00:00', NULL, '管理员'),
('ser_002', 72, 2025, 'HLG-001', '2', '2025-03-31 00:00:00', NULL,        '草稿', '2025-03-31 00:00:00', NULL, '管理员'),
('ser_003', 85, 2024, 'SLJ-012', '1', '2025-01-10 00:00:00', '年度达标', NULL, '2025-01-10 00:00:00', NULL, '管理员');

-- 8. 现场评审
INSERT INTO slaj.bis_scen_revi (guid, scen_revi_code, appl_guid, scen_revi_opin, veri_opin, appr_opin, appr_stat, note, coll_time, upd_time, rec_pers, veri_stat) VALUES
('scen_001', 'SCEN-2025-001', 'appl_001', '现场核查达标符合一级标准',      '同意通过', '批准发证', '1', NULL, '2025-01-25 00:00:00', NULL, '管理员', '1'),
('scen_002', 'SCEN-2025-002', 'appl_002', '安全制度执行不到位',           '限期整改', NULL,       '0', '需30日内整改完毕', '2025-02-15 00:00:00', NULL, '管理员', '0'),
('scen_003', 'SCEN-2025-003', 'appl_003', '日常管理规范设施运行良好',      '同意通过', '维持等级', '1', NULL, '2025-06-20 00:00:00', NULL, '管理员', '1');

-- 9. 初审
INSERT INTO slaj.bis_from_firsttria (guid, from_firsttria_code, appl_guid, veri_opin, veri_resu, veri_pers, veri_date, note, coll_time, upd_time, rec_pers) VALUES
('firs_001', 'FIRS-2025-001', 'appl_001', '申请材料齐全符合受理条件',           '1', '陈志远', '2025-03-05 00:00:00', NULL, '2025-03-05 00:00:00', NULL, '管理员'),
('firs_002', 'FIRS-2025-002', 'appl_002', '材料不完整需补充安全生产制度文件',   '0', '王建国', '2025-04-02 00:00:00', '缺少应急预案备案证明', '2025-04-02 00:00:00', NULL, '管理员'),
('firs_003', 'FIRS-2025-003', 'appl_003', '符合初审要求建议进入评审流程',       '1', '周伟',   '2025-05-10 00:00:00', NULL, '2025-05-10 00:00:00', NULL, '管理员');

-- 10. 标准化申请
INSERT INTO slaj.obj_stan_appl (guid, stan_appl_code, appl_org_guid, "array", appl_prop, appl_grade, befo_stan_situ, self_eva_conc, appl_time, stat, note, coll_time, upd_time, rec_pers) VALUES
('appl_001', 'APPL-2025-001', 'org_001', '直属单位', '1', '1', '0', '自评达标', '2025-01-05 00:00:00', '1', NULL, '2025-01-05 00:00:00', NULL, '管理员'),
('appl_002', 'APPL-2025-002', 'org_002', '直属单位', '2', '2', '0', '自评通过', '2025-03-01 00:00:00', '0', NULL, '2025-03-01 00:00:00', NULL, '管理员'),
('appl_003', 'APPL-2025-003', 'org_001', '直属单位', '1', '1', '1', '评价合格', '2025-06-01 00:00:00', '1', NULL, '2025-06-01 00:00:00', NULL, '管理员');

-- 11. 标准化评审对象
INSERT INTO slaj.obj_stan_revi (guid, appl_org_guid, appl_prop, appl_grade, befo_stan_situ, self_eva_conc, appl_time, veri_wiun_code, veri_time, veri_opin, veri_conc, note, coll_time, upd_time, rec_pers) VALUES
('osr_001', 'org_001', '1', '1', '0', '自评85分', '2025-01-20 00:00:00', 'VERI-001', '2025-01-25 00:00:00', '综合评价达标建议通过', '1', NULL, '2025-01-20 00:00:00', NULL, '管理员'),
('osr_002', 'org_002', '2', '2', '0', '自评72分', '2025-02-10 00:00:00', 'VERI-002', '2025-02-15 00:00:00', '需补充安全制度文件',   '0', NULL, '2025-02-10 00:00:00', NULL, '管理员'),
('osr_003', 'org_001', '1', '1', '1', '评价合格', '2025-12-01 00:00:00', NULL, NULL, NULL, NULL, '待安排', '2025-12-01 00:00:00', NULL, '管理员');

-- 12. 处罚对象
INSERT INTO slaj.obj_puno (guid, titl, cont, puno_type, rele_time, end_time, rele_pers, rele_org_guid, vali_time, stat, note, coll_time, upd_time, rec_pers, stan_revi_guid, puno_sour) VALUES
('puno_001', '施工现场未设置安全警示标志',     'XX建设公司在青山水库施工现场未设置安全警示标志', '1', '2025-01-10 00:00:00', NULL, '王建国', 'org_001', '12个月', '1', NULL, '2025-01-10 00:00:00', NULL, '管理员', NULL, '1'),
('puno_002', '安全管理制度执行不到位',         '河湖管理处安全制度在基层站所执行不到位',         '2', '2025-02-20 00:00:00', NULL, '陈志远', 'org_001', '6个月',  '2', '已提交整改报告', '2025-02-20 00:00:00', NULL, '管理员', NULL, '1'),
('puno_003', '未按规定对特种设备进行定期检测', 'XX施工队未按规定对起重机进行定期安全检测',       '1', '2025-03-05 00:00:00', NULL, '周伟',   'org_001', '12个月', '0', '复议中',         '2025-03-05 00:00:00', NULL, '管理员', NULL, '2'),
('puno_004', '安全检查记录造假',               'XX项目部安全检查记录与实际不符存在造假行为',     '3', '2025-04-01 00:00:00', NULL, '赵强',   'org_002', '6个月',  '1', NULL, '2025-04-01 00:00:00', NULL, '管理员', NULL, '1');
