-- 涂胶加工时长表及菜单(挂载:生产管理 / 工艺过程参数) CREATE TABLE IF NOT EXISTS `mes_product_glue_duration` ( `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', `sn` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '工件码', `oprno` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '工位号', `line_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产线编号', `glue_duration` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '涂胶时长', `remarks` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1删除 2停用)', `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间', `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', `update_date` datetime NULL DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE, KEY `idx_mes_product_glue_duration_sn` (`sn`) USING BTREE, KEY `idx_mes_product_glue_duration_oprno` (`oprno`) USING BTREE, KEY `idx_mes_product_glue_duration_line_sn` (`line_sn`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '涂胶加工时长' ROW_FORMAT = DYNAMIC; INSERT INTO `js_sys_menu` ( `menu_code`, `parent_code`, `parent_codes`, `tree_sort`, `tree_sorts`, `tree_leaf`, `tree_level`, `tree_names`, `menu_name`, `menu_type`, `menu_href`, `menu_target`, `menu_icon`, `menu_color`, `menu_title`, `permission`, `weight`, `is_show`, `sys_code`, `module_codes`, `component`, `params`, `status`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks` ) SELECT 'mesProductGlueDuration', m.`parent_code`, m.`parent_codes`, IFNULL(m.`tree_sort`, 0) + 5, m.`tree_sorts`, '1', m.`tree_level`, REPLACE(m.`tree_names`, SUBSTRING_INDEX(m.`tree_names`, '/', -1), '涂胶加工时长'), '涂胶加工时长', '1', '/mes/mesProductGlueDuration/list', '', IFNULL(m.`menu_icon`, 'icon-notebook'), '', '', 'mes:mesProductGlueDuration:view,mes:mesProductGlueDuration:edit', IFNULL(m.`weight`, 40), '1', IFNULL(m.`sys_code`, 'default'), IFNULL(m.`module_codes`, 'core'), NULL, NULL, '0', 'system', NOW(), 'system', NOW(), '' FROM `js_sys_menu` m WHERE m.`menu_href` IN ( '/mes/mesProductQm/listWhitePart', '/mes/mesProductArcWelding/listSpot', '/mes/mesProductProd/list', '/mes/mesProductQm/list' ) AND NOT EXISTS ( SELECT 1 FROM `js_sys_menu` x WHERE x.`menu_code` = 'mesProductGlueDuration' ) ORDER BY m.`update_date` DESC LIMIT 1; INSERT INTO `js_sys_menu` ( `menu_code`, `parent_code`, `parent_codes`, `tree_sort`, `tree_sorts`, `tree_leaf`, `tree_level`, `tree_names`, `menu_name`, `menu_type`, `menu_href`, `menu_target`, `menu_icon`, `menu_color`, `menu_title`, `permission`, `weight`, `is_show`, `sys_code`, `module_codes`, `component`, `params`, `status`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks` ) SELECT 'mesProductGlueDurationEdit', 'mesProductGlueDuration', CONCAT(m.`parent_codes`, 'mesProductGlueDuration,'), 30, CONCAT(m.`tree_sorts`, '0000000030,'), '1', m.`tree_level` + 1, CONCAT(m.`tree_names`, '/编辑'), '编辑', '2', '', '', '', '', '', 'mes:mesProductGlueDuration:edit', 30, '1', IFNULL(m.`sys_code`, 'default'), IFNULL(m.`module_codes`, 'core'), NULL, NULL, '0', 'system', NOW(), 'system', NOW(), '' FROM `js_sys_menu` m WHERE m.`menu_code` = 'mesProductGlueDuration' AND NOT EXISTS ( SELECT 1 FROM `js_sys_menu` x WHERE x.`menu_code` = 'mesProductGlueDurationEdit' ) LIMIT 1;