-- ============================================================================
-- sys_menu SQL for 教育培训 + 监督检查 + 标准化管理 三个模块
-- PostgreSQL
-- ============================================================================
-- 使用说明:
--   1. 先确认父级菜单ID (查找 parent_menu):
--      SELECT menu_id, menu_name FROM sys_menu WHERE menu_name LIKE '%安全%';
--   2. 设置下面 @parent_id 为父级菜单ID（通常为 hazard/acci/hidd 的同级目录ID）
--   3. 如果需要在根目录下新建，则设置 @parent_id = 0
--   4. 本脚本使用 DO $$ ... $$ 块，一次性插入所有菜单和按钮
-- ============================================================================

-- 注意：执行前请先修改 parent_menu_id 的值，替换下面三处 0 为实际的父级菜单ID
-- 查询现有 slaj 模块的父级: SELECT menu_id, parent_id, menu_name FROM sys_menu WHERE menu_name IN ('事故管理','危险源管理','隐患管理');

DO $$
DECLARE
    parent_menu_id BIGINT := 0;  -- ★ 请修改为实际的父级菜单ID ★

    -- 教育培训
    eutr_dir_id     BIGINT;
    eutr_cour_id    BIGINT;
    eutr_courcate_id BIGINT;
    eutr_courrec_id BIGINT;
    eutr_plan_id    BIGINT;
    eutr_record_id  BIGINT;
    eutr_exam_id    BIGINT;
    eutr_examstra_id BIGINT;
    eutr_eq_id      BIGINT;
    eutr_tqueopt_id BIGINT;
    eutr_eqansw_id  BIGINT;
    eutr_courtoeq_id BIGINT;
    eutr_subject_id BIGINT;
    eutr_offlrec_id BIGINT;

    -- 监督检查
    sins_dir_id     BIGINT;
    sins_objsins_id BIGINT;
    sins_sche_id    BIGINT;
    sins_grop_id    BIGINT;
    sins_report_id  BIGINT;
    sins_expert_id  BIGINT;
    sins_case_id    BIGINT;
    sins_bad_id     BIGINT;
    sins_engres_id  BIGINT;
    sins_relengorg_id BIGINT;
    sins_relsinstoorg_id BIGINT;
    sins_relgrouptoexpe_id BIGINT;
    sins_relgrouptopers_id BIGINT;
    sins_relgrouptowiun_id BIGINT;
    sins_relsblz_id BIGINT;
    sins_sawf_id    BIGINT;

    -- 标准化管理
    stan_dir_id     BIGINT;
    stan_cert_id    BIGINT;
    stan_certcha_id BIGINT;
    stan_certext_id BIGINT;
    stan_certrev_id BIGINT;
    stan_revirec_id BIGINT;
    stan_score_id   BIGINT;
    stan_selfeva_id BIGINT;
    stan_scenrevi_id BIGINT;
    stan_firsttria_id BIGINT;
    stan_appl_id    BIGINT;
    stan_revi_id    BIGINT;
    stan_puno_id    BIGINT;

    max_order INT;
BEGIN
    -- ========================================================================
    -- 清理已存在的三个模块菜单（支持重复执行，先删子再删父）
    -- ========================================================================
    DELETE FROM sys_menu WHERE perms LIKE 'eutr:%';     -- 教育培训 C+F
    DELETE FROM sys_menu WHERE perms LIKE 'sins:%';     -- 监督检查 C+F
    DELETE FROM sys_menu WHERE perms LIKE 'stan:%';     -- 标准化管理 C+F
    DELETE FROM sys_menu WHERE path IN ('eutr','sins','stan') AND menu_type = 'M';  -- 三个目录
    -- 重置序列，修复因先前执行导致的ID冲突
    PERFORM setval('sys_menu_menu_id_seq', COALESCE((SELECT MAX(menu_id) FROM sys_menu), 0));

    -- 获取当前最大排序号
    SELECT COALESCE(MAX(order_num), 0) INTO max_order FROM sys_menu WHERE parent_id = parent_menu_id;

    -- ============================================================================
    -- 一、教育培训模块 (eutr)
    -- ============================================================================
    max_order := max_order + 1;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('教育培训', parent_menu_id, max_order, 'eutr', NULL, 1, 0, 'M', '0', '0', '', 'education', 'admin', now())
    RETURNING menu_id INTO eutr_dir_id;

    -- 课程管理
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('课程管理', eutr_dir_id, 1, 'cour', 'slaj/eutr/cour/index', 1, 0, 'C', '0', '0', 'eutr:objcour:list', 'list', 'admin', now())
    RETURNING menu_id INTO eutr_cour_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('课程新增', eutr_cour_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:objcour:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('课程修改', eutr_cour_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:objcour:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('课程删除', eutr_cour_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:objcour:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('课程导出', eutr_cour_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:objcour:export', '#', 'admin', now());

    -- 课程类别
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('课程类别', eutr_dir_id, 2, 'courcate', 'slaj/eutr/courcate/index', 1, 0, 'C', '0', '0', 'eutr:courcate:list', 'tree-table', 'admin', now())
    RETURNING menu_id INTO eutr_courcate_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('类别新增', eutr_courcate_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:courcate:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('类别修改', eutr_courcate_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:courcate:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('类别删除', eutr_courcate_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:courcate:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('类别导出', eutr_courcate_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:courcate:export', '#', 'admin', now());

    -- 学习记录
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('学习记录', eutr_dir_id, 3, 'courrec', 'slaj/eutr/courrec/index', 1, 0, 'C', '0', '0', 'eutr:courrec:list', 'log', 'admin', now())
    RETURNING menu_id INTO eutr_courrec_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录新增', eutr_courrec_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:courrec:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录修改', eutr_courrec_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:courrec:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录删除', eutr_courrec_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:courrec:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录导出', eutr_courrec_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:courrec:export', '#', 'admin', now());

    -- 培训计划
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('培训计划', eutr_dir_id, 4, 'plan', 'slaj/eutr/plan/index', 1, 0, 'C', '0', '0', 'eutr:plan:list', 'date', 'admin', now())
    RETURNING menu_id INTO eutr_plan_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('计划新增', eutr_plan_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:plan:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('计划修改', eutr_plan_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:plan:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('计划删除', eutr_plan_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:plan:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('计划导出', eutr_plan_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:plan:export', '#', 'admin', now());

    -- 培训记录
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('培训记录', eutr_dir_id, 5, 'record', 'slaj/eutr/record/index', 1, 0, 'C', '0', '0', 'eutr:record:list', 'documentation', 'admin', now())
    RETURNING menu_id INTO eutr_record_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录新增', eutr_record_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:record:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录修改', eutr_record_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:record:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录删除', eutr_record_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:record:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('记录导出', eutr_record_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:record:export', '#', 'admin', now());

    -- 考试管理
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('考试管理', eutr_dir_id, 6, 'exam', 'slaj/eutr/exam/index', 1, 0, 'C', '0', '0', 'eutr:exam:list', 'edit', 'admin', now())
    RETURNING menu_id INTO eutr_exam_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('考试新增', eutr_exam_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:exam:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('考试修改', eutr_exam_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:exam:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('考试删除', eutr_exam_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:exam:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('考试导出', eutr_exam_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:exam:export', '#', 'admin', now());

    -- 考试策略
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('考试策略', eutr_dir_id, 7, 'examstra', 'slaj/eutr/examstra/index', 1, 0, 'C', '0', '0', 'eutr:examstra:list', 'component', 'admin', now())
    RETURNING menu_id INTO eutr_examstra_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('策略新增', eutr_examstra_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:examstra:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('策略修改', eutr_examstra_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:examstra:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('策略删除', eutr_examstra_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:examstra:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('策略导出', eutr_examstra_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:examstra:export', '#', 'admin', now());

    -- 题库管理
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('题库管理', eutr_dir_id, 8, 'eq', 'slaj/eutr/eq/index', 1, 0, 'C', '0', '0', 'eutr:eq:list', 'form', 'admin', now())
    RETURNING menu_id INTO eutr_eq_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('试题新增', eutr_eq_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:eq:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('试题修改', eutr_eq_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:eq:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('试题删除', eutr_eq_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:eq:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('试题导出', eutr_eq_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:eq:export', '#', 'admin', now());

    -- 题目选项
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('题目选项', eutr_dir_id, 9, 'tqueopt', 'slaj/eutr/tqueopt/index', 1, 0, 'C', '0', '0', 'eutr:tqueopt:list', 'radio', 'admin', now())
    RETURNING menu_id INTO eutr_tqueopt_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('选项新增', eutr_tqueopt_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:tqueopt:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('选项修改', eutr_tqueopt_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:tqueopt:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('选项删除', eutr_tqueopt_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:tqueopt:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('选项导出', eutr_tqueopt_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:tqueopt:export', '#', 'admin', now());

    -- 答题记录
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('答题记录', eutr_dir_id, 10, 'eqansw', 'slaj/eutr/eqansw/index', 1, 0, 'C', '0', '0', 'eutr:eqansw:list', 'tab', 'admin', now())
    RETURNING menu_id INTO eutr_eqansw_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('答记新增', eutr_eqansw_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:eqansw:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('答记修改', eutr_eqansw_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:eqansw:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('答记删除', eutr_eqansw_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:eqansw:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('答记导出', eutr_eqansw_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:eqansw:export', '#', 'admin', now());

    -- 课程试题关联
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('课程试题关联', eutr_dir_id, 11, 'courtoeq', 'slaj/eutr/courtoeq/index', 1, 0, 'C', '0', '0', 'eutr:courtoeq:list', 'link', 'admin', now())
    RETURNING menu_id INTO eutr_courtoeq_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联新增', eutr_courtoeq_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:courtoeq:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联修改', eutr_courtoeq_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:courtoeq:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联删除', eutr_courtoeq_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:courtoeq:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联导出', eutr_courtoeq_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:courtoeq:export', '#', 'admin', now());

    -- 课程科目关联
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('课程科目关联', eutr_dir_id, 12, 'subjectofcour', 'slaj/eutr/subjectofcour/index', 1, 0, 'C', '0', '0', 'eutr:subjectofcour:list', 'nested', 'admin', now())
    RETURNING menu_id INTO eutr_subject_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联新增', eutr_subject_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:subjectofcour:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联修改', eutr_subject_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:subjectofcour:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联删除', eutr_subject_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:subjectofcour:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联导出', eutr_subject_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:subjectofcour:export', '#', 'admin', now());

    -- 线下培训记录
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('线下培训记录', eutr_dir_id, 13, 'offlrec', 'slaj/eutr/offlrec/index', 1, 0, 'C', '0', '0', 'eutr:offlrec:list', 'example', 'admin', now())
    RETURNING menu_id INTO eutr_offlrec_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('线下新增', eutr_offlrec_id, 1, '', '', 1, 0, 'F', '0', '0', 'eutr:offlrec:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('线下修改', eutr_offlrec_id, 2, '', '', 1, 0, 'F', '0', '0', 'eutr:offlrec:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('线下删除', eutr_offlrec_id, 3, '', '', 1, 0, 'F', '0', '0', 'eutr:offlrec:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('线下导出', eutr_offlrec_id, 4, '', '', 1, 0, 'F', '0', '0', 'eutr:offlrec:export', '#', 'admin', now());

    -- ============================================================================
    -- 二、监督检查模块 (sins)
    -- ============================================================================
    max_order := max_order + 1;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('监督检查', parent_menu_id, max_order, 'sins', NULL, 1, 0, 'M', '0', '0', '', 'monitor', 'admin', now())
    RETURNING menu_id INTO sins_dir_id;

    -- 安全检查方案
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('安全检查方案', sins_dir_id, 1, 'objsins', 'slaj/sins/objsins/index', 1, 0, 'C', '0', '0', 'sins:objsins:list', 'build', 'admin', now())
    RETURNING menu_id INTO sins_objsins_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('方案新增', sins_objsins_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:objsins:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('方案修改', sins_objsins_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:objsins:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('方案删除', sins_objsins_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:objsins:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('方案导出', sins_objsins_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:objsins:export', '#', 'admin', now());

    -- 检查方案明细
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('检查方案明细', sins_dir_id, 2, 'sinssche', 'slaj/sins/sinssche/index', 1, 0, 'C', '0', '0', 'sins:sinssche:list', 'dict', 'admin', now())
    RETURNING menu_id INTO sins_sche_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('明细新增', sins_sche_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:sinssche:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('明细修改', sins_sche_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:sinssche:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('明细删除', sins_sche_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:sinssche:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('明细导出', sins_sche_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:sinssche:export', '#', 'admin', now());

    -- 检查组
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('检查组', sins_dir_id, 3, 'sinsschegrop', 'slaj/sins/sinsschegrop/index', 1, 0, 'C', '0', '0', 'sins:sinsschegrop:list', 'peoples', 'admin', now())
    RETURNING menu_id INTO sins_grop_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('组新增', sins_grop_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:sinsschegrop:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('组修改', sins_grop_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:sinsschegrop:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('组删除', sins_grop_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:sinsschegrop:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('组导出', sins_grop_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:sinsschegrop:export', '#', 'admin', now());

    -- 检查报告
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('检查报告', sins_dir_id, 4, 'sinsreport', 'slaj/sins/sinsreport/index', 1, 0, 'C', '0', '0', 'sins:sinsreport:list', 'report', 'admin', now())
    RETURNING menu_id INTO sins_report_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('报告新增', sins_report_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:sinsreport:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('报告修改', sins_report_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:sinsreport:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('报告删除', sins_report_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:sinsreport:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('报告导出', sins_report_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:sinsreport:export', '#', 'admin', now());

    -- 专家信息
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('专家信息', sins_dir_id, 5, 'objexpert', 'slaj/sins/objexpert/index', 1, 0, 'C', '0', '0', 'sins:objexpert:list', 'user', 'admin', now())
    RETURNING menu_id INTO sins_expert_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('专家新增', sins_expert_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:objexpert:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('专家修改', sins_expert_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:objexpert:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('专家删除', sins_expert_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:objexpert:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('专家导出', sins_expert_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:objexpert:export', '#', 'admin', now());

    -- 执法案件
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('执法案件', sins_dir_id, 6, 'objcase', 'slaj/sins/objcase/index', 1, 0, 'C', '0', '0', 'sins:objcase:list', 'bug', 'admin', now())
    RETURNING menu_id INTO sins_case_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('案件新增', sins_case_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:objcase:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('案件修改', sins_case_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:objcase:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('案件删除', sins_case_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:objcase:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('案件导出', sins_case_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:objcase:export', '#', 'admin', now());

    -- 不良行为记录
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('不良行为记录', sins_dir_id, 7, 'wiunberebad', 'slaj/sins/wiunberebad/index', 1, 0, 'C', '0', '0', 'sins:wiunberebad:list', 'warning', 'admin', now())
    RETURNING menu_id INTO sins_bad_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('行为新增', sins_bad_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:wiunberebad:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('行为修改', sins_bad_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:wiunberebad:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('行为删除', sins_bad_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:wiunberebad:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('行为导出', sins_bad_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:wiunberebad:export', '#', 'admin', now());

    -- 水库工程属性
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('水库工程属性', sins_dir_id, 8, 'attengres', 'slaj/sins/attengres/index', 1, 0, 'C', '0', '0', 'sins:attengres:list', 'guide', 'admin', now())
    RETURNING menu_id INTO sins_engres_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('工程新增', sins_engres_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:attengres:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('工程修改', sins_engres_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:attengres:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('工程删除', sins_engres_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:attengres:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('工程导出', sins_engres_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:attengres:export', '#', 'admin', now());

    -- 工程机构关联
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('工程机构关联', sins_dir_id, 9, 'relengorg', 'slaj/sins/relengorg/index', 1, 0, 'C', '0', '0', 'sins:relengorg:list', 'connection', 'admin', now())
    RETURNING menu_id INTO sins_relengorg_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联新增', sins_relengorg_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:relengorg:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联修改', sins_relengorg_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:relengorg:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联删除', sins_relengorg_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:relengorg:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联导出', sins_relengorg_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:relengorg:export', '#', 'admin', now());

    -- 检查方案机构关联
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('检查方案机构关联', sins_dir_id, 10, 'relsinstoorg', 'slaj/sins/relsinstoorg/index', 1, 0, 'C', '0', '0', 'sins:relsinstoorg:list', 'cascader', 'admin', now())
    RETURNING menu_id INTO sins_relsinstoorg_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联新增', sins_relsinstoorg_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:relsinstoorg:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联修改', sins_relsinstoorg_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:relsinstoorg:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联删除', sins_relsinstoorg_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:relsinstoorg:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联导出', sins_relsinstoorg_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:relsinstoorg:export', '#', 'admin', now());

    -- 检查组专家关联
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('检查组专家关联', sins_dir_id, 11, 'relsinsgrouptoexpe', 'slaj/sins/relsinsgrouptoexpe/index', 1, 0, 'C', '0', '0', 'sins:relsinsgrouptoexpe:list', 'user', 'admin', now())
    RETURNING menu_id INTO sins_relgrouptoexpe_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联新增', sins_relgrouptoexpe_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptoexpe:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联修改', sins_relgrouptoexpe_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptoexpe:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联删除', sins_relgrouptoexpe_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptoexpe:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联导出', sins_relgrouptoexpe_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptoexpe:export', '#', 'admin', now());

    -- 检查组人员关联
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('检查组人员关联', sins_dir_id, 12, 'relsinsgrouptopers', 'slaj/sins/relsinsgrouptopers/index', 1, 0, 'C', '0', '0', 'sins:relsinsgrouptopers:list', 'people', 'admin', now())
    RETURNING menu_id INTO sins_relgrouptopers_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联新增', sins_relgrouptopers_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptopers:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联修改', sins_relgrouptopers_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptopers:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联删除', sins_relgrouptopers_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptopers:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联导出', sins_relgrouptopers_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptopers:export', '#', 'admin', now());

    -- 检查组安全元素关联
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('检查组安全元素关联', sins_dir_id, 13, 'relsinsgrouptowiun', 'slaj/sins/relsinsgrouptowiun/index', 1, 0, 'C', '0', '0', 'sins:relsinsgrouptowiun:list', 'validCode', 'admin', now())
    RETURNING menu_id INTO sins_relgrouptowiun_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联新增', sins_relgrouptowiun_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptowiun:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联修改', sins_relgrouptowiun_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptowiun:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联删除', sins_relgrouptowiun_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptowiun:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('关联导出', sins_relgrouptowiun_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:relsinsgrouptowiun:export', '#', 'admin', now());

    -- SBLZ配置
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('SBLZ配置', sins_dir_id, 14, 'relsblzconfig', 'slaj/sins/relsblzconfig/index', 1, 0, 'C', '0', '0', 'sins:relsblzconfig:list', 'system', 'admin', now())
    RETURNING menu_id INTO sins_relsblz_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('配置新增', sins_relsblz_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:relsblzconfig:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('配置修改', sins_relsblz_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:relsblzconfig:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('配置删除', sins_relsblz_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:relsblzconfig:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('配置导出', sins_relsblz_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:relsblzconfig:export', '#', 'admin', now());

    -- SAWF信用安全评估
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('SAWF信用安全评估', sins_dir_id, 15, 'sawfcredsapr', 'slaj/sins/sawfcredsapr/index', 1, 0, 'C', '0', '0', 'sins:sawfcredsapr:list', 'star', 'admin', now())
    RETURNING menu_id INTO sins_sawf_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评估新增', sins_sawf_id, 1, '', '', 1, 0, 'F', '0', '0', 'sins:sawfcredsapr:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评估修改', sins_sawf_id, 2, '', '', 1, 0, 'F', '0', '0', 'sins:sawfcredsapr:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评估删除', sins_sawf_id, 3, '', '', 1, 0, 'F', '0', '0', 'sins:sawfcredsapr:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评估导出', sins_sawf_id, 4, '', '', 1, 0, 'F', '0', '0', 'sins:sawfcredsapr:export', '#', 'admin', now());

    -- ============================================================================
    -- 三、标准化管理模块 (stan)
    -- ============================================================================
    max_order := max_order + 1;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('标准化管理', parent_menu_id, max_order, 'stan', NULL, 1, 0, 'M', '0', '0', '', 'certificate', 'admin', now())
    RETURNING menu_id INTO stan_dir_id;

    -- 标准化证书
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('标准化证书', stan_dir_id, 1, 'stancert', 'slaj/stan/stancert/index', 1, 0, 'C', '0', '0', 'stan:stancert:list', 'certificate', 'admin', now())
    RETURNING menu_id INTO stan_cert_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('证书新增', stan_cert_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:stancert:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('证书修改', stan_cert_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:stancert:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('证书删除', stan_cert_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:stancert:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('证书导出', stan_cert_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:stancert:export', '#', 'admin', now());

    -- 证书变更申请
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('证书变更申请', stan_dir_id, 2, 'stancertchaappl', 'slaj/stan/stancertchaappl/index', 1, 0, 'C', '0', '0', 'stan:stancertchaappl:list', 'edit', 'admin', now())
    RETURNING menu_id INTO stan_certcha_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('变更新增', stan_certcha_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:stancertchaappl:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('变更修改', stan_certcha_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:stancertchaappl:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('变更删除', stan_certcha_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:stancertchaappl:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('变更导出', stan_certcha_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:stancertchaappl:export', '#', 'admin', now());

    -- 证书延期申请
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('证书延期申请', stan_dir_id, 3, 'stancertextappl', 'slaj/stan/stancertextappl/index', 1, 0, 'C', '0', '0', 'stan:stancertextappl:list', 'time-range', 'admin', now())
    RETURNING menu_id INTO stan_certext_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('延期新增', stan_certext_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:stancertextappl:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('延期修改', stan_certext_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:stancertextappl:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('延期删除', stan_certext_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:stancertextappl:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('延期导出', stan_certext_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:stancertextappl:export', '#', 'admin', now());

    -- 证书审核
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('证书审核', stan_dir_id, 4, 'stancertrev', 'slaj/stan/stancertrev/index', 1, 0, 'C', '0', '0', 'stan:stancertrev:list', 'review', 'admin', now())
    RETURNING menu_id INTO stan_certrev_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('审核新增', stan_certrev_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:stancertrev:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('审核修改', stan_certrev_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:stancertrev:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('审核删除', stan_certrev_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:stancertrev:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('审核导出', stan_certrev_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:stancertrev:export', '#', 'admin', now());

    -- 标准化评审记录
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('标准化评审记录', stan_dir_id, 5, 'stanrevirec', 'slaj/stan/stanrevirec/index', 1, 0, 'C', '0', '0', 'stan:stanrevirec:list', 'log', 'admin', now())
    RETURNING menu_id INTO stan_revirec_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审新增', stan_revirec_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:stanrevirec:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审修改', stan_revirec_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:stanrevirec:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审删除', stan_revirec_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:stanrevirec:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审导出', stan_revirec_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:stanrevirec:export', '#', 'admin', now());

    -- 标准化评分
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('标准化评分', stan_dir_id, 6, 'stanscore', 'slaj/stan/stanscore/index', 1, 0, 'C', '0', '0', 'stan:stanscore:list', 'number', 'admin', now())
    RETURNING menu_id INTO stan_score_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评分新增', stan_score_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:stanscore:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评分修改', stan_score_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:stanscore:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评分删除', stan_score_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:stanscore:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评分导出', stan_score_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:stanscore:export', '#', 'admin', now());

    -- 标准化自评报告
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('标准化自评报告', stan_dir_id, 7, 'stanselfevarep', 'slaj/stan/stanselfevarep/index', 1, 0, 'C', '0', '0', 'stan:stanselfevarep:list', 'documentation', 'admin', now())
    RETURNING menu_id INTO stan_selfeva_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('自评新增', stan_selfeva_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:stanselfevarep:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('自评修改', stan_selfeva_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:stanselfevarep:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('自评删除', stan_selfeva_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:stanselfevarep:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('自评导出', stan_selfeva_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:stanselfevarep:export', '#', 'admin', now());

    -- 现场评审
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('现场评审', stan_dir_id, 8, 'scenrevi', 'slaj/stan/scenrevi/index', 1, 0, 'C', '0', '0', 'stan:scenrevi:list', 'eye-open', 'admin', now())
    RETURNING menu_id INTO stan_scenrevi_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('现场新增', stan_scenrevi_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:scenrevi:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('现场修改', stan_scenrevi_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:scenrevi:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('现场删除', stan_scenrevi_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:scenrevi:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('现场导出', stan_scenrevi_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:scenrevi:export', '#', 'admin', now());

    -- 初审
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('初审', stan_dir_id, 9, 'fromfirsttria', 'slaj/stan/fromfirsttria/index', 1, 0, 'C', '0', '0', 'stan:fromfirsttria:list', 'search', 'admin', now())
    RETURNING menu_id INTO stan_firsttria_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('初审新增', stan_firsttria_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:fromfirsttria:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('初审修改', stan_firsttria_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:fromfirsttria:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('初审删除', stan_firsttria_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:fromfirsttria:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('初审导出', stan_firsttria_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:fromfirsttria:export', '#', 'admin', now());

    -- 标准化申请
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('标准化申请', stan_dir_id, 10, 'objstanappl', 'slaj/stan/objstanappl/index', 1, 0, 'C', '0', '0', 'stan:objstanappl:list', 'form', 'admin', now())
    RETURNING menu_id INTO stan_appl_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('申请新增', stan_appl_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:objstanappl:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('申请修改', stan_appl_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:objstanappl:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('申请删除', stan_appl_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:objstanappl:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('申请导出', stan_appl_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:objstanappl:export', '#', 'admin', now());

    -- 标准化评审对象
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('标准化评审对象', stan_dir_id, 11, 'objstanrevi', 'slaj/stan/objstanrevi/index', 1, 0, 'C', '0', '0', 'stan:objstanrevi:list', 'example', 'admin', now())
    RETURNING menu_id INTO stan_revi_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审新增', stan_revi_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:objstanrevi:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审修改', stan_revi_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:objstanrevi:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审删除', stan_revi_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:objstanrevi:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('评审导出', stan_revi_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:objstanrevi:export', '#', 'admin', now());

    -- 处罚对象
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
    VALUES ('处罚对象', stan_dir_id, 12, 'objpuno', 'slaj/stan/objpuno/index', 1, 0, 'C', '0', '0', 'stan:objpuno:list', 'education', 'admin', now())
    RETURNING menu_id INTO stan_puno_id;
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('处罚新增', stan_puno_id, 1, '', '', 1, 0, 'F', '0', '0', 'stan:objpuno:add', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('处罚修改', stan_puno_id, 2, '', '', 1, 0, 'F', '0', '0', 'stan:objpuno:edit', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('处罚删除', stan_puno_id, 3, '', '', 1, 0, 'F', '0', '0', 'stan:objpuno:remove', '#', 'admin', now());
    INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('处罚导出', stan_puno_id, 4, '', '', 1, 0, 'F', '0', '0', 'stan:objpuno:export', '#', 'admin', now());

    RAISE NOTICE 'Menu SQL executed successfully. % rows inserted.', (SELECT COUNT(*) FROM sys_menu WHERE create_time >= now() - interval '1 minute');
END $$;
