SET NAMES utf8mb4;

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000001, 0, 0, '技能管理', '/ai/skill', '/ai/skill/SkillList', 'lucide:badge-check',
  1, '', 3, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, '管理端 Skill 管理菜单'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000001
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000011, 367400000000000001, 1, '查询', '', '', '',
  0, '/api/v1/skill/query', 1, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-查询'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000011
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000012, 367400000000000001, 1, '详情', '', '', '',
  0, '/api/v1/skill/getDetail', 2, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-详情'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000012
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000013, 367400000000000001, 1, '保存', '', '', '',
  0, '/api/v1/skill/save', 3, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-保存'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000013
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000014, 367400000000000001, 1, '更新', '', '', '',
  0, '/api/v1/skill/update', 4, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-更新'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000014
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000015, 367400000000000001, 1, '删除', '', '', '',
  0, '/api/v1/skill/remove', 5, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-删除'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000015
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000016, 367400000000000001, 1, '发布', '', '', '',
  0, '/api/v1/skill/submitPublishApproval', 6, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-发布审批'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000016
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000017, 367400000000000001, 1, '下线', '', '', '',
  0, '/api/v1/skill/submitOfflineApproval', 7, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-下线审批'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000017
);

INSERT INTO `tb_sys_menu` (
  `id`, `parent_id`, `menu_type`, `menu_title`, `menu_url`, `component`, `menu_icon`,
  `is_show`, `permission_tag`, `sort_no`, `status`, `created`, `created_by`, `modified`, `modified_by`, `remark`
)
SELECT
  367400000000000018, 367400000000000001, 1, '删除审批', '', '', '',
  0, '/api/v1/skill/submitDeleteApproval', 8, 0, '2026-06-05 20:00:00', 1, '2026-06-05 20:00:00', 1, 'Skill-删除审批'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367400000000000018
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000101, 1, 367400000000000001
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000001
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000111, 1, 367400000000000011
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000011
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000112, 1, 367400000000000012
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000012
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000113, 1, 367400000000000013
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000013
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000114, 1, 367400000000000014
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000014
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000115, 1, 367400000000000015
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000015
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000116, 1, 367400000000000016
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000016
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000117, 1, 367400000000000017
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000017
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367400000000000118, 1, 367400000000000018
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `role_id` = 1 AND `menu_id` = 367400000000000018
);
