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
  367300000000000001, 0, 0, 'menus.ai.agents', '/ai/agents', '/ai/agents/AgentList', 'lucide:bot',
  1, '', 2, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, '管理端 Agent 编排菜单'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000001
);

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
  367300000000000011, 367300000000000001, 1, '查询', '', '', '',
  0, '/api/v1/agent/query', 1, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-查询'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000011
);

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
  367300000000000012, 367300000000000001, 1, '详情', '', '', '',
  0, '/api/v1/agent/getDetail', 2, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-详情'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000012
);

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
  367300000000000013, 367300000000000001, 1, '保存', '', '', '',
  0, '/api/v1/agent/save', 3, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-保存'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000013
);

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
  367300000000000014, 367300000000000001, 1, '更新', '', '', '',
  0, '/api/v1/agent/update', 4, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-更新'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000014
);

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
  367300000000000015, 367300000000000001, 1, '删除', '', '', '',
  0, '/api/v1/agent/remove', 5, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-删除'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000015
);

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
  367300000000000016, 367300000000000001, 1, '发布', '', '', '',
  0, '/api/v1/agent/submitPublishApproval', 6, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-发布审批'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000016
);

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
  367300000000000017, 367300000000000001, 1, '下线', '', '', '',
  0, '/api/v1/agent/submitOfflineApproval', 7, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-下线审批'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000017
);

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
  367300000000000018, 367300000000000001, 1, '删除审批', '', '', '',
  0, '/api/v1/agent/submitDeleteApproval', 8, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-删除审批'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000018
);

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
  367300000000000019, 367300000000000001, 1, '工具绑定', '', '', '',
  0, '/api/v1/agent/toolBinding/update', 9, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-工具绑定更新'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000019
);

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
  367300000000000020, 367300000000000001, 1, '知识绑定', '', '', '',
  0, '/api/v1/agent/knowledgeBinding/update', 10, 0, '2026-05-20 10:00:00', 1, '2026-05-20 10:00:00', 1, 'Agent-知识库绑定更新'
FROM DUAL
WHERE NOT EXISTS (
  SELECT 1 FROM `tb_sys_menu` WHERE `id` = 367300000000000020
);

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

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

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

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

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

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

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

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

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

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

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