重点关注人员管理-手动修复.sql 7.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. -- ============================================================
  2. -- 【手动清理+插入】重点关注人员管理菜单数据
  3. -- 使用场景:数据库已有脏数据需要清除重新插入时执行
  4. -- 执行顺序:先执行 DELTE,再执行 INSERT
  5. -- ============================================================
  6. -- Step 1: 清除旧数据(包括角色授权和菜单记录)
  7. DELETE FROM sys_role_permission WHERE permission_id in ('178060100000002','178060100000010','178060100000011','178060100000012','178060100000013','178060100000014','178060100000015','178060100000016');
  8. DELETE FROM sys_permission WHERE id in ('178060100000002','178060100000010','178060100000011','178060100000012','178060100000013','178060100000014','178060100000015','178060100000016');
  9. -- Step 2: 插入新数据
  10. -- 一级菜单:信息智能匹配推送
  11. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
  12. VALUES ('178060100000002', '', '信息智能匹配推送', '/focusPersonnel', 'layouts/default/index', 1, NULL, '/focusPersonnel/focusPersonnelList', 0, NULL, '1', 1.80, 0, 'ant-design:audit-outlined', 0, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  13. -- 二级菜单:重点关注人员管理
  14. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
  15. VALUES ('178060100000010', '178060100000002', '重点关注人员管理', '/focusPersonnel/focusPersonnelList', 'focuspersonnel/FocusPersonnelList', 1, NULL, NULL, 1, NULL, '1', 1.00, 0, 'ant-design:user-outlined', 1, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  16. -- 按钮权限
  17. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('178060100000011', '178060100000010', '添加重点关注人员管理', NULL, NULL, 0, NULL, NULL, 2, 'focus_personnel:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  18. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('178060100000012', '178060100000010', '编辑重点关注人员管理', NULL, NULL, 0, NULL, NULL, 2, 'focus_personnel:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  19. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('178060100000013', '178060100000010', '删除重点关注人员管理', NULL, NULL, 0, NULL, NULL, 2, 'focus_personnel:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  20. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('178060100000014', '178060100000010', '批量删除重点关注人员管理', NULL, NULL, 0, NULL, NULL, 2, 'focus_personnel:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  21. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('178060100000015', '178060100000010', '导出excel_重点关注人员管理', NULL, NULL, 0, NULL, NULL, 2, 'focus_personnel:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  22. INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('178060100000016', '178060100000010', '导入excel_重点关注人员管理', NULL, NULL, 0, NULL, NULL, 2, 'focus_personnel:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-03 10:00:00', NULL, NULL, 0, 0, '1', 0);
  23. -- 角色授权(admin角色,role_id固定值 f6817f48af4fb3af11b9e8bf182f618b)
  24. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000021', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000002', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  25. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000022', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000010', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  26. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000023', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000011', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  27. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000024', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000012', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  28. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000025', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000013', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  29. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000026', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000014', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  30. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000027', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000015', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  31. INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178060100000028', 'f6817f48af4fb3af11b9e8bf182f618b', '178060100000016', NULL, '2026-06-03 10:00:00', '127.0.0.1');
  32. -- Step 3: 验证结果
  33. SELECT 'sys_permission' as tbl, id, parent_id, name, component, menu_type, always_show, redirect, is_leaf, status, del_flag
  34. FROM sys_permission WHERE id like '1780601000000%'
  35. UNION ALL
  36. SELECT 'sys_role_permission' as tbl, rp.id, rp.permission_id, p.name, '', 0, 0, '', 0, 0, 0
  37. FROM sys_role_permission rp
  38. JOIN sys_permission p ON rp.permission_id = p.id
  39. WHERE rp.permission_id like '1780601000000%'
  40. ORDER BY tbl, id;