Files
cattleTransportation/tradeCattle/update_menu_names.sql
2025-10-21 17:29:52 +08:00

18 lines
851 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 修改菜单名称的SQL脚本
-- 删除第一个"test"菜单项,将第二个"test"改为"系统管理"
-- 1. 首先查看当前的菜单结构
-- SELECT id, parent_id, name, type, sort FROM sys_menu WHERE is_delete = 0 ORDER BY sort;
-- 2. 删除第一个"test"菜单项假设它的sort值较小
-- 注意这里需要根据实际的菜单ID来删除请先查询确认
DELETE FROM sys_menu WHERE name = 'test' AND parent_id = 0 AND sort = (SELECT MIN(sort) FROM sys_menu WHERE name = 'test' AND parent_id = 0 AND is_delete = 0);
-- 3. 将第二个"test"菜单项的名称改为"系统管理"
UPDATE sys_menu
SET name = '系统管理', update_time = NOW()
WHERE name = 'test' AND parent_id = 0 AND is_delete = 0;
-- 4. 验证修改结果
-- SELECT id, parent_id, name, type, sort FROM sys_menu WHERE is_delete = 0 ORDER BY sort;