-- 撤销「胶料快检实验方法」：删除菜单权限、字典、业务表（可整文件一次执行）
-- 说明：若仅未执行过 V3.9.2_99 / mes-xsl-rubber-quick-test-method-menu-permission.sql，执行本脚本即可；
--       已 Flyway 执行过 V3.9.2_99 的环境，请同时执行 flyway V3.9.2_100 或本脚本（内容一致）。
SET NAMES utf8mb4;

DELETE FROM `sys_role_permission`
WHERE `permission_id` IN (
  '1860000000000000170',
  '1860000000000000171', '1860000000000000172', '1860000000000000173',
  '1860000000000000174', '1860000000000000175', '1860000000000000176'
);

DELETE FROM `sys_permission`
WHERE `id` IN (
  '1860000000000000170',
  '1860000000000000171', '1860000000000000172', '1860000000000000173',
  '1860000000000000174', '1860000000000000175', '1860000000000000176'
);

DELETE di FROM `sys_dict_item` di
INNER JOIN `sys_dict` d ON di.`dict_id` = d.`id`
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND d.`del_flag` = 0;

DELETE FROM `sys_dict`
WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type';

DROP TABLE IF EXISTS `mes_xsl_rubber_quick_test_method`;
