-- GP12不良问题点配置表
CREATE TABLE IF NOT EXISTS `mes_gp12_issue` (
  `id` varchar(64) NOT NULL COMMENT '主键',
  `check_item` varchar(255) NOT NULL COMMENT '检验项目',
  `standard` varchar(2000) DEFAULT NULL COMMENT '判定标准',
  `method` varchar(1000) DEFAULT NULL COMMENT '检验方法',
  `sort` int(11) DEFAULT 0 COMMENT '排序号',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`),
  KEY `idx_mes_gp12_issue_sort` (`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='GP12不良问题点';

-- 菜单：系统管理/生产线管理/GP12问题点配置
INSERT INTO `js_sys_menu` VALUES (
'2075100000000000001', '1680784143702568960', '0,1582259822626603008,1680784143702568960,',
160, '0000009000,0000001059,0000000160,', '1', 2,
'系统管理/生产线管理/GP12问题点配置', 'GP12问题点配置', '1', '/mes/mesGp12Issue/list',
'', '', '', '', 'mes:mesGp12Issue:view,mes:mesGp12Issue:edit',
40, '1', 'default', 'core', NULL, NULL, '0',
'system', NOW(), 'system', NOW(),
'', '', '', '', '', '', '', '', '',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
);

-- 给已有「大屏计划」权限的角色同步菜单
INSERT INTO `js_sys_role_menu` (`role_code`, `menu_code`)
SELECT rm.`role_code`, '2075100000000000001'
FROM `js_sys_role_menu` rm
WHERE rm.`menu_code` = '1720060989331107840'
  AND NOT EXISTS (
      SELECT 1 FROM `js_sys_role_menu` x
      WHERE x.`role_code` = rm.`role_code`
        AND x.`menu_code` = '2075100000000000001'
  );
