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
  367200000000000001, 0, 0, 'menus.ai.chat', '/ai/chat', '/ai/chat/index', 'svg:talk',
  1, '', 0, 0, '2026-05-12 10:00:00', 1, '2026-05-12 10:00:00', 1, '管理端聊天工作台菜单'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367200000000000001
);

INSERT INTO `tb_sys_role_menu` (`id`, `role_id`, `menu_id`)
SELECT 367200000000000101, 1, 367200000000000001
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_role_menu` WHERE `id` = 367200000000000101
);
