Files
qhmes/jeecg-boot/db/mes-xsl-equipment-ledger-menu-parent-fix.sql

32 lines
958 B
Java
Raw Permalink 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.
-- 设备管理目录 MES管理 下迁出 MES基础资料 同级已执行旧版 mes-xsl-equipment-ledger-menu-permission 时用
SET NAMES utf8mb4;
SET @mes_equip_root_parent = (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料'
LIMIT 1
);
SET @mes_equip_root_parent = IFNULL(@mes_equip_root_parent, (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料'
LIMIT 1
));
SET @mes_equip_root_sort = IFNULL((
SELECT `sort_no` + 1 FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
ORDER BY `sort_no` DESC
LIMIT 1
), 51);
UPDATE `sys_permission`
SET
`parent_id` = @mes_equip_root_parent,
`sort_no` = @mes_equip_root_sort,
`menu_type` = 0,
`is_leaf` = 0,
`hidden` = 0,
`status` = '1',
`del_flag` = 0
WHERE `id` = '1860000000000000133';