-- mes_gp12_items 二级分类改造 + 外观判定标准初始数据
-- MySQL 5.7 无 IF NOT EXISTS 时，若列已存在可忽略报错后继续
ALTER TABLE mes_gp12_items ADD COLUMN category varchar(100) DEFAULT NULL COMMENT '一级分类' AFTER id;
ALTER TABLE mes_gp12_items ADD COLUMN sort int(11) DEFAULT 0 COMMENT '排序号' AFTER description;
ALTER TABLE mes_product_gp12 MODIFY COLUMN remark varchar(1000) DEFAULT NULL COMMENT '不良原因';

-- 清空旧配置后导入（若需保留旧数据请注释下一行）
DELETE FROM mes_gp12_items;

INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0001', '尺寸', NULL, '孔径超差', 1, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0002', '尺寸', NULL, '尺寸超差', 2, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0003', '二维码/镭射/丝印/刻印/压铸', NULL, '标识漏', 3, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0004', '二维码/镭射/丝印/刻印/压铸', NULL, '标识脏污、磨损、不清晰、', 4, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0005', '二维码/镭射/丝印/刻印/压铸', NULL, '标识位置偏', 5, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0006', '二维码/镭射/丝印/刻印/压铸', NULL, '标识错', 6, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0007', '二维码/镭射/丝印/刻印/压铸', NULL, '扫码信息错误', 7, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0008', '外观', NULL, '型材变形', 8, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0009', '外观', NULL, '划伤/划痕/磕碰伤', 9, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0010', '外观', NULL, '涂胶残胶/漏涂/色差/不均匀/不固化', 10, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0011', '外观', NULL, '漏抛光/打磨', 11, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0012', '外观', NULL, '脏污/色差', 12, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0013', '外观', NULL, '铝屑', 13, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0014', '外观', NULL, '水管保护套漏装', 14, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0015', '外观', NULL, '水管保护套异物', 15, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0016', '外观', NULL, '水管磕碰伤', 16, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0017', '外观', NULL, '挡水墙打磨/变形', 17, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0018', '外观', NULL, 'PC片漏/偏位', 18, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0019', '焊接缺陷', NULL, '漏焊', 19, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0020', '焊接缺陷', NULL, '错焊', 20, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0021', '焊接缺陷', NULL, '焊渣', 21, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0022', '焊接缺陷', NULL, '焊烟', 22, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0023', '焊接缺陷', NULL, '毛刺', 23, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0024', '焊接缺陷', NULL, '焊缝开裂', 24, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0025', '焊接缺陷', NULL, '焊缝间隙', 25, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0026', '焊接缺陷', NULL, '焊缝气孔', 26, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0027', '焊接缺陷', NULL, '焊缝烧穿、咬边', 27, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0028', '焊接缺陷', NULL, '焊缝背透', 28, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0029', '焊接缺陷', NULL, '焊缝漏焊', 29, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0030', '焊接缺陷', NULL, '焊缝长度短', 30, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0031', '焊接缺陷', NULL, '焊缝弧坑', 31, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0032', '焊接缺陷', NULL, '焊缝偏位', 32, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0033', '铆接', NULL, '漏', 33, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0034', '铆接', NULL, '错（位置错、型号错）', 34, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0035', '铆接', NULL, '牙尾（未敲、未清理）', 35, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0036', '铆接', NULL, '铆钉突出', 36, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0037', '铆接', NULL, '扭矩不满足', 37, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0038', '铆接', NULL, '间隙大', 38, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0039', '液冷板', NULL, '漏底', 39, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0040', '液冷板', NULL, '水嘴残漆', 40, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0041', '液冷板', NULL, '凹坑', 41, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0042', '液冷板', NULL, '凸点(颗粒）', 42, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0043', '液冷板', NULL, '划伤划痕', 44, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0044', '液冷板', NULL, '脏污、胶渍', 45, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0045', '液冷板', NULL, '流挂、肥边', 46, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0046', '液冷板', NULL, '翻边、边缘披风、毛刺', 47, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0047', '液冷板', NULL, '产品绝缘面补漆（自喷漆或绝缘膏）', 48, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0048', '液冷板', NULL, '安装孔毛刺飞边', 49, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0049', '液冷板', NULL, '打码处遮蔽', 50, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0050', '液冷板', NULL, '气泡颗粒', 51, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0051', '液冷板', NULL, '缩孔', 52, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0052', '底护板', NULL, '色差', 53, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0053', '底护板', NULL, '磕伤', 54, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0054', '底护板', NULL, '压痕/擦伤', 55, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0055', '底护板', NULL, '划痕、划伤', 57, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0056', '底护板', NULL, 'PVC 缩孔', 58, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0057', '底护板', NULL, 'PVC 表面脏污', 59, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0058', '底护板', NULL, '凹坑/气孔', 60, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0059', '底护板', NULL, '水渍/水印', 61, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0060', '底护板', NULL, '开裂、起皮', 62, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0061', '底护板', NULL, '变形', 63, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0062', '底护板', NULL, 'PVC瘤', 64, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0063', '底护板', NULL, '安装孔外观', 65, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0064', '底护板', NULL, 'PVC喷涂涂层偏薄', 66, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0065', '底护板', NULL, '残胶、麻点', 67, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0066', '底护板', NULL, '孔到边缘处PVC未覆盖', 68, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0067', '底护板', NULL, '孔边缘PVC偏薄', 69, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
INSERT INTO mes_gp12_items (id, category, res_oprno, description, sort, create_by, create_date, update_by, update_date) VALUES ('gp12item0068', '其他', NULL, '其他', 70, 'system', '2026-08-12 20:20:00', 'system', '2026-08-12 20:20:00');
