Files
zkxw/docs/sql/2026-08-19-storage-release-market-overview-offline.sql
T
2026-08-19 16:33:51 +08:00

43 lines
1.5 KiB
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.
-- 市场 → 细胞存储 → 入库放行审核:取消全部角色授权 + 菜单软删
-- MySQL 5.7;可重复执行
-- 目标菜单:id=70000000000000000000000000000011
-- perms=biz:storageReleaseReview:list
-- 不影响生产/质检侧入库放行审核菜单与授权
SET @tenant_no = CONVERT('zkxw' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
SET @menu_market = CONVERT('70000000000000000000000000000011' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-- 1) 取消任意角色对该菜单的授权(软删 sys_role_menu)
UPDATE sys_role_menu
SET
del_flag = 1,
update_time = NOW(),
remark = 'revoke market storage release review (overview offline)'
WHERE menu_id COLLATE utf8mb4_unicode_ci = @menu_market
AND del_flag = 0;
-- 兼容按 perms 关联(若存在重复/历史 id)
UPDATE sys_role_menu rm
INNER JOIN sys_menu m
ON m.id COLLATE utf8mb4_unicode_ci = rm.menu_id COLLATE utf8mb4_unicode_ci
SET
rm.del_flag = 1,
rm.update_time = NOW(),
rm.remark = 'revoke market storage release review (overview offline)'
WHERE m.perms COLLATE utf8mb4_unicode_ci = 'biz:storageReleaseReview:list'
AND rm.del_flag = 0;
-- 2) 菜单表虚拟删除
UPDATE sys_menu
SET
del_flag = 1,
visible = '0',
status = '0',
update_time = NOW(),
remark = '市场侧入库放行审核暂下线(改由生产/质检入口)'
WHERE (
id COLLATE utf8mb4_unicode_ci = @menu_market
OR perms COLLATE utf8mb4_unicode_ci = 'biz:storageReleaseReview:list'
)
AND del_flag = 0;