units 与 tmp_units 中的「件」项移除,@u_bj_jian / @u_wh_jian 变量随之 删除;物料 base_unit_id 原指向「件」的改指 @u_wh_pcs。后端默认单位 列表 defaultMaterialUnits 同步移除「件」。 经隔离库验证:init.sql 完整跑通,materials 199 条,units 中已无「件」。
2237 lines
172 KiB
SQL
2237 lines
172 KiB
SQL
-- WMMS fresh schema for MySQL 8.0. Executed once for an empty Docker volume.
|
||
-- SET NAMES must come first: the mysql client that runs this file may default to
|
||
-- latin1, which would mangle every Chinese literal below into mojibake.
|
||
SET NAMES utf8mb4;
|
||
CREATE DATABASE IF NOT EXISTS wmms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||
USE wmms;
|
||
|
||
CREATE TABLE users (id BIGINT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, description VARCHAR(500) NOT NULL DEFAULT '', created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE organizations (id BIGINT AUTO_INCREMENT PRIMARY KEY, code VARCHAR(50) NOT NULL UNIQUE, name VARCHAR(200) NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'active', default_timezone VARCHAR(64) NOT NULL DEFAULT 'Asia/Shanghai', created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE roles (id BIGINT AUTO_INCREMENT PRIMARY KEY, code VARCHAR(80) NOT NULL UNIQUE, name VARCHAR(100) NOT NULL, enabled BOOLEAN NOT NULL DEFAULT TRUE, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE permissions (id BIGINT AUTO_INCREMENT PRIMARY KEY, code VARCHAR(120) NOT NULL UNIQUE, name VARCHAR(150) NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE role_permissions (role_id BIGINT NOT NULL, permission_id BIGINT NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(role_id,permission_id), FOREIGN KEY(role_id) REFERENCES roles(id) ON DELETE CASCADE, FOREIGN KEY(permission_id) REFERENCES permissions(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE user_roles (user_id BIGINT NOT NULL, role_id BIGINT NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(user_id,role_id), FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY(role_id) REFERENCES roles(id) ON DELETE RESTRICT) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE user_organizations (user_id BIGINT NOT NULL, organization_id BIGINT NOT NULL, is_default BOOLEAN NOT NULL DEFAULT FALSE, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, default_user_id BIGINT GENERATED ALWAYS AS (CASE WHEN is_default THEN user_id ELSE NULL END) VIRTUAL, UNIQUE KEY uk_user_organizations_default(default_user_id), PRIMARY KEY(user_id,organization_id), FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY(organization_id) REFERENCES organizations(id) ON DELETE RESTRICT) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE revoked_tokens (jti VARCHAR(64) PRIMARY KEY, user_id BIGINT NOT NULL, expires_at DATETIME NOT NULL, revoked_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY idx_revoked_tokens_expires_at(expires_at), FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE material_types (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, code VARCHAR(50) NOT NULL, name VARCHAR(100) NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'active', UNIQUE KEY uk_material_types_org_code(organization_id,code), FOREIGN KEY(organization_id) REFERENCES organizations(id) ON DELETE RESTRICT) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE material_categories (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, code VARCHAR(50) NOT NULL, name VARCHAR(100) NOT NULL, description VARCHAR(1000) NOT NULL DEFAULT '', parent_id BIGINT NULL, status VARCHAR(20) NOT NULL DEFAULT 'active', UNIQUE KEY uk_material_categories_org_code(organization_id,code), FOREIGN KEY(organization_id) REFERENCES organizations(id) ON DELETE RESTRICT, FOREIGN KEY(parent_id) REFERENCES material_categories(id) ON DELETE RESTRICT) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE units (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, code VARCHAR(50) NOT NULL, name VARCHAR(100) NOT NULL, precision_scale TINYINT NOT NULL DEFAULT 0, status VARCHAR(20) NOT NULL DEFAULT 'active', UNIQUE KEY uk_units_org_code(organization_id,code), FOREIGN KEY(organization_id) REFERENCES organizations(id) ON DELETE RESTRICT) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE materials (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, material_code VARCHAR(50) NOT NULL, name VARCHAR(200) NOT NULL, material_image VARCHAR(500), spec VARCHAR(200), manufacturer_model VARCHAR(200), source VARCHAR(20) NULL COMMENT '物料来源:外购或外协', remark VARCHAR(500) NULL COMMENT '物料备注,最多500字', supplier_id BIGINT NULL COMMENT 'Default supplier organization_partner ID', manufacturer_id BIGINT NULL COMMENT 'Manufacturer organization_partner ID', material_type_id BIGINT, category_id BIGINT NOT NULL, base_unit_id BIGINT, unit VARCHAR(20), status VARCHAR(20) NOT NULL DEFAULT 'active', version INT NOT NULL DEFAULT 1, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY uk_materials_org_code(organization_id,material_code), KEY idx_materials_category(category_id), FOREIGN KEY(organization_id) REFERENCES organizations(id) ON DELETE RESTRICT, FOREIGN KEY(material_type_id) REFERENCES material_types(id) ON DELETE RESTRICT, FOREIGN KEY(category_id) REFERENCES material_categories(id) ON DELETE RESTRICT, FOREIGN KEY(base_unit_id) REFERENCES units(id) ON DELETE RESTRICT) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE code_rules (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, category_id BIGINT NOT NULL, prefix VARCHAR(30) NOT NULL, sequence_length TINYINT NOT NULL, next_sequence BIGINT NOT NULL DEFAULT 1, status VARCHAR(20) NOT NULL DEFAULT 'active', UNIQUE KEY uk_code_rules_org_category(organization_id,category_id), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(category_id) REFERENCES material_categories(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE material_import_logs (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, operator VARCHAR(100) NOT NULL, file_name VARCHAR(255) NOT NULL, total_rows INT NOT NULL DEFAULT 0, success_rows INT NOT NULL DEFAULT 0, failed_rows INT NOT NULL DEFAULT 0, status VARCHAR(20) NOT NULL, failure_reason VARCHAR(1000) NOT NULL DEFAULT '', created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY idx_material_import_logs_org_created(organization_id,created_at), FOREIGN KEY(organization_id) REFERENCES organizations(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE material_unit_conversions (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, material_id BIGINT NOT NULL, from_unit_id BIGINT NOT NULL, to_unit_id BIGINT NOT NULL, conversion_rate DECIMAL(20,6) NOT NULL, effective_from DATE NOT NULL, effective_to DATE NULL, KEY idx_material_unit_conversions_material(organization_id,material_id), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(material_id) REFERENCES materials(id), FOREIGN KEY(from_unit_id) REFERENCES units(id), FOREIGN KEY(to_unit_id) REFERENCES units(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE tags (id BIGINT AUTO_INCREMENT PRIMARY KEY, material_id BIGINT NOT NULL, tag_code VARCHAR(100) NOT NULL UNIQUE, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY idx_tags_material(material_id), FOREIGN KEY(material_id) REFERENCES materials(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE business_partners (id BIGINT AUTO_INCREMENT PRIMARY KEY, legal_name VARCHAR(200) NOT NULL, unified_credit_code VARCHAR(50) UNIQUE, contact_name VARCHAR(100), contact_phone VARCHAR(50), address VARCHAR(500), created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
-- Partner categories support selecting material and finished_product together;
|
||
-- an empty set means unclassified. Both fields are created with the table.
|
||
CREATE TABLE organization_partners (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, business_partner_id BIGINT NOT NULL, partner_code VARCHAR(50) NOT NULL, is_supplier BOOLEAN NOT NULL DEFAULT FALSE, is_manufacturer BOOLEAN NOT NULL DEFAULT FALSE, is_customer BOOLEAN NOT NULL DEFAULT FALSE, supplier_status VARCHAR(20), supplier_categories SET('material','finished_product') NOT NULL DEFAULT '', customer_status VARCHAR(20), customer_categories SET('material','finished_product') NOT NULL DEFAULT '', settlement_currency CHAR(3), payment_terms VARCHAR(200), created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY uk_organization_partners_org_id(organization_id,id), UNIQUE KEY uk_organization_partners_org_partner(organization_id,business_partner_id), UNIQUE KEY uk_organization_partners_org_code(organization_id,partner_code), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(business_partner_id) REFERENCES business_partners(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
-- Partner references must belong to the same organization as the material.
|
||
ALTER TABLE materials
|
||
ADD KEY idx_materials_org_supplier(organization_id,supplier_id),
|
||
ADD KEY idx_materials_org_manufacturer(organization_id,manufacturer_id),
|
||
ADD CONSTRAINT fk_materials_supplier FOREIGN KEY(organization_id,supplier_id) REFERENCES organization_partners(organization_id,id) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||
ADD CONSTRAINT fk_materials_manufacturer FOREIGN KEY(organization_id,manufacturer_id) REFERENCES organization_partners(organization_id,id) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||
CREATE TABLE material_suppliers (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, material_id BIGINT NOT NULL, organization_partner_id BIGINT NOT NULL, price DECIMAL(20,6) NOT NULL, currency CHAR(3) NOT NULL, minimum_order_quantity DECIMAL(20,6) NOT NULL DEFAULT 0, lead_time_days INT NOT NULL DEFAULT 0, is_preferred BOOLEAN NOT NULL DEFAULT FALSE, effective_from DATE NOT NULL, effective_to DATE, status VARCHAR(20) NOT NULL DEFAULT 'active', KEY idx_material_suppliers_material(organization_id,material_id), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(material_id) REFERENCES materials(id), FOREIGN KEY(organization_partner_id) REFERENCES organization_partners(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE warehouses (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, code VARCHAR(50) NOT NULL, name VARCHAR(150) NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'active', created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY uk_warehouses_org_code(organization_id,code), UNIQUE KEY uk_warehouses_organization(organization_id), FOREIGN KEY(organization_id) REFERENCES organizations(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE warehouse_locations (id BIGINT AUTO_INCREMENT PRIMARY KEY, warehouse_id BIGINT NOT NULL, code VARCHAR(50) NOT NULL, name VARCHAR(150) NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'active', created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY uk_warehouse_locations_warehouse_code(warehouse_id,code), UNIQUE KEY uk_warehouse_locations_warehouse(warehouse_id), FOREIGN KEY(warehouse_id) REFERENCES warehouses(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE user_warehouses (user_id BIGINT NOT NULL, warehouse_id BIGINT NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(user_id,warehouse_id), FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY(warehouse_id) REFERENCES warehouses(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE inventory_balances (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, warehouse_id BIGINT NOT NULL, location_id BIGINT NOT NULL, material_id BIGINT NOT NULL, on_hand DECIMAL(20,6) NOT NULL DEFAULT 0, reserved DECIMAL(20,6) NOT NULL DEFAULT 0, locked DECIMAL(20,6) NOT NULL DEFAULT 0, in_transit DECIMAL(20,6) NOT NULL DEFAULT 0, version INT NOT NULL DEFAULT 1, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY uk_inventory_balance_dimension(organization_id,warehouse_id,location_id,material_id), KEY idx_inventory_balances_material(organization_id,material_id), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(warehouse_id) REFERENCES warehouses(id), FOREIGN KEY(location_id) REFERENCES warehouse_locations(id), FOREIGN KEY(material_id) REFERENCES materials(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE stock_warning_rules (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, warehouse_id BIGINT NOT NULL, material_id BIGINT NOT NULL, minimum_available DECIMAL(20,6) NOT NULL DEFAULT 0, enabled BOOLEAN NOT NULL DEFAULT TRUE, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY uk_stock_warning_rules_dimension(organization_id,warehouse_id,material_id), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(warehouse_id) REFERENCES warehouses(id), FOREIGN KEY(material_id) REFERENCES materials(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE inbound_orders (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, warehouse_id BIGINT NOT NULL, location_id BIGINT NOT NULL, inbound_no VARCHAR(32) UNIQUE, operator VARCHAR(100), inbound_date DATETIME NOT NULL, handler VARCHAR(100) NOT NULL, supplier VARCHAR(200), remark TEXT, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY idx_inbound_orders_date(inbound_date), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(warehouse_id) REFERENCES warehouses(id), FOREIGN KEY(location_id) REFERENCES warehouse_locations(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE inbound_items (id BIGINT AUTO_INCREMENT PRIMARY KEY, inbound_order_id BIGINT NOT NULL, material_id BIGINT NOT NULL, quantity INT NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY idx_inbound_items_order(inbound_order_id), FOREIGN KEY(inbound_order_id) REFERENCES inbound_orders(id) ON DELETE CASCADE, FOREIGN KEY(material_id) REFERENCES materials(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE outbound_orders (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, warehouse_id BIGINT NOT NULL, location_id BIGINT NOT NULL, outbound_no VARCHAR(32) UNIQUE, operator VARCHAR(100), outbound_date DATETIME NOT NULL, handler VARCHAR(100) NOT NULL, receiver VARCHAR(100) NOT NULL, remark TEXT, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY idx_outbound_orders_date(outbound_date), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(warehouse_id) REFERENCES warehouses(id), FOREIGN KEY(location_id) REFERENCES warehouse_locations(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE outbound_items (id BIGINT AUTO_INCREMENT PRIMARY KEY, outbound_order_id BIGINT NOT NULL, material_id BIGINT NOT NULL, quantity INT NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY idx_outbound_items_order(outbound_order_id), FOREIGN KEY(outbound_order_id) REFERENCES outbound_orders(id) ON DELETE CASCADE, FOREIGN KEY(material_id) REFERENCES materials(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE material_logs (id BIGINT AUTO_INCREMENT PRIMARY KEY, operation_type VARCHAR(50) NOT NULL, material_id BIGINT NOT NULL, operator_id BIGINT NULL, old_value TEXT, new_value TEXT, operator VARCHAR(100), description TEXT, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY idx_material_logs_material(material_id), KEY idx_material_logs_operator(operator_id), FOREIGN KEY(material_id) REFERENCES materials(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE stock_logs (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, warehouse_id BIGINT NOT NULL, location_id BIGINT NOT NULL, KEY idx_stock_logs_org_material_created(organization_id,material_id,created_at), FOREIGN KEY(organization_id) REFERENCES organizations(id), FOREIGN KEY(warehouse_id) REFERENCES warehouses(id), FOREIGN KEY(location_id) REFERENCES warehouse_locations(id), material_id BIGINT NOT NULL, type ENUM('in','out') NOT NULL, quantity INT NOT NULL, related_order_type VARCHAR(50) NOT NULL, related_order_id BIGINT NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY idx_stock_logs_material(material_id), KEY idx_stock_logs_related_order(related_order_type,related_order_id), FOREIGN KEY(material_id) REFERENCES materials(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE material_applications (id BIGINT AUTO_INCREMENT PRIMARY KEY, organization_id BIGINT NOT NULL, KEY idx_material_applications_org_user_created(organization_id,user_id,created_at), KEY idx_material_applications_org_status_created(organization_id,status,created_at), FOREIGN KEY(organization_id) REFERENCES organizations(id), user_id BIGINT NOT NULL, purpose VARCHAR(500) NOT NULL DEFAULT '', status ENUM('pending','approved','rejected','cancelled') NOT NULL DEFAULT 'pending', rejection_reason VARCHAR(500) NOT NULL DEFAULT '', approved_by BIGINT NOT NULL DEFAULT 0, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FOREIGN KEY(user_id) REFERENCES users(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE application_items (id BIGINT AUTO_INCREMENT PRIMARY KEY, application_id BIGINT NOT NULL, material_id BIGINT NOT NULL, quantity INT NOT NULL, FOREIGN KEY(application_id) REFERENCES material_applications(id) ON DELETE CASCADE, FOREIGN KEY(material_id) REFERENCES materials(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
|
||
CREATE TABLE IF NOT EXISTS schema_migrations (
|
||
version VARCHAR(100) PRIMARY KEY, status VARCHAR(20) NOT NULL,
|
||
started_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, completed_at DATETIME NULL,
|
||
details JSON NOT NULL
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE IF NOT EXISTS schema_migration_reconciliations (
|
||
version VARCHAR(100) NOT NULL, phase VARCHAR(10) NOT NULL, organization_id BIGINT NOT NULL,
|
||
on_hand DECIMAL(30,6) NOT NULL, reserved DECIMAL(30,6) NOT NULL, locked DECIMAL(30,6) NOT NULL,
|
||
in_transit DECIMAL(30,6) NOT NULL, inbound_count BIGINT NOT NULL, outbound_count BIGINT NOT NULL,
|
||
application_count BIGINT NOT NULL, stock_log_count BIGINT NOT NULL, captured_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY(version,phase,organization_id), FOREIGN KEY(organization_id) REFERENCES organizations(id)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
CREATE TABLE organization_audit_logs (
|
||
id BIGINT AUTO_INCREMENT PRIMARY KEY,actor_user_id BIGINT NOT NULL,organization_id BIGINT NULL,
|
||
action VARCHAR(100) NOT NULL,old_value JSON NULL,new_value JSON NULL,created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
KEY idx_organization_audit_org_created(organization_id,created_at),KEY idx_organization_audit_actor_created(actor_user_id,created_at),
|
||
FOREIGN KEY(actor_user_id) REFERENCES users(id),FOREIGN KEY(organization_id) REFERENCES organizations(id)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
|
||
INSERT INTO schema_migrations(version,status,completed_at,details) VALUES('2026-10-08-company-master-data-isolation','completed',NOW(),JSON_OBJECT('version','2026-10-08-company-master-data-isolation','source','fresh-init'));
|
||
|
||
INSERT INTO schema_migrations(version,status,completed_at,details) VALUES('2026-10-10-material-bulk-import','completed',NOW(),JSON_OBJECT('version','2026-10-10-material-bulk-import','source','fresh-init'));
|
||
|
||
INSERT INTO schema_migrations(version,status,completed_at,details) VALUES('2026-10-12-material-partner-roles','completed',NOW(),JSON_OBJECT('version','2026-10-12-material-partner-roles','source','fresh-init'));
|
||
|
||
INSERT INTO schema_migrations(version,status,completed_at,details) VALUES('2026-10-14-material-source-remark','completed',NOW(),JSON_OBJECT('version','2026-10-14-material-source-remark','source','fresh-init'));
|
||
|
||
INSERT INTO schema_migrations(version,status,completed_at,details) VALUES('2026-10-14-material-log-operator-id','completed',NOW(),JSON_OBJECT('version','2026-10-14-material-log-operator-id','source','fresh-init'));
|
||
|
||
INSERT INTO organizations (id,code,name,status) VALUES (1,'DEFAULT','北京','active');
|
||
-- 每个公司各有一整套物料单位(单位在后端按公司隔离,物料只能引用本公司的单位)。
|
||
-- 计数、包装使用整数,重量、容量、长度、面积保留 3 位小数。
|
||
INSERT INTO units (organization_id,code,name,precision_scale,status) VALUES
|
||
(1,'个','个',0,'active'),
|
||
(1,'只','只',0,'active'),
|
||
(1,'支','支',0,'active'),
|
||
(1,'根','根',0,'active'),
|
||
(1,'条','条',0,'active'),
|
||
(1,'片','片',0,'active'),
|
||
(1,'张','张',0,'active'),
|
||
(1,'套','套',0,'active'),
|
||
(1,'台','台',0,'active'),
|
||
(1,'对','对',0,'active'),
|
||
(1,'双','双',0,'active'),
|
||
(1,'包','包',0,'active'),
|
||
(1,'袋','袋',0,'active'),
|
||
(1,'盒','盒',0,'active'),
|
||
(1,'箱','箱',0,'active'),
|
||
(1,'瓶','瓶',0,'active'),
|
||
(1,'罐','罐',0,'active'),
|
||
(1,'桶','桶',0,'active'),
|
||
(1,'卷','卷',0,'active'),
|
||
(1,'块','块',0,'active'),
|
||
(1,'Pcs','件',0,'active'),
|
||
(1,'g','克',3,'active'),
|
||
(1,'kg','千克',3,'active'),
|
||
(1,'t','吨',3,'active'),
|
||
(1,'mL','毫升',3,'active'),
|
||
(1,'L','升',3,'active'),
|
||
(1,'m³','立方米',3,'active'),
|
||
(1,'mm','毫米',3,'active'),
|
||
(1,'cm','厘米',3,'active'),
|
||
(1,'m','米',3,'active'),
|
||
(1,'m²','平方米',3,'active');
|
||
INSERT INTO roles (code,name) VALUES ('super_admin','超级管理员'),('warehouse_admin','仓库管理员'),('purchaser','采购人员'),('technician','技术人员'),('production','生产人员'),('sales','销售人员');
|
||
INSERT INTO permissions (code,name) VALUES ('master.material.read','查看物料'),('master.material.write','维护物料'),('master.config.write','维护物料基础配置'),('organization.read','查看公司组织'),('organization.write','维护公司组织'),('organization.user.write','维护用户'),('organization.role.write','维护角色与权限'),('partner.supplier.read','查看供应商'),('partner.supplier.write','维护供应商'),('partner.customer.read','查看客户'),('partner.customer.write','维护客户'),('inventory.stock.read','查看库存'),('inventory.warning.write','维护库存预警'),('inventory.inbound.write','维护入库'),('inventory.outbound.write','维护出库');
|
||
INSERT INTO role_permissions (role_id,permission_id) SELECT r.id,p.id FROM roles r CROSS JOIN permissions p WHERE r.code='super_admin';
|
||
INSERT INTO material_types (organization_id,code,name) VALUES (1,'raw_material','原材料'),(1,'semi_finished','半成品'),(1,'finished_good','成品'),(1,'consumable','耗材'),(1,'service','服务');
|
||
-- Category tree: 6 majors (code A-F) + 28 subcategories (code A01-F05).
|
||
INSERT INTO material_categories (organization_id,code,name,description) VALUES
|
||
(1,'A','机械结构类','遵循通用分级规则:零加工外购标准件 → 零加工外购成品件 → 外购原料简易加工 → 深度定制加工件 → 本类兜底。纯机械传动件纳入本类管理。'),
|
||
(1,'B','电气元器件类','遵循通用分级规则:零加工外购标准成品 → 外购原料简易加工 → 单项工艺定制加工 → 多工艺集成组装件 → 本类兜底。带电气接口、电控功能的电机、电动部件统一归入本类;外购卷材/长条电气件,现场裁剪使用的纳入简易加工子类。'),
|
||
(1,'C','产品工艺耗材类','按使用场景划分,仅收录装配在设备内部、随产品出厂的专用耗材,全部为外购成品;车间通用清洁、劳保、运维耗材不纳入本类。'),
|
||
(1,'D','软件&固件&授权类','收录设备内置运行、随产品交付的程序、授权介质、使用许可,属于无形资产及配套实体载体,无物理加工环节。'),
|
||
(1,'E','半成品&成品类','按产品装配阶段划分,为多类零部件组合而成的装配体,是BOM顶层节点;仅区分半成品、成品两类。'),
|
||
(1,'F','包材类','本类统一收纳不参与设备核心功能运行、不属于机身核心的物料,仅作为产品配套、合规、交付附属物件。包含附着机身的标识、随机资料、整套包装物料、交付工具等配套物资,全部随整机出厂交付,不影响设备核心功能实现。');
|
||
INSERT INTO material_categories (organization_id,code,name,description) VALUES
|
||
(1,'A01','标准件','1.核心定义:国家/行业通用标准化零件,型号固定,无需绘图、无需任何二次加工。 2.包含说明:设备通用紧固、锁紧、防松类标准配件,采用全行业通用规格,无非标改造。 3.现场举例:内六角螺钉、沉头螺钉、组合螺钉、六角螺母、平垫圈、弹簧垫圈、防松垫片、六角铜螺柱。 4.边界区分:国标通用紧固配件统一归此类;非标定制紧固结构件归入 A04。'),
|
||
(1,'A02','成品件','1.核心定义:工业标准成品件,整件采购到货,无需裁切、折弯、切削、焊接等二次加工,可直接装配使用。 2.包含说明:设备通用机械辅助成品、纯机械传动成品件,自带标准型号,无需图纸定制。 3.现场举例:脚轮、磁铁、设备防护罩、标准导轨、丝杆、轴承、同步轮、同步带。 4.边界区分:完整成品无需加工归A02;原材料需裁切加工归A03。'),
|
||
(1,'A03','简易加工件','1.核心定义:采购标准定尺长条原料,仅做断料、裁切、简单打孔,无车铣、折弯、焊接、异形精密深加工。 2.包含说明:机架、框架类基础原料件,仅做简单下料、简易开孔处理。 3.现场举例:工业铝型材、方管、圆管、槽钢、角钢、实心棒材裁切下料件。 4.边界区分:长条原料简易裁切归A03;成品整件直接使用=A02;异形精密切削成型=A04。'),
|
||
(1,'A04','精密加工件','1.核心定义:金属厚料基材,通过CNC车、铣、钻、镗、削精密成型的非标结构件,包含金属研发手板、非标传动结构件。 2.包含说明:异形结构、精密配合、运动连接、承重支撑类金属定制件。 3.现场举例:设备金属板、安装转接板、支撑柱、旋转支架、非标机械连杆、金属CNC手板。 4.边界区分:厚料、切削工艺归A04;金属薄板折弯、焊接成型归A05。'),
|
||
(1,'A05','钣金件','1.核心定义:金属薄板基材,通过折弯、冲压、焊接、开孔成型的板类结构件,包含钣金研发手板。 2.包含说明:设备外壳基材、层板、机架、屏蔽防护类钣金件。 3.现场举例:金属层板、屏蔽罩、钢架、侧板、钣金支架、薄板折弯手板。 4.边界区分:薄板基材、折弯/焊接/冲压为主工艺归A05;厚料异形精密切削工艺归A04。'),
|
||
(1,'A06','塑胶件','1.核心定义:纯塑胶材质结构件、外观件,涵盖注塑量产件、3D打印/CNC/复模研发手板。 2.包含说明:塑胶防护、外观、支撑、壳体类零件,不区分生产工艺与阶段。 3.现场举例:灯罩、灯带支座、设备外壳、扶手蒙皮、塑胶3D打印手板。 4.边界区分:所有纯塑胶结构件统一归此类;手板与量产件通过系统属性标注区分。'),
|
||
(1,'A07','其他','1.核心定义:以上子类无法精准归类的小众机械零件。 2.包含说明:冷门机械辅件、非标小连接件。 3.现场举例:碟形弹簧、小型非标结构件。 4.边界区分:A01-A06无法匹配的机械类物料,全部归入此类。'),
|
||
(1,'B01','成品件','1.核心定义:市面标准电气成品、模块、电动部件,整件采购,无需出图、加工、组装,可直接装配。 2.包含说明:开关、电源、端子、标准线材、工控模块、各类电机及电动执行件。 3.现场举例:急停按钮、船型开关、温控开关、磁环、接线端子、冷压端子、开关电源、UPS、触摸显示器、工控机、IO扩展模块、标准网线、串口线、伺服电机、步进电机。 4.边界区分:无定制、无加工的标准电气成品、电动件全部归此类;需现场裁剪的长条电气件归入B02。'),
|
||
(1,'B02','简易加工件','1.核心定义:采购长条、卷材类标准电气原料,到货后仅做裁剪、分段等简单加工,无焊接、改板、接线等深度作业。 2.包含说明:通用长条灯条、连续式灯带、长距离线缆等,按装配尺寸现场裁切使用。 3.现场举例:整机外购标准灯条、长条形灯带,根据安装长度裁剪分段。 4.边界区分:仅做裁剪、分段的长条/卷材电气原料归B02;完整成品电气件归B01;需制板、压接定制的物料归入后续子类。'),
|
||
(1,'B03','PCB硬板','1.核心定义:依据我方PCB图纸,外协加工的硬质电路板,含贴片、插件成品板。 2.包含说明:自研主控板、驱动板、接口板等硬质功能板卡。 3.现场举例:主控灯带控制板、从控灯带控制板、各类自研PCB板卡。 4.边界区分:仅单纯PCB板加工,无外部其他器件装配。'),
|
||
(1,'B04','FPC软板','1.核心定义:依据图纸,外协定制的FPC软板、柔性排线。 2.包含说明:设备活动连接、弯折部位专用柔性电路件。 3.现场举例:设备关节连接软板、显示模组柔性排线。 4.边界区分:柔性线路板归B04;硬质PCB板归入B03。'),
|
||
(1,'B05','线束','1.核心定义:依据线表、线序、长度要求,外协裁切、压接、编组的专用非标线束。 2.包含说明:设备专用成套线缆、定制线组。 3.现场举例:定制线缆、LM系列专用线束。 4.边界区分:纯线材外协压接编组加工,无板卡、器件组装。'),
|
||
(1,'B06','组装组件','1.核心定义:我方提供图纸、电路图、BOM、装配工艺,外协完成板卡、线束、电气件整体组装、接线、调试后整件来料的集成组件。 2.包含说明:PCB、软板、线材、电动件组合而成的集成电气装配体。 3.现场举例:PCB板+柔性线路板+电机+配套线材集成组件。 4.边界区分:多品类电气件集成装配体归此类;单一板卡、单一线束分别归入对应子类。'),
|
||
(1,'B07','其他','1.核心定义:以上子类无法归类的小众电气配件、特殊电子元件。 2.包含说明:冷门电气辅件、非主流功能元件。 3.现场举例:B01-B06无法匹配的电气类物料,统一归入此类。'),
|
||
(1,'C01','连接耗材','1.核心定义:设备接线、装配过程使用,最终留存于产品内部的辅材。 2.包含说明:线路防护、绝缘、粘接类耗材。 3.现场举例:热缩管、梅花管、绝缘护套、设备专用粘接剂。 4.边界区分:仅产品内置装配耗材归此类。'),
|
||
(1,'C02','密封耗材','1.核心定义:用于设备密封、防尘、防水,装配后随产品交付的耗材。 2.包含说明:各类密封垫圈、专用密封油脂、防护填充材料。 3.现场举例:设备密封胶圈、腔体密封脂。 4.边界区分:设备本体密封耗材归此类;生产设备运维耗材不纳入。'),
|
||
(1,'C03','其他','1.核心定义:以上子类无法归类、随产品出厂的小众工艺耗材。 2.包含说明:本类仅收纳产品内置耗材,通用车间耗材一律排除。'),
|
||
(1,'D01','自研程序固件','1.核心定义:企业自主开发,嵌入设备硬件、保障设备核心运行的嵌入式固件、上位机控制程序。 2.包含说明:设备下位机固件、定制控制程序、专用驱动程序。 3.现场举例:设备主控固件、人机界面程序、运动控制程序。 4.边界区分:自主研发、设备必备的程序归此类;办公、设计类软件不纳入。'),
|
||
(1,'D02','外购软件授权','1.核心定义:外部采购,设备运行必需的第三方商用软件、正版使用许可。 2.包含说明:设备配套第三方控制软件、功能组件、永久/阶段性使用授权。 3.现场举例:第三方算法软件、配套组态软件、软件使用授权证书。 4.边界区分:参与设备功能实现的外购软件及授权归此类。'),
|
||
(1,'D03','授权介质','1.核心定义:承载软件、设备授权的实物硬件,随整机配套交付。 2.包含说明:软件加密锁、设备身份密钥等硬件载体。 3.现场举例:软件加密狗、专用授权密钥硬件。 4.边界区分:仅产品配套的授权硬件归此类。'),
|
||
(1,'D04','其他','1.核心定义:以上子类无法归类的配套程序组件、临时授权、辅助文档。 2.包含说明:软件、授权相关杂项统一归入此类。'),
|
||
(1,'E01','成品','1.核心定义:完成全部装配、调试、检验,可直接对外交付的有源医疗器械整机。 2.包含说明:公司主营各类完整诊疗设备。 3.现场举例:眼科手术控制系统、主控制台、从控制台整机。 4.边界区分:最终交付整机产品归此类。'),
|
||
(1,'E02','半成品','1.核心定义:由多类零部件装配而成,未完成最终整机装配,可流转至下道工序继续加工的中间组件。 2.包含说明:工序级装配体、模块级组合组件。 3.现场举例:控制台外壳组件、底座组件、运动机构组件、电子集成组件。 4.边界区分:非最终整机的组合装配体归此类。'),
|
||
(1,'F01','资料文档','1.核心定义:随整机配套交付的纸质/合规类技术文档、资质文件。 2.包含说明:产品使用、安装、维修、合规备案所需配套资料。 3.现场举例:产品说明书、操作手册、安装手册、维修手册、出厂合格证、检测报告。 4.边界区分:仅产品随货交付的正式资料文件归入此类;内部研发工艺资料不纳入BOM。'),
|
||
(1,'F02','标识标牌','1.核心定义:附着、固定在设备机身表面,用于合规标示、参数说明、警示提示的标识类物件。 2.包含说明:设备铭牌、参数标签、警示标贴、功能标识、规格标牌。 3.现场举例:机身金属铭牌、设备参数贴纸、安全警示标签、接口标识贴、合规标识牌。 4.边界区分:所有贴附/固定在产品本体的标识类物件统一归入此类,不再归入机械类。'),
|
||
(1,'F03','包装物料','1.核心定义:产品整机交付使用的外包装箱体、外壳及缓冲防护、填充类配套物料。 2.包含说明:定制航空箱、外包装箱体、防护外箱、内衬框架、缓冲泡棉、填充棉、防护内衬、减震包装辅材。 3.现场举例:设备定制航空箱、整机外包装箱、成型泡棉内衬、定位缓冲泡棉、防震填充辅料。 4.边界区分:所有产品专属包装、防护、减震填充物料全部归入此类。'),
|
||
(1,'F04','随机工具配件','1.核心定义:随产品整机交付给客户,供客户安装、调试、日常运维、拆装使用的小型工具、配套配件。 2.包含说明:设备专属交付工具、配套小配件,非设备本体结构件。 3.现场举例:随机内六角扳手、专用拆装工具、配套备用小配件。 4.边界区分:随货交付客户的工具归入此类;车间生产/自检自用工具、工装治具不纳入本BOM体系。'),
|
||
(1,'F05','其他','1.核心定义:以上子类无法归类、随产品交付的其余附属配套物料。 2.包含说明:本大类无对应子类的产品配套杂项,统一兜底归入。');
|
||
-- Subcategory codes are 3 chars (A01); their first letter is the major's code.
|
||
UPDATE material_categories AS c
|
||
JOIN material_categories AS p ON p.organization_id = c.organization_id AND p.code = LEFT(c.code, 1)
|
||
SET c.parent_id = p.id
|
||
WHERE c.organization_id = 1 AND CHAR_LENGTH(c.code) = 3 AND c.parent_id IS NULL;
|
||
-- Material number = subcategory code + 4-digit sequence; next_sequence is
|
||
-- "current max sequence + 1", so the next codes are A010201 / A020202 / B010203.
|
||
INSERT INTO code_rules (organization_id,category_id,prefix,sequence_length,next_sequence,status)
|
||
SELECT 1,c.id,c.code,4,CASE c.code WHEN 'A02' THEN 202 WHEN 'B01' THEN 203 ELSE 201 END,'active'
|
||
FROM material_categories c WHERE c.organization_id = 1 AND c.parent_id IS NOT NULL;
|
||
INSERT INTO warehouses (id,organization_id,code,name,status) VALUES (1,1,'DEFAULT','默认仓库','active');
|
||
INSERT INTO warehouse_locations (id,warehouse_id,code,name,status) VALUES (1,1,'MAIN','主库位','active');
|
||
|
||
-- Seed encoding is handled by SET NAMES utf8mb4 at the top of this file. The
|
||
-- previous latin1/BINARY round-trip repair is gone: it only produced correct
|
||
-- text when the client was latin1, and it corrupts (or destroys non-latin1
|
||
-- characters such as "→") when the client is already utf8mb4.
|
||
|
||
-- ============================================================================
|
||
-- 示例数据:客户、供应商。以下企业、联系人、电话及地址均为虚构,仅用于演示。
|
||
-- 共 20 家企业:8 家仅供应商、8 家仅客户、4 家同时具有两种身份。
|
||
-- 默认归属组织 ID 为 1;信用代码留空,伙伴编码以 DEMO- 开头。
|
||
-- 本段示例数据会跳过已有记录;init.sql 整体仍仅用于空库首次初始化。
|
||
-- ============================================================================
|
||
SET @demo_organization_id = 1;
|
||
|
||
DROP TEMPORARY TABLE IF EXISTS tmp_demo_partners_20261008;
|
||
CREATE TEMPORARY TABLE tmp_demo_partners_20261008 (
|
||
partner_code VARCHAR(50) NOT NULL PRIMARY KEY,
|
||
legal_name VARCHAR(200) NOT NULL,
|
||
contact_name VARCHAR(100) NOT NULL,
|
||
contact_phone VARCHAR(50) NOT NULL,
|
||
address VARCHAR(500) NOT NULL,
|
||
is_supplier BOOLEAN NOT NULL,
|
||
is_customer BOOLEAN NOT NULL,
|
||
supplier_status VARCHAR(20) NULL,
|
||
customer_status VARCHAR(20) NULL,
|
||
supplier_categories SET('material', 'finished_product') NOT NULL DEFAULT '',
|
||
customer_categories SET('material', 'finished_product') NOT NULL DEFAULT '',
|
||
payment_terms VARCHAR(200) NOT NULL
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
|
||
INSERT INTO tmp_demo_partners_20261008
|
||
(partner_code, legal_name, contact_name, contact_phone, address,
|
||
is_supplier, is_customer, supplier_status, customer_status,
|
||
supplier_categories, customer_categories, payment_terms)
|
||
VALUES
|
||
('DEMO-SUP-001', '示例·北京澄岳电子材料有限公司', '周明远', '010-0000-1001', '北京市海淀区示例路 18 号',
|
||
TRUE, FALSE, 'active', NULL, 'material', '', '验收后 30 天付款'),
|
||
('DEMO-SUP-002', '示例·武汉青岚精密部件有限公司', '林晓晴', '027-0000-1002', '武汉市洪山区示例大道 36 号',
|
||
TRUE, FALSE, 'active', NULL, 'material', '', '验收后 15 天付款'),
|
||
('DEMO-SUP-003', '示例·苏州星禾仪器贸易有限公司', '郑柏川', '0512-0000-1003', '苏州市工业园区示例街 52 号',
|
||
TRUE, FALSE, 'active', NULL, 'finished_product', '', '款到发货'),
|
||
('DEMO-SUP-004', '示例·深圳沐辰机电有限公司', '许知夏', '0755-0000-1004', '深圳市南山区示例路 9 号',
|
||
TRUE, FALSE, 'active', NULL, 'material,finished_product', '', '月结 30 天'),
|
||
('DEMO-SUP-005', '示例·成都锦栖包装材料有限公司', '唐思齐', '028-0000-1005', '成都市高新区示例街 27 号',
|
||
TRUE, FALSE, 'suspended', NULL, 'material', '', '预付 30%,验收后付尾款'),
|
||
('DEMO-SUP-006', '示例·南京云朔自动化设备有限公司', '宋景行', '025-0000-1006', '南京市江宁区示例大道 61 号',
|
||
TRUE, FALSE, 'pending', NULL, 'finished_product', '', '验收后 45 天付款'),
|
||
('DEMO-SUP-007', '示例·杭州珩远工业配套有限公司', '韩若溪', '0571-0000-1007', '杭州市滨江区示例路 43 号',
|
||
TRUE, FALSE, 'active', NULL, 'material,finished_product', '', '月结 60 天'),
|
||
('DEMO-SUP-008', '示例·天津启沅物资有限公司', '顾承宇', '022-0000-1008', '天津市西青区示例街 15 号',
|
||
TRUE, FALSE, 'eliminated', NULL, '', '', '款到发货'),
|
||
|
||
('DEMO-CUS-001', '示例·北京云帆研发技术有限公司', '沈沐阳', '010-0000-2001', '北京市昌平区示例大道 29 号',
|
||
FALSE, TRUE, NULL, 'active', '', 'material', '发货后 30 天收款'),
|
||
('DEMO-CUS-002', '示例·武汉卓溪智能装备有限公司', '蒋书宁', '027-0000-2002', '武汉市江夏区示例路 48 号',
|
||
FALSE, TRUE, NULL, 'active', '', 'finished_product', '预收 50%,交付后收尾款'),
|
||
('DEMO-CUS-003', '示例·上海禾川工业贸易有限公司', '何清越', '021-0000-2003', '上海市闵行区示例街 11 号',
|
||
FALSE, TRUE, NULL, 'active', '', 'material,finished_product', '月结 30 天'),
|
||
('DEMO-CUS-004', '示例·西安辰澜实验科技有限公司', '邵文轩', '029-0000-2004', '西安市高新区示例路 67 号',
|
||
FALSE, TRUE, NULL, 'active', '', 'material', '款到发货'),
|
||
('DEMO-CUS-005', '示例·长沙栩航设备经营有限公司', '叶星遥', '0731-0000-2005', '长沙市岳麓区示例大道 23 号',
|
||
FALSE, TRUE, NULL, 'suspended', '', 'finished_product', '验收后 30 天收款'),
|
||
('DEMO-CUS-006', '示例·济南清屿制造有限公司', '杜泽安', '0531-0000-2006', '济南市历城区示例街 39 号',
|
||
FALSE, TRUE, NULL, 'active', '', 'material,finished_product', '月结 45 天'),
|
||
('DEMO-CUS-007', '示例·郑州景禾商贸有限公司', '梁初瑶', '0371-0000-2007', '郑州市中原区示例路 56 号',
|
||
FALSE, TRUE, NULL, 'pending', '', 'finished_product', '预付全款'),
|
||
('DEMO-CUS-008', '示例·青岛若川技术服务有限公司', '陆嘉树', '0532-0000-2008', '青岛市崂山区示例大道 14 号',
|
||
FALSE, TRUE, NULL, 'inactive', '', '', '交付后 15 天收款'),
|
||
|
||
('DEMO-BOTH-001', '示例·北京知衡产业有限公司', '方予安', '010-0000-3001', '北京市大兴区示例路 72 号',
|
||
TRUE, TRUE, 'active', 'active', 'material', 'finished_product', '采购月结 30 天;销售预收 30%'),
|
||
('DEMO-BOTH-002', '示例·武汉观澜机电贸易有限公司', '程舒雅', '027-0000-3002', '武汉市东西湖区示例街 31 号',
|
||
TRUE, TRUE, 'active', 'active', 'material,finished_product', 'material,finished_product', '采购、销售均月结 30 天'),
|
||
('DEMO-BOTH-003', '示例·合肥映川智能科技有限公司', '贺景辰', '0551-0000-3003', '合肥市蜀山区示例大道 46 号',
|
||
TRUE, TRUE, 'suspended', 'active', 'finished_product', 'material', '采购款到发货;销售月结 45 天'),
|
||
('DEMO-BOTH-004', '示例·厦门沅禾工业服务有限公司', '白念慈', '0592-0000-3004', '厦门市集美区示例路 8 号',
|
||
TRUE, TRUE, 'active', 'pending', 'material', '', '采购验收后 15 天付款;销售预付全款');
|
||
|
||
START TRANSACTION;
|
||
|
||
-- 仅在目标组织存在时插入企业,避免错误组织 ID 产生无关联数据。
|
||
INSERT INTO business_partners
|
||
(legal_name, unified_credit_code, contact_name, contact_phone, address)
|
||
SELECT demo.legal_name, NULL, demo.contact_name, demo.contact_phone, demo.address
|
||
FROM tmp_demo_partners_20261008 demo
|
||
JOIN organizations org ON org.id = @demo_organization_id
|
||
WHERE NOT EXISTS (
|
||
SELECT 1 FROM business_partners existing WHERE existing.legal_name = demo.legal_name
|
||
);
|
||
|
||
-- 不硬编码自增 ID。重复运行时保留原关系及已编辑的分类、状态等数据。
|
||
INSERT INTO organization_partners
|
||
(organization_id, business_partner_id, partner_code, is_supplier, is_customer,
|
||
supplier_status, customer_status, supplier_categories, customer_categories,
|
||
settlement_currency, payment_terms)
|
||
SELECT org.id, partner.id, demo.partner_code, demo.is_supplier, demo.is_customer,
|
||
demo.supplier_status, demo.customer_status, demo.supplier_categories, demo.customer_categories,
|
||
'CNY', demo.payment_terms
|
||
FROM tmp_demo_partners_20261008 demo
|
||
JOIN organizations org ON org.id = @demo_organization_id
|
||
JOIN (
|
||
SELECT legal_name, MIN(id) AS id FROM business_partners GROUP BY legal_name
|
||
) partner ON partner.legal_name = demo.legal_name
|
||
WHERE NOT EXISTS (
|
||
SELECT 1 FROM organization_partners existing
|
||
WHERE existing.organization_id = org.id
|
||
AND (existing.business_partner_id = partner.id OR existing.partner_code = demo.partner_code)
|
||
);
|
||
|
||
COMMIT;
|
||
|
||
-- 检查导入结果;目标组织不存在时明确提示,并且不会插入任何数据。
|
||
SELECT @demo_organization_id AS organization_id,
|
||
CASE WHEN EXISTS (SELECT 1 FROM organizations WHERE id = @demo_organization_id)
|
||
THEN '目标组织存在,请核对下面的导入结果'
|
||
ELSE '目标组织不存在:未导入,请修改 @demo_organization_id 后重新执行'
|
||
END AS import_message;
|
||
|
||
SELECT op.partner_code, bp.legal_name, op.is_supplier, op.is_customer,
|
||
op.supplier_categories, op.customer_categories, op.supplier_status, op.customer_status
|
||
FROM organization_partners op
|
||
JOIN business_partners bp ON bp.id = op.business_partner_id
|
||
JOIN tmp_demo_partners_20261008 demo
|
||
ON demo.partner_code = op.partner_code AND demo.legal_name = bp.legal_name
|
||
WHERE op.organization_id = @demo_organization_id
|
||
ORDER BY op.partner_code;
|
||
|
||
DROP TEMPORARY TABLE tmp_demo_partners_20261008;
|
||
|
||
|
||
-- ============================================================================
|
||
-- 北京 / 武汉 物料数据(由 sqlite-to-mysql-migration/migrate_to_mysql.py 生成)
|
||
--
|
||
-- 两个源库的分类体系编码相同但含义不同(北京 A01=标准件,武汉 A01=机加工件),
|
||
-- 因此北京数据落在默认组织、武汉单独占一个组织,各自带自己的分类树。
|
||
--
|
||
-- 段落幂等:重复执行不会产生重复数据,也不会覆盖已改过的字段(物料走
|
||
-- ON DUPLICATE KEY UPDATE,其余走 NOT EXISTS)。
|
||
-- ============================================================================
|
||
|
||
-- ============================================================
|
||
-- 数据迁移:北京 / 武汉 两个 SQLite 物料库 → wmms
|
||
-- 由 migrate_to_mysql.py 生成,幂等,可重复执行。
|
||
-- 前提:目标库已用 warehouse-mms/scripts/init.sql 建好结构与基础配置。
|
||
-- 导入请务必带 --default-character-set=utf8mb4,否则中文会乱码。
|
||
-- ============================================================
|
||
SET NAMES utf8mb4;
|
||
|
||
-- ---------- 目标组织 ----------
|
||
INSERT INTO organizations (code, name, status)
|
||
SELECT 'WUHAN', '武汉', 'active' FROM DUAL
|
||
WHERE NOT EXISTS (SELECT 1 FROM organizations WHERE code='WUHAN');
|
||
SET @org_bj = (SELECT id FROM organizations WHERE code='DEFAULT' LIMIT 1);
|
||
SET @org_wh = (SELECT id FROM organizations WHERE code='WUHAN' LIMIT 1);
|
||
|
||
-- ---------- 分类树(只补目标组织里缺的)----------
|
||
|
||
-- 武汉:24 个分类
|
||
DROP TEMPORARY TABLE IF EXISTS tmp_cat_wh;
|
||
CREATE TEMPORARY TABLE tmp_cat_wh (
|
||
code VARCHAR(50) NOT NULL PRIMARY KEY,
|
||
name VARCHAR(100) NOT NULL,
|
||
description VARCHAR(1000) NOT NULL DEFAULT '',
|
||
parent_code VARCHAR(50) NULL
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
INSERT INTO tmp_cat_wh (code, name, description, parent_code) VALUES
|
||
('A', '外协件类', '', NULL),
|
||
('B', '外购件类', '', NULL),
|
||
('C', '软件类', '', NULL),
|
||
('D', '试剂及耗材类', '', NULL),
|
||
('E', '包装材料类', '', NULL),
|
||
('F', '成品/半成品类', '成品、半成品', NULL),
|
||
('A01', '机加工件', '', 'A'),
|
||
('A02', '钣金件', '', 'A'),
|
||
('A03', '塑胶件', '', 'A'),
|
||
('A04', '治具类', '', 'A'),
|
||
('A05', '其它类', '', 'A'),
|
||
('B01', '电子类', '', 'B'),
|
||
('B02', '机械类', '', 'B'),
|
||
('B03', '其他类', '', 'B'),
|
||
('C01', '软件', '', 'C'),
|
||
('D01', '理化试剂类', '', 'D'),
|
||
('D02', '耗材类', '', 'D'),
|
||
('E01', '内包装材料类', '', 'E'),
|
||
('E02', '外包装材料类', '', 'E'),
|
||
('E03', '标签类', '', 'E'),
|
||
('E04', '说明书类', '', 'E'),
|
||
('E05', '其他类', '', 'E'),
|
||
('F01', '半成品', '', 'F'),
|
||
('F02', '成品', '', 'F');
|
||
-- 先建分类(parent 留空),再回填 parent_id。
|
||
-- 不能一条 INSERT…SELECT 里 JOIN 目标表:查不到同一语句刚插入的大类。
|
||
INSERT INTO material_categories (organization_id, code, name, description)
|
||
SELECT @org_wh, t.code, t.name, t.description
|
||
FROM tmp_cat_wh t
|
||
WHERE NOT EXISTS (
|
||
SELECT 1 FROM material_categories e
|
||
WHERE e.organization_id = @org_wh AND e.code = t.code
|
||
);
|
||
UPDATE material_categories c
|
||
JOIN tmp_cat_wh t ON t.code = c.code
|
||
JOIN material_categories p
|
||
ON p.organization_id = c.organization_id AND p.code = t.parent_code
|
||
SET c.parent_id = p.id
|
||
WHERE c.organization_id = @org_wh AND t.parent_code IS NOT NULL;
|
||
DROP TEMPORARY TABLE tmp_cat_wh;
|
||
|
||
-- ---------- 物料单位 ----------
|
||
-- 单位在后端按公司隔离:物料引用的单位必须属于同一公司(MaterialRepo.IsActiveUnit)。
|
||
-- 所以每个公司都要有自己的一整套,不能几个公司共用一份。已有的跳过。
|
||
DROP TEMPORARY TABLE IF EXISTS tmp_units;
|
||
CREATE TEMPORARY TABLE tmp_units (
|
||
code VARCHAR(50) NOT NULL PRIMARY KEY,
|
||
name VARCHAR(100) NOT NULL,
|
||
precision_scale TINYINT NOT NULL DEFAULT 0
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
INSERT INTO tmp_units (code, name, precision_scale) VALUES
|
||
('个', '个', 0),
|
||
('只', '只', 0),
|
||
('支', '支', 0),
|
||
('根', '根', 0),
|
||
('条', '条', 0),
|
||
('片', '片', 0),
|
||
('张', '张', 0),
|
||
('套', '套', 0),
|
||
('台', '台', 0),
|
||
('对', '对', 0),
|
||
('双', '双', 0),
|
||
('包', '包', 0),
|
||
('袋', '袋', 0),
|
||
('盒', '盒', 0),
|
||
('箱', '箱', 0),
|
||
('瓶', '瓶', 0),
|
||
('罐', '罐', 0),
|
||
('桶', '桶', 0),
|
||
('卷', '卷', 0),
|
||
('块', '块', 0),
|
||
('Pcs', '件', 0),
|
||
('g', '克', 3),
|
||
('kg', '千克', 3),
|
||
('t', '吨', 3),
|
||
('mL', '毫升', 3),
|
||
('L', '升', 3),
|
||
('m³', '立方米', 3),
|
||
('mm', '毫米', 3),
|
||
('cm', '厘米', 3),
|
||
('m', '米', 3),
|
||
('m²', '平方米', 3);
|
||
INSERT INTO units (organization_id, code, name, precision_scale, status)
|
||
SELECT o.id, t.code, t.name, t.precision_scale, 'active'
|
||
FROM tmp_units t
|
||
CROSS JOIN organizations o
|
||
WHERE o.code IN ('DEFAULT', 'WUHAN')
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM units u WHERE u.organization_id = o.id AND u.code = t.code
|
||
);
|
||
DROP TEMPORARY TABLE tmp_units;
|
||
|
||
-- ---------- 各单位 id ----------
|
||
SET @u_bj_pcs = (SELECT id FROM units WHERE organization_id=@org_bj AND code='Pcs' LIMIT 1); -- Pcs
|
||
SET @u_bj_ge = (SELECT id FROM units WHERE organization_id=@org_bj AND code='个' LIMIT 1); -- 个
|
||
SET @u_bj_g = (SELECT id FROM units WHERE organization_id=@org_bj AND code='g' LIMIT 1); -- g
|
||
SET @u_bj_cm = (SELECT id FROM units WHERE organization_id=@org_bj AND code='cm' LIMIT 1); -- cm
|
||
SET @u_bj_tai = (SELECT id FROM units WHERE organization_id=@org_bj AND code='台' LIMIT 1); -- 台
|
||
SET @u_bj_kuai = (SELECT id FROM units WHERE organization_id=@org_bj AND code='块' LIMIT 1); -- 块
|
||
SET @u_bj_tao = (SELECT id FROM units WHERE organization_id=@org_bj AND code='套' LIMIT 1); -- 套
|
||
SET @u_bj_gen = (SELECT id FROM units WHERE organization_id=@org_bj AND code='根' LIMIT 1); -- 根
|
||
SET @u_bj_ml = (SELECT id FROM units WHERE organization_id=@org_bj AND code='mL' LIMIT 1); -- mL
|
||
SET @u_bj_m = (SELECT id FROM units WHERE organization_id=@org_bj AND code='m' LIMIT 1); -- m
|
||
SET @u_wh_pcs = (SELECT id FROM units WHERE organization_id=@org_wh AND code='Pcs' LIMIT 1); -- Pcs
|
||
SET @u_wh_ge = (SELECT id FROM units WHERE organization_id=@org_wh AND code='个' LIMIT 1); -- 个
|
||
SET @u_wh_g = (SELECT id FROM units WHERE organization_id=@org_wh AND code='g' LIMIT 1); -- g
|
||
SET @u_wh_cm = (SELECT id FROM units WHERE organization_id=@org_wh AND code='cm' LIMIT 1); -- cm
|
||
SET @u_wh_tai = (SELECT id FROM units WHERE organization_id=@org_wh AND code='台' LIMIT 1); -- 台
|
||
SET @u_wh_kuai = (SELECT id FROM units WHERE organization_id=@org_wh AND code='块' LIMIT 1); -- 块
|
||
SET @u_wh_tao = (SELECT id FROM units WHERE organization_id=@org_wh AND code='套' LIMIT 1); -- 套
|
||
SET @u_wh_gen = (SELECT id FROM units WHERE organization_id=@org_wh AND code='根' LIMIT 1); -- 根
|
||
SET @u_wh_ml = (SELECT id FROM units WHERE organization_id=@org_wh AND code='mL' LIMIT 1); -- mL
|
||
SET @u_wh_m = (SELECT id FROM units WHERE organization_id=@org_wh AND code='m' LIMIT 1); -- m
|
||
|
||
-- ---------- 默认仓库与主库位 ----------
|
||
-- 每个公司一对:仓库与库位在 init.sql 里各有一个「每公司/每仓库只能有一个」的唯一键。
|
||
INSERT INTO warehouses (organization_id, code, name, status)
|
||
SELECT o.id, 'DEFAULT', '默认仓库', 'active'
|
||
FROM organizations o
|
||
WHERE o.code IN ('DEFAULT', 'WUHAN')
|
||
AND NOT EXISTS (SELECT 1 FROM warehouses w
|
||
WHERE w.organization_id = o.id AND w.code = 'DEFAULT');
|
||
INSERT INTO warehouse_locations (warehouse_id, code, name, status)
|
||
SELECT w.id, 'MAIN', '主库位', 'active'
|
||
FROM warehouses w
|
||
JOIN organizations o ON o.id = w.organization_id
|
||
WHERE o.code IN ('DEFAULT', 'WUHAN')
|
||
AND NOT EXISTS (SELECT 1 FROM warehouse_locations l
|
||
WHERE l.warehouse_id = w.id AND l.code = 'MAIN');
|
||
|
||
-- ---------- 分类 id ----------
|
||
SET @c_bj_A = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A' LIMIT 1); -- 机械结构类
|
||
SET @c_bj_B = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B' LIMIT 1); -- 电气元器件类
|
||
SET @c_bj_C = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='C' LIMIT 1); -- 产品工艺耗材类
|
||
SET @c_bj_D = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='D' LIMIT 1); -- 软件&固件&授权类
|
||
SET @c_bj_E = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='E' LIMIT 1); -- 半成品&成品类
|
||
SET @c_bj_F = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='F' LIMIT 1); -- 包材类
|
||
SET @c_bj_A01 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A01' LIMIT 1); -- 标准件
|
||
SET @c_bj_A02 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A02' LIMIT 1); -- 成品件
|
||
SET @c_bj_A03 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A03' LIMIT 1); -- 简易加工件
|
||
SET @c_bj_A04 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A04' LIMIT 1); -- 精密加工件
|
||
SET @c_bj_A05 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A05' LIMIT 1); -- 钣金件
|
||
SET @c_bj_A06 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A06' LIMIT 1); -- 塑胶件
|
||
SET @c_bj_A07 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='A07' LIMIT 1); -- 其他
|
||
SET @c_bj_B01 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B01' LIMIT 1); -- 成品件
|
||
SET @c_bj_B02 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B02' LIMIT 1); -- 简易加工件
|
||
SET @c_bj_B03 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B03' LIMIT 1); -- PCB硬板
|
||
SET @c_bj_B04 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B04' LIMIT 1); -- FPC软板
|
||
SET @c_bj_B05 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B05' LIMIT 1); -- 线束
|
||
SET @c_bj_B06 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B06' LIMIT 1); -- 组装组件
|
||
SET @c_bj_B07 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='B07' LIMIT 1); -- 其他
|
||
SET @c_bj_C01 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='C01' LIMIT 1); -- 连接耗材
|
||
SET @c_bj_C02 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='C02' LIMIT 1); -- 密封耗材
|
||
SET @c_bj_C03 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='C03' LIMIT 1); -- 其他
|
||
SET @c_bj_D01 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='D01' LIMIT 1); -- 自研程序固件
|
||
SET @c_bj_D02 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='D02' LIMIT 1); -- 外购软件授权
|
||
SET @c_bj_D03 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='D03' LIMIT 1); -- 授权介质
|
||
SET @c_bj_D04 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='D04' LIMIT 1); -- 其他
|
||
SET @c_bj_E01 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='E01' LIMIT 1); -- 成品
|
||
SET @c_bj_E02 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='E02' LIMIT 1); -- 半成品
|
||
SET @c_bj_F01 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='F01' LIMIT 1); -- 资料文档
|
||
SET @c_bj_F02 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='F02' LIMIT 1); -- 标识标牌
|
||
SET @c_bj_F03 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='F03' LIMIT 1); -- 包装物料
|
||
SET @c_bj_F04 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='F04' LIMIT 1); -- 随机工具配件
|
||
SET @c_bj_F05 = (SELECT id FROM material_categories WHERE organization_id=@org_bj AND code='F05' LIMIT 1); -- 其他
|
||
SET @c_wh_A = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='A' LIMIT 1); -- 外协件类
|
||
SET @c_wh_B = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='B' LIMIT 1); -- 外购件类
|
||
SET @c_wh_C = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='C' LIMIT 1); -- 软件类
|
||
SET @c_wh_D = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='D' LIMIT 1); -- 试剂及耗材类
|
||
SET @c_wh_E = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='E' LIMIT 1); -- 包装材料类
|
||
SET @c_wh_F = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='F' LIMIT 1); -- 成品/半成品类
|
||
SET @c_wh_A01 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='A01' LIMIT 1); -- 机加工件
|
||
SET @c_wh_A02 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='A02' LIMIT 1); -- 钣金件
|
||
SET @c_wh_A03 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='A03' LIMIT 1); -- 塑胶件
|
||
SET @c_wh_A04 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='A04' LIMIT 1); -- 治具类
|
||
SET @c_wh_A05 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='A05' LIMIT 1); -- 其它类
|
||
SET @c_wh_B01 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='B01' LIMIT 1); -- 电子类
|
||
SET @c_wh_B02 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='B02' LIMIT 1); -- 机械类
|
||
SET @c_wh_B03 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='B03' LIMIT 1); -- 其他类
|
||
SET @c_wh_C01 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='C01' LIMIT 1); -- 软件
|
||
SET @c_wh_D01 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='D01' LIMIT 1); -- 理化试剂类
|
||
SET @c_wh_D02 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='D02' LIMIT 1); -- 耗材类
|
||
SET @c_wh_E01 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='E01' LIMIT 1); -- 内包装材料类
|
||
SET @c_wh_E02 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='E02' LIMIT 1); -- 外包装材料类
|
||
SET @c_wh_E03 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='E03' LIMIT 1); -- 标签类
|
||
SET @c_wh_E04 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='E04' LIMIT 1); -- 说明书类
|
||
SET @c_wh_E05 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='E05' LIMIT 1); -- 其他类
|
||
SET @c_wh_F01 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='F01' LIMIT 1); -- 半成品
|
||
SET @c_wh_F02 = (SELECT id FROM material_categories WHERE organization_id=@org_wh AND code='F02' LIMIT 1); -- 成品
|
||
|
||
-- ---------- 企业(供应商 / 厂家)----------
|
||
-- 源里只有名字,联系方式等字段留空;partner_code 是本次迁移编的。
|
||
DROP TEMPORARY TABLE IF EXISTS tmp_partner_bj;
|
||
CREATE TEMPORARY TABLE tmp_partner_bj (
|
||
partner_code VARCHAR(50) NOT NULL PRIMARY KEY,
|
||
legal_name VARCHAR(200) NOT NULL,
|
||
is_supplier BOOLEAN NOT NULL,
|
||
is_manufacturer BOOLEAN NOT NULL
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
INSERT INTO tmp_partner_bj (partner_code, legal_name, is_supplier, is_manufacturer) VALUES
|
||
('BJ-P001', '上海鸣志', TRUE, TRUE),
|
||
('BJ-P002', '博通', FALSE, TRUE),
|
||
('BJ-P003', '鑫拓智能', TRUE, TRUE);
|
||
-- 企业档案(按法定名称去重)
|
||
INSERT INTO business_partners (legal_name)
|
||
SELECT t.legal_name FROM tmp_partner_bj t
|
||
WHERE NOT EXISTS (SELECT 1 FROM business_partners b WHERE b.legal_name = t.legal_name);
|
||
-- 组织与企业的关联
|
||
INSERT INTO organization_partners
|
||
(organization_id, business_partner_id, partner_code, is_supplier, is_manufacturer,
|
||
supplier_status, customer_status, settlement_currency, payment_terms)
|
||
SELECT @org_bj, b.id, t.partner_code, t.is_supplier, t.is_manufacturer,
|
||
CASE WHEN t.is_supplier THEN 'active' ELSE NULL END, NULL, 'CNY', NULL
|
||
FROM tmp_partner_bj t
|
||
JOIN business_partners b ON b.legal_name = t.legal_name
|
||
WHERE NOT EXISTS (
|
||
SELECT 1 FROM organization_partners e
|
||
WHERE e.organization_id = @org_bj
|
||
AND (e.partner_code = t.partner_code OR e.business_partner_id = b.id)
|
||
);
|
||
DROP TEMPORARY TABLE tmp_partner_bj;
|
||
|
||
DROP TEMPORARY TABLE IF EXISTS tmp_partner_wh;
|
||
CREATE TEMPORARY TABLE tmp_partner_wh (
|
||
partner_code VARCHAR(50) NOT NULL PRIMARY KEY,
|
||
legal_name VARCHAR(200) NOT NULL,
|
||
is_supplier BOOLEAN NOT NULL,
|
||
is_manufacturer BOOLEAN NOT NULL
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
INSERT INTO tmp_partner_wh (partner_code, legal_name, is_supplier, is_manufacturer) VALUES
|
||
('WH-P001', '北京亦鑫诚自动化科技有限公司', TRUE, FALSE),
|
||
('WH-P002', '北京研控智诚科技有限公司', TRUE, FALSE),
|
||
('WH-P003', '深圳市维君瑞科技有限公司', TRUE, FALSE),
|
||
('WH-P004', '北京科奥普瑞电气技术有限公司', TRUE, FALSE),
|
||
('WH-P005', '卡川尔流体科技(上海)有限公司', TRUE, FALSE),
|
||
('WH-P006', '北昂流体系统(上海)有限公司', TRUE, FALSE),
|
||
('WH-P007', '北京致远合创电子科技有限公司', TRUE, FALSE),
|
||
('WH-P008', '欧时电子元件(上海)有限公司', TRUE, FALSE),
|
||
('WH-P009', '东莞市纳百智造技术有限公司', TRUE, FALSE),
|
||
('WH-P010', '武汉市普创模型技术有限公司', TRUE, FALSE),
|
||
('WH-P011', '唐山共兴电子有限公司', TRUE, FALSE),
|
||
('WH-P012', '南京润泽流体控制设备有限公司', TRUE, FALSE),
|
||
('WH-P013', '上海红波电器有限公司', TRUE, FALSE),
|
||
('WH-P014', '特耐王重型包装武汉有限公司', TRUE, FALSE),
|
||
('WH-P015', '武汉市江汉区博杰广告印务中心', TRUE, FALSE),
|
||
('WH-P016', '北京恒瑞博远科技有限公司', TRUE, FALSE),
|
||
('WH-P017', '佛山戊实五金有限公司', TRUE, FALSE),
|
||
('WH-P018', '杭州九湃', TRUE, FALSE),
|
||
('WH-P019', '东莞市友联亨达光电有限公司', TRUE, FALSE),
|
||
('WH-P020', '北京天拓四方科技股份有限公司', TRUE, FALSE),
|
||
('WH-P021', '江苏信富盛精密科技有限公司', TRUE, FALSE),
|
||
('WH-P022', '武汉乐普菲克新材料有限公司', TRUE, FALSE),
|
||
('WH-P023', '东莞市臻和电子科技有限公司', TRUE, FALSE),
|
||
('WH-P024', '深圳市福联达电热电器有限公司', TRUE, FALSE),
|
||
('WH-P025', '深圳市德懋塑胶有限公司', TRUE, FALSE),
|
||
('WH-P026', '广东烨嘉光电科技股份有限公司', TRUE, FALSE),
|
||
('WH-P027', '东莞市永盈胶粘制品有限公司', TRUE, FALSE),
|
||
('WH-P028', '深圳市美星新材料科技有限公司', TRUE, FALSE),
|
||
('WH-P029', '昆山聚格电子材料有限公司', TRUE, FALSE),
|
||
('WH-P030', '奥力拓医用包装材料(苏州)有限公司', TRUE, FALSE),
|
||
('WH-P031', '德恩', FALSE, TRUE),
|
||
('WH-P032', '科耐特', FALSE, TRUE),
|
||
('WH-P033', '香橙派', TRUE, FALSE),
|
||
('WH-P034', '海葵星', TRUE, FALSE);
|
||
-- 企业档案(按法定名称去重)
|
||
INSERT INTO business_partners (legal_name)
|
||
SELECT t.legal_name FROM tmp_partner_wh t
|
||
WHERE NOT EXISTS (SELECT 1 FROM business_partners b WHERE b.legal_name = t.legal_name);
|
||
-- 组织与企业的关联
|
||
INSERT INTO organization_partners
|
||
(organization_id, business_partner_id, partner_code, is_supplier, is_manufacturer,
|
||
supplier_status, customer_status, settlement_currency, payment_terms)
|
||
SELECT @org_wh, b.id, t.partner_code, t.is_supplier, t.is_manufacturer,
|
||
CASE WHEN t.is_supplier THEN 'active' ELSE NULL END, NULL, 'CNY', NULL
|
||
FROM tmp_partner_wh t
|
||
JOIN business_partners b ON b.legal_name = t.legal_name
|
||
WHERE NOT EXISTS (
|
||
SELECT 1 FROM organization_partners e
|
||
WHERE e.organization_id = @org_wh
|
||
AND (e.partner_code = t.partner_code OR e.business_partner_id = b.id)
|
||
);
|
||
DROP TEMPORARY TABLE tmp_partner_wh;
|
||
|
||
-- ---------- 伙伴 id ----------
|
||
SET @p_bj_001 = (SELECT id FROM organization_partners WHERE organization_id=@org_bj AND partner_code='BJ-P001' LIMIT 1); -- 上海鸣志
|
||
SET @p_bj_002 = (SELECT id FROM organization_partners WHERE organization_id=@org_bj AND partner_code='BJ-P002' LIMIT 1); -- 博通
|
||
SET @p_bj_003 = (SELECT id FROM organization_partners WHERE organization_id=@org_bj AND partner_code='BJ-P003' LIMIT 1); -- 鑫拓智能
|
||
SET @p_wh_001 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P001' LIMIT 1); -- 北京亦鑫诚自动化科技有限公司
|
||
SET @p_wh_002 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P002' LIMIT 1); -- 北京研控智诚科技有限公司
|
||
SET @p_wh_003 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P003' LIMIT 1); -- 深圳市维君瑞科技有限公司
|
||
SET @p_wh_004 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P004' LIMIT 1); -- 北京科奥普瑞电气技术有限公司
|
||
SET @p_wh_005 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P005' LIMIT 1); -- 卡川尔流体科技(上海)有限公司
|
||
SET @p_wh_006 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P006' LIMIT 1); -- 北昂流体系统(上海)有限公司
|
||
SET @p_wh_007 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P007' LIMIT 1); -- 北京致远合创电子科技有限公司
|
||
SET @p_wh_008 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P008' LIMIT 1); -- 欧时电子元件(上海)有限公司
|
||
SET @p_wh_009 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P009' LIMIT 1); -- 东莞市纳百智造技术有限公司
|
||
SET @p_wh_010 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P010' LIMIT 1); -- 武汉市普创模型技术有限公司
|
||
SET @p_wh_011 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P011' LIMIT 1); -- 唐山共兴电子有限公司
|
||
SET @p_wh_012 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P012' LIMIT 1); -- 南京润泽流体控制设备有限公司
|
||
SET @p_wh_013 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P013' LIMIT 1); -- 上海红波电器有限公司
|
||
SET @p_wh_014 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P014' LIMIT 1); -- 特耐王重型包装武汉有限公司
|
||
SET @p_wh_015 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P015' LIMIT 1); -- 武汉市江汉区博杰广告印务中心
|
||
SET @p_wh_016 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P016' LIMIT 1); -- 北京恒瑞博远科技有限公司
|
||
SET @p_wh_017 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P017' LIMIT 1); -- 佛山戊实五金有限公司
|
||
SET @p_wh_018 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P018' LIMIT 1); -- 杭州九湃
|
||
SET @p_wh_019 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P019' LIMIT 1); -- 东莞市友联亨达光电有限公司
|
||
SET @p_wh_020 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P020' LIMIT 1); -- 北京天拓四方科技股份有限公司
|
||
SET @p_wh_021 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P021' LIMIT 1); -- 江苏信富盛精密科技有限公司
|
||
SET @p_wh_022 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P022' LIMIT 1); -- 武汉乐普菲克新材料有限公司
|
||
SET @p_wh_023 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P023' LIMIT 1); -- 东莞市臻和电子科技有限公司
|
||
SET @p_wh_024 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P024' LIMIT 1); -- 深圳市福联达电热电器有限公司
|
||
SET @p_wh_025 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P025' LIMIT 1); -- 深圳市德懋塑胶有限公司
|
||
SET @p_wh_026 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P026' LIMIT 1); -- 广东烨嘉光电科技股份有限公司
|
||
SET @p_wh_027 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P027' LIMIT 1); -- 东莞市永盈胶粘制品有限公司
|
||
SET @p_wh_028 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P028' LIMIT 1); -- 深圳市美星新材料科技有限公司
|
||
SET @p_wh_029 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P029' LIMIT 1); -- 昆山聚格电子材料有限公司
|
||
SET @p_wh_030 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P030' LIMIT 1); -- 奥力拓医用包装材料(苏州)有限公司
|
||
SET @p_wh_031 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P031' LIMIT 1); -- 德恩
|
||
SET @p_wh_032 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P032' LIMIT 1); -- 科耐特
|
||
SET @p_wh_033 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P033' LIMIT 1); -- 香橙派
|
||
SET @p_wh_034 = (SELECT id FROM organization_partners WHERE organization_id=@org_wh AND partner_code='WH-P034' LIMIT 1); -- 海葵星
|
||
|
||
-- ---------- 物料 ----------
|
||
-- 源的 type_code 指向分类(如 B01),落到 materials.category_id。
|
||
-- materials.material_type_id 是另一套语义(原材料/半成品/成品),这里留空。
|
||
-- 源里没有 drawing_no 的落点(目标表无此列),两库该字段本来就全空。
|
||
-- spec 与 unit 为空时写空串而不是 NULL:后端把这两列直接 Scan 进 string
|
||
-- (不是 sql.NullString),写 NULL 会让物料列表/详情接口 500。
|
||
-- ===== 北京:16 条 =====
|
||
INSERT INTO materials
|
||
(organization_id, material_code, name, spec, source, remark,
|
||
supplier_id, manufacturer_id, category_id, base_unit_id, unit,
|
||
status, version, created_at, updated_at)
|
||
VALUES
|
||
(@org_bj, 'B010201', 'RCM俯仰-进给-电机',
|
||
'ESF32016H48-S003+I32-2052', '外购', NULL,
|
||
@p_bj_001, @p_bj_001, @c_bj_B01, NULL, '',
|
||
'active', 1, '2026-09-15 08:55:12', '2026-09-17 07:05:29'),
|
||
(@org_bj, 'B010202', 'RCM进给自由度-多圈绝对值编码器',
|
||
'AS20-M42M-B11', '外购', NULL,
|
||
NULL, @p_bj_002, @c_bj_B01, @u_bj_ge, '个',
|
||
'active', 1, '2026-09-16 06:14:37', '2026-09-17 07:04:39'),
|
||
(@org_bj, 'A020201', 'RCM俯仰关节-谐波减速器',
|
||
'HD Mini-05', '外购', NULL,
|
||
@p_bj_003, @p_bj_003, @c_bj_A02, @u_bj_ge, '个',
|
||
'active', 1, '2026-09-17 01:51:05', '2026-09-17 07:04:23'),
|
||
(@org_bj, 'A040201', '旋转件2-1',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, NULL, '',
|
||
'active', 1, '2026-09-24 06:37:08', '2026-09-28 06:24:29'),
|
||
(@org_bj, 'A040202', '旋转件2-2',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, NULL, '',
|
||
'active', 1, '2026-09-24 06:37:08', '2026-09-28 06:24:15'),
|
||
(@org_bj, 'A040203', '旋转件1',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, NULL, '',
|
||
'active', 1, '2026-09-24 06:37:08', '2026-09-28 06:23:40'),
|
||
(@org_bj, 'A040204', '销轴',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, NULL, '',
|
||
'active', 1, '2026-09-24 06:37:08', '2026-09-24 06:37:08'),
|
||
(@org_bj, 'A040205', '中间件',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, NULL, '',
|
||
'active', 1, '2026-09-24 06:37:08', '2026-09-24 06:37:08'),
|
||
(@org_bj, 'A030201', 'PTFE垫片',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A03, NULL, '',
|
||
'active', 1, '2026-09-24 06:37:08', '2026-09-24 06:37:08'),
|
||
(@org_bj, 'A030202', '垫片',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A03, NULL, '',
|
||
'active', 1, '2026-09-24 06:37:08', '2026-09-24 06:37:08'),
|
||
(@org_bj, 'A040206', 'LJJ镊子从端-001',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, @u_bj_pcs, 'Pcs',
|
||
'active', 1, '2026-10-10 07:54:29', '2026-10-10 07:54:29'),
|
||
(@org_bj, 'A040207', 'LJJ镊子从端-002',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, @u_bj_pcs, 'Pcs',
|
||
'active', 1, '2026-10-10 07:54:29', '2026-10-10 07:54:29'),
|
||
(@org_bj, 'A040208', 'LJJ镊子从端-003',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, @u_bj_pcs, 'Pcs',
|
||
'active', 1, '2026-10-10 07:54:29', '2026-10-10 07:54:29'),
|
||
(@org_bj, 'A040209', 'LJJ镊子从端-004',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, @u_bj_pcs, 'Pcs',
|
||
'active', 1, '2026-10-10 07:54:29', '2026-10-10 07:54:29'),
|
||
(@org_bj, 'A040210', 'LJJ镊子从端-005',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, @u_bj_pcs, 'Pcs',
|
||
'active', 1, '2026-10-10 07:54:29', '2026-10-10 07:54:29'),
|
||
(@org_bj, 'A040211', 'LJJ镊子从端-006',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_bj_A04, @u_bj_pcs, 'Pcs',
|
||
'active', 1, '2026-10-10 07:54:29', '2026-10-10 07:54:57')
|
||
AS new
|
||
ON DUPLICATE KEY UPDATE
|
||
name = new.name, spec = new.spec, source = new.source, remark = new.remark,
|
||
supplier_id = new.supplier_id, manufacturer_id = new.manufacturer_id,
|
||
category_id = new.category_id, base_unit_id = new.base_unit_id, unit = new.unit,
|
||
status = new.status, updated_at = new.updated_at;
|
||
|
||
-- ===== 武汉:183 条 =====
|
||
INSERT INTO materials
|
||
(organization_id, material_code, name, spec, source, remark,
|
||
supplier_id, manufacturer_id, category_id, base_unit_id, unit,
|
||
status, version, created_at, updated_at)
|
||
VALUES
|
||
(@org_wh, 'B010002', '直流开关电源-24V',
|
||
'MPM-30-24ST', NULL, '单台数量:1; 物料等级:A; 存储条件:温度-40°C至85°C,湿度10%至95%RH (无冷凝); 验收准则:检验',
|
||
@p_wh_001, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010003', '直流开关电源-12V',
|
||
'MPM-30-12ST', NULL, '单台数量:1; 物料等级:A; 存储条件:温度-40°C至85°C,湿度10%至95%RH (无冷凝); 验收准则:检验',
|
||
@p_wh_001, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010004', '直流开关电源-5V',
|
||
'MPM-30-5ST', NULL, '单台数量:1; 物料等级:A; 存储条件:温度-40°C至85°C,湿度10%至95%RH (无冷凝); 验收准则:检验',
|
||
@p_wh_001, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010005', '单板电脑',
|
||
'MIO-5152J', NULL, '单台数量:1; 物料等级:A; 存储条件:温度0°C至60°C,湿度40%至95%RH (无冷凝); 验收准则:检验; 备注:配置(8G;128G;WIN10;适配器)',
|
||
@p_wh_002, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010010', 'NTC传感器变送器',
|
||
'SAR16-NTC10K-P1-A4', NULL, '单台数量:4; 物料等级:B; 存储条件:温度-40°C至85°C,湿度10%至95%RH(无凝露); 验收准则:检验; 备注:输入:NTC10k,0-45°C',
|
||
@p_wh_003, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010011', '继电器模块',
|
||
'PLC-RPT-24DC/21', NULL, '单台数量:3; 物料等级:B; 存储条件:温度-40°C至85°C,湿度10%至95%RH(无凝露); 验收准则:检验',
|
||
@p_wh_004, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010012', '直通式接线端子',
|
||
'PT1,5/S-QUATTRO', NULL, '单台数量:8; 物料等级:B; 存储条件:温度-5°C至70°C,湿度30%至70%RH(无凝露); 验收准则:检验',
|
||
@p_wh_004, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010013', '接地端子',
|
||
'PT2,5-QUATTRO-PE', NULL, '单台数量:2; 物料等级:B; 存储条件:温度-5°C至70°C,湿度30%至70%RH(无凝露); 验收准则:检验',
|
||
@p_wh_004, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010014', '微型隔膜气泵及固定架',
|
||
'KVP04-1.1-24', NULL, '单台数量:2; 物料等级:B; 存储条件:温度-10℃至55℃;湿度<85%RH(无冷凝水); 验收准则:检验',
|
||
@p_wh_005, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010015', '微型电磁隔离阀',
|
||
'FV17T24-59-4E-3', NULL, '单台数量:4; 物料等级:B; 存储条件:温度-10℃至55℃;湿度<85%RH(无冷凝水); 验收准则:检验',
|
||
@p_wh_006, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010017', '保险丝管',
|
||
'T5AH250VP', NULL, '单台数量:2; 物料等级:B; 存储条件:温度-20°C至60°C,湿度10%至95%RH; 验收准则:检验; 备注:0215005.MXP
|
||
陶瓷保险管, 215系列, 5A, 250V 交流, 5×20mm, 熔断速度T',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010019', '电线组件',
|
||
'V3203C+VAC13KS(配60227IEC53 3×1mm2)', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验; 备注:2m电源线, IEC C13转I 型中式插头, 10A,250V, 黑色6051.2032',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030001', '母座安装板',
|
||
'RM-01-010101', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030002', '母座',
|
||
'RM-01-01010201', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A020001', '母座压板',
|
||
'RM-01-010104', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030003', '主体装配',
|
||
'RM-01-0103', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030004', '导光板',
|
||
'RM-01-010201', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A020002', '电气安装板',
|
||
'RM-01-010401', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A020003', '机壳',
|
||
'RM-01-01040201', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A020004', '机盖',
|
||
'RM-01-01040202', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030005', '后壳装配',
|
||
'RM-01-0105', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A020005', '安装座',
|
||
'RM-01-010601', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030006', '胶塞',
|
||
'RM-01-0107', NULL, '单台数量:6; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_009, NULL, @c_wh_A03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A050001', '控制采集板',
|
||
'RM-01-0109', NULL, '单台数量:1; 物料等级:B; 存储条件:温度0°C至40°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_011, NULL, @c_wh_A05, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A050002', '弹针PCB板',
|
||
'RM-01-0108', NULL, '单台数量:2; 物料等级:B; 存储条件:温度0°C至40°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_011, NULL, @c_wh_A05, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020001', '细气路管',
|
||
'BFT045-1-2', NULL, '单台数量:170; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:一次性使用治疗头用量7厘米(TPE材质,需要清洗),主机用量170厘米;
|
||
内径1/16"外径1/8"
|
||
另一BOM单台数量:7; 备注:一次性使用治疗头用量7厘米(TPE材质,需要清洗),主机用量169厘米;
|
||
内径1/16"外径1/8"',
|
||
@p_wh_006, NULL, @c_wh_B02, @u_wh_cm, '厘米',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020002', '鸭嘴单向阀',
|
||
'RZ-BV018PPS', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_012, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020003', 'T型三通接头',
|
||
'T-024', NULL, '单台数量:6; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_012, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020005', '变径直通接头',
|
||
'BI-024/032', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_012, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020040', '粗气路管',
|
||
'BFT045-2-3', NULL, '单台数量:17; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:96402-16(16#)',
|
||
@p_wh_006, NULL, @c_wh_B02, @u_wh_cm, '厘米',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010023', 'USB集线器',
|
||
'USB-HUB-3U-ETH', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验; 备注:去除涂层,自带线缆',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010024', '散热风扇',
|
||
'MF60151V1-1000C-A99', NULL, '单台数量:2; 物料等级:C; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010025', 'LED灯带白色',
|
||
'DC24V 8×8mm', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010026', '金属按钮',
|
||
'HBGQ22F-11ET/
|
||
J/S/220V/G', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验; 备注:接插件HB-T2/4/15CM两个常开脚和两个灯脚插线',
|
||
@p_wh_013, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010027', 'RJ45网线',
|
||
'CAT5E-AA-0050', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验; 备注:黑色,超五类屏蔽网\\RJ45\\0.5米',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010028', '磁环',
|
||
'TC5B RC16*28*8-M2', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010029', '电气导轨',
|
||
'DIN35,L=100mm,
|
||
铝制', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010030', '电气导轨',
|
||
'DIN35,L=300mm,
|
||
铝制', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020009', '宝塔接头',
|
||
'M4×0.7 插3mm', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010031', '直流电源转无终端接头电源线',
|
||
'5521公头,0.3平方,
|
||
长度0.5米', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010032', '插拔式桥接件',
|
||
'FBS2-5', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_004, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010033', '插拔式桥接件',
|
||
'FBS 2-3,5 BU', NULL, '单台数量:2; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_004, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020002', '包装箱',
|
||
'RM-01-0201', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020003', '包装箱底托',
|
||
'RM-01-0202', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020004', '底部泡棉',
|
||
'RM-01-0203', NULL, '单台数量:2; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020005', '侧面泡棉',
|
||
'RM-01-0204', NULL, '单台数量:2; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020006', '前部泡棉',
|
||
'RM-01-0205', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020007', '顶部泡棉',
|
||
'RM-01-0206', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020008', '后部泡棉',
|
||
'RM-01-0207', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020009', '包装箱上盖',
|
||
'RM-01-0208', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020010', '打包带',
|
||
'KT89120', NULL, '单台数量:15; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_E02, @u_wh_m, '米',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020011', '打包扣',
|
||
'KT89121', NULL, '单台数量:10; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_E02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E030001', '标签亚银纸',
|
||
'100×80mm', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_015, NULL, @c_wh_E03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E030004', '接地标识',
|
||
'1×1cm', NULL, '单台数量:5; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_E03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E030005', '防推标识',
|
||
'4×4cm', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_E03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E040001', '说明书',
|
||
'A4', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_015, NULL, @c_wh_E04, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010020', '接线公端子',
|
||
'XH2.54', NULL, '单台数量:18; 物料等级:C; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:验收; 备注:HX25002RT',
|
||
@p_wh_016, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010021', '接线胶壳母侧2Pin',
|
||
'XH2.54', NULL, '单台数量:9; 物料等级:C; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:验收; 备注:HX25002-2R',
|
||
@p_wh_016, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010022', '接线胶壳母侧4Pin',
|
||
'VH3.96', NULL, '单台数量:1; 物料等级:C; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:验收; 备注:HX39600-4R',
|
||
@p_wh_016, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010034', '接线公端子',
|
||
'VH3.96', NULL, '单台数量:4; 物料等级:C; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:验收; 备注:HX39600-RT',
|
||
@p_wh_016, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020017', '十字沉头螺钉',
|
||
'M2×6', NULL, '单台数量:4; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:GB/T818-2000',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020015', '十字槽盘头螺钉',
|
||
'M2×4', NULL, '单台数量:4; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:GB/T818-2000',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020019', '十字槽盘头螺钉',
|
||
'M3×20', NULL, '单台数量:12; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:GB/T818-2000',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020024', '弹簧垫圈',
|
||
'2mm', NULL, '单台数量:4; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:GB/T93-1987',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020031', '隔离柱',
|
||
'M3×5+4', NULL, '单台数量:4; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020033', '六角螺母',
|
||
'M3', NULL, '单台数量:7; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:GB/T6170-2000',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020034', '外锯齿防松垫片(接地)',
|
||
'M3', NULL, '单台数量:5; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020037', '十字槽小盘头螺钉',
|
||
'M4×14', NULL, '单台数量:6; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:GB/T823-2000',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010035', 'IEC滤波插座',
|
||
'DD12-41110-2111-1100', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-20°C至60°C,湿度10%至95%RH; 验收准则:检验; 备注:DD12.4121.111
|
||
C14IEC滤波插座, 额定电压250 V 交流, 额定电流4A, 双保险丝座, 2极开关, 面板安装',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010036', '保险丝座',
|
||
'5×20mm, 10A', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-20°C至60°C,湿度10%至95%RH; 验收准则:检验; 备注:Fusedrawer 2 系列, 尺寸 5×20mm, 10A, 面板安装
|
||
制造商编码:4301.1403',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010037', '磁环',
|
||
'FS28.5*6.8*12', NULL, '单台数量:4; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010038', '磁环',
|
||
'UF100', NULL, '单台数量:3; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_007, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020038', '扎带固定座',
|
||
'20*20mm,带背胶,
|
||
白色', NULL, '单台数量:3; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020041', '节流阀',
|
||
'4*2.5mm', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010039', 'USB扬声器',
|
||
'JP200-U', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_018, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010040', '触摸屏显示器',
|
||
'YL-GZYW01Q156TC-V4', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-20°C至60°C,湿度10%至95%RH(最高湿球温度38.7℃); 验收准则:检验',
|
||
@p_wh_019, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010041', '中央处理器模组',
|
||
'6ES7 214-1AH50-0XB0', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-40°C至70°C,湿度10%至95%RH (无冷凝); 验收准则:检验; 备注:CPU 1214C',
|
||
@p_wh_020, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010042', '模拟输入模组',
|
||
'6ES7 231-4HF50-0XB0', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-40°C至70°C,湿度10%至95%RH (无冷凝); 验收准则:检验; 备注:ANALOG',
|
||
@p_wh_020, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010043', '数字输入/输出模组',
|
||
'6ES7 223-7AF50-0XB0', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-40°C至70°C,湿度10%至95%RH (无冷凝); 验收准则:检验; 备注:5V DC',
|
||
@p_wh_020, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010044', '模拟输入模组',
|
||
'6ES7 231-5PB50-0XB0', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-40°C至70°C,湿度10%至95%RH (无冷凝); 验收准则:检验; 备注:RTD',
|
||
@p_wh_020, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A050047', '集成线束1#',
|
||
'', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_021, NULL, @c_wh_A05, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A050048', '集成线束2#',
|
||
'', NULL, '单台数量:1; 物料等级:B; 存储条件:温度-25°C至70°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_021, NULL, @c_wh_A05, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020042', '十字槽盘头组合螺钉',
|
||
'M3×6', NULL, '单台数量:16; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:GB/T 9074.4
|
||
材质:
|
||
碳钢蓝白锌',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020043', '十字槽盘头组合螺钉',
|
||
'M3×8', NULL, '单台数量:3; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020044', '十字槽盘头组合螺钉',
|
||
'M3×12', NULL, '单台数量:16; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020046', '十字槽盘头组合螺钉',
|
||
'M4×8', NULL, '单台数量:18; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020047', '十字槽盘头组合螺钉',
|
||
'M4×10', NULL, '单台数量:7; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020048', '内六角半圆头组合螺钉',
|
||
'M4×8', NULL, '单台数量:8; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B010045', '终端固定件',
|
||
'E/UK', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_004, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B030002', '低强度螺纹胶',
|
||
'乐泰222,容量50ml', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:生产使用前后进行称重
|
||
并记录重量',
|
||
@p_wh_022, NULL, @c_wh_B03, @u_wh_ml, '毫升',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B030003', '硅橡胶',
|
||
'706', NULL, '单台数量:2; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:生产使用前后进行称重
|
||
并记录重量',
|
||
@p_wh_007, NULL, @c_wh_B03, @u_wh_g, '克',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020012', '扎带',
|
||
'黑色扎带(实际宽度2.5)3*120MM', NULL, '单台数量:150; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'D020001', '毛刷针头',
|
||
'3mm,扁口,14-32G', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:10个治疗头损耗1个毛刷',
|
||
@p_wh_023, NULL, @c_wh_D02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'D020002', '特氟龙针头',
|
||
'无扁痕25G半寸', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:100个治疗头损耗1个特氟龙针头',
|
||
NULL, NULL, @c_wh_D02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'D020003', '胶筒',
|
||
'10ml
|
||
30ml', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:500个治疗头损耗1个胶筒',
|
||
NULL, NULL, @c_wh_D02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'D020004', '胶筒适配器',
|
||
'10ml
|
||
30ml', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收; 备注:500个治疗头损耗1个胶筒适配器',
|
||
NULL, NULL, @c_wh_D02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B030005', '液体生胶带',
|
||
'50ml', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:生产使用前后进行称重
|
||
并记录重量',
|
||
@p_wh_022, NULL, @c_wh_B03, @u_wh_ml, '毫升',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'D020006', '铝箔',
|
||
'21.7mm*11.3mm', NULL, '单台数量:20; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
NULL, NULL, @c_wh_D02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A050082', 'PI膜',
|
||
'T-01-0111', NULL, '单台数量:1; 物料等级:A; 存储条件:温度0°C至40°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_024, NULL, @c_wh_A05, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A050083', '线缆',
|
||
'T-01-0112', NULL, '单台数量:1; 物料等级:B; 存储条件:温度0°C至40°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_021, NULL, @c_wh_A05, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A050084', 'pogopin板',
|
||
'T-01-0113', NULL, '单台数量:1; 物料等级:B; 存储条件:温度0°C至40°C,湿度10%至95%RH; 验收准则:检验',
|
||
@p_wh_011, NULL, @c_wh_A05, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020004', 'T型三通接头',
|
||
'T-016', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(聚丙烯PP)',
|
||
@p_wh_012, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030007', '治疗头气路接口',
|
||
'T-01-0102', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(聚碳酸酯)',
|
||
@p_wh_025, NULL, @c_wh_A03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030008', '插头外壳',
|
||
'T-01-0103', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(聚碳酸酯)',
|
||
@p_wh_025, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030009', '可充气气囊',
|
||
'T-01-0104', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(硅胶包裹塑料)',
|
||
@p_wh_026, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030010', '眼睑加热器上外壳',
|
||
'T-01-0105', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(聚碳酸酯)',
|
||
@p_wh_025, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030011', '眼睑加热器下外壳',
|
||
'T-01-0106', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(聚碳酸酯)',
|
||
@p_wh_025, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'A030012', '眼睑加热器外壳',
|
||
'T-01-0107', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(聚碳酸酯)',
|
||
@p_wh_025, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020039', '密封圈',
|
||
'外径6.5*1.9', NULL, '单台数量:2; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洗(硅胶)',
|
||
@p_wh_007, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020013', '圆形隔热层',
|
||
'T-01-0108', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洁(铝箔)',
|
||
@p_wh_027, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020010', '异形隔热层',
|
||
'T-01-0109', NULL, '单台数量:2; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洁(铝箔)',
|
||
@p_wh_027, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B020014', '限位层',
|
||
'T-01-0110', NULL, '单台数量:2; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:清洁(二氧化硅)',
|
||
@p_wh_028, NULL, @c_wh_B02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'B030001', '治疗头外壳胶水',
|
||
'乐泰4311 UV胶水', NULL, '单台数量:0.4; 物料等级:B; 存储条件:温度2°C至8°C,冷藏储存; 验收准则:检验',
|
||
@p_wh_022, NULL, @c_wh_B03, @u_wh_g, '克',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E010001', '空白包装袋',
|
||
'288×198mm 1059B/
|
||
LF-3070A', NULL, '单台数量:1; 物料等级:B; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:洁净物料',
|
||
@p_wh_030, NULL, @c_wh_E01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020001', '治疗头纸包装箱',
|
||
'T-01-04', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E030002', '标签PET纸',
|
||
'120×100mm', NULL, '单台数量:2; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_015, NULL, @c_wh_E03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E030003', '合格证PET纸',
|
||
'100×80mm', NULL, '单台数量:3; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_015, NULL, @c_wh_E03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E030007', '辐照灭菌标签',
|
||
'25kGy', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:验收',
|
||
@p_wh_007, NULL, @c_wh_E03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'E020012', '灭菌包装',
|
||
'T-01-05', NULL, '单台数量:1; 物料等级:C; 存储条件:存放于室内,湿度≤95%RH; 验收准则:检验; 备注:1个灭菌包装可以装6个治疗头纸包装箱',
|
||
@p_wh_014, NULL, @c_wh_E02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:45:24', '2026-09-11 07:45:24'),
|
||
(@org_wh, 'F010006', '主机外壳组件',
|
||
'XWRM-02', '外协', NULL,
|
||
NULL, NULL, @c_wh_F01, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-18 05:46:15'),
|
||
(@org_wh, 'F010007', '主机外壳组件',
|
||
'XWRM-03', '外协', NULL,
|
||
NULL, NULL, @c_wh_F01, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-18 05:45:31'),
|
||
(@org_wh, 'A030013', '治疗头上外壳',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'A030014', '治疗头下外壳',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'A030015', '治疗头气囊',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'A030016', '治疗头插头外壳',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_A03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'F010085', '治疗头线缆组件(二代)',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_F01, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-23 15:25:12'),
|
||
(@org_wh, 'A050086', '治疗头线缆',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_A05, @u_wh_cm, '厘米',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 08:04:03'),
|
||
(@org_wh, 'B010046', '电源板',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-18 06:50:07'),
|
||
(@org_wh, 'F010047', '主控板',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_F01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-18 05:46:40'),
|
||
(@org_wh, 'B010048', '触摸屏10.1寸',
|
||
'10.1寸', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-10-10 11:57:41'),
|
||
(@org_wh, 'B010049', '扬声器',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010050', '风扇',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010051', 'USB接口板',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010052', '按键板',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010053', '环形灯',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010054', '电磁阀',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010055', '比例阀',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'F010056', '硬板PI膜(芯片)',
|
||
'', '自制', NULL,
|
||
NULL, NULL, @c_wh_F01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-23 14:59:35'),
|
||
(@org_wh, 'B010057', '计数芯片',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010058', '金手指插座',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010059', '触摸屏8寸',
|
||
'8寸', '外购', 'https://item.taobao.com/item.htm?from=cart&id=749116190950&mi_id=000086DKOQjDf9p_N94ymKsE2dWs-QKiH_b2Om7xRMRWkkU&skuId=5940217905947&spm=a1z0d.6639537%2F202410.item.d749116190950.34747484e3AbaM&upStreamPrice=28800&xxc=shop',
|
||
NULL, NULL, @c_wh_B01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-28 08:43:20'),
|
||
(@org_wh, 'F010049', '气路组件',
|
||
'', '自制', NULL,
|
||
NULL, NULL, @c_wh_F01, @u_wh_tao, '套',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-18 06:47:57'),
|
||
(@org_wh, 'B020050', '航插(母座)',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B020051', '航插(公头)',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B030006', '隔热层',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B03, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-11 07:44:59', '2026-09-11 07:44:59'),
|
||
(@org_wh, 'B010060', '电磁阀(常闭)',
|
||
'D379-1H', NULL, NULL,
|
||
NULL, @p_wh_031, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-15 07:43:36', '2026-09-15 07:43:36'),
|
||
(@org_wh, 'B010061', '电磁阀(常开)',
|
||
'D389-1H', NULL, NULL,
|
||
NULL, @p_wh_031, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-15 07:43:36', '2026-09-15 07:43:36'),
|
||
(@org_wh, 'B010062', '电磁阀阀岛',
|
||
'395-02F', NULL, NULL,
|
||
NULL, @p_wh_031, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-15 07:43:36', '2026-09-15 07:43:36'),
|
||
(@org_wh, 'B010063', '气电混装插座',
|
||
'SZCNT02-2PZG1+8H-GG', NULL, NULL,
|
||
NULL, @p_wh_032, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-15 07:43:36', '2026-09-15 07:43:36'),
|
||
(@org_wh, 'B010064', '气电混装插头',
|
||
'SZCNT02-2HTG1+8H-G9G', NULL, NULL,
|
||
NULL, @p_wh_032, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-15 07:43:36', '2026-09-15 07:43:36'),
|
||
(@org_wh, 'B010065', '气电混装插头',
|
||
'SZCNT07-TGG-2B-10+1HC920', NULL, NULL,
|
||
NULL, @p_wh_032, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-15 07:43:36', '2026-09-15 07:43:36'),
|
||
(@org_wh, 'B010066', '气电混装插座',
|
||
'SZCNT07-ZGG-2B-10+1HC', NULL, NULL,
|
||
NULL, @p_wh_032, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-15 07:43:36', '2026-09-15 07:43:36'),
|
||
(@org_wh, 'B010067', '香橙派CM4底板',
|
||
'2G+32G', NULL, NULL,
|
||
@p_wh_033, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-17 10:28:02', '2026-10-13 07:56:37'),
|
||
(@org_wh, 'B010068', '香橙派CM4核心板',
|
||
'2G+32G', NULL, NULL,
|
||
@p_wh_033, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-17 10:28:02', '2026-10-13 07:56:31'),
|
||
(@org_wh, 'B010069', '功率放大板',
|
||
'3.3V高速8路NMOS', NULL, NULL,
|
||
@p_wh_034, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-17 10:28:02', '2026-09-17 11:18:58'),
|
||
(@org_wh, 'B010070', '功率放大板',
|
||
'3.3V低速8路NMOS', NULL, NULL,
|
||
@p_wh_034, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-17 10:28:02', '2026-09-17 10:28:02'),
|
||
(@org_wh, 'B020052', '微型宝塔接头',
|
||
'PC-6-M5', NULL, NULL,
|
||
NULL, NULL, @c_wh_B02, NULL, '',
|
||
'active', 1, '2026-09-18 03:26:33', '2026-09-18 03:26:33'),
|
||
(@org_wh, 'F020001', '二代睑板腺治疗仪主机(铂金版)',
|
||
'XWRM-02', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_tai, '台',
|
||
'active', 1, '2026-09-18 06:41:00', '2026-09-18 06:41:00'),
|
||
(@org_wh, 'F020002', '二代睑板腺治疗仪主机(精英版)',
|
||
'XWRM-03', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_tai, '台',
|
||
'active', 1, '2026-09-18 06:41:00', '2026-09-18 06:41:00'),
|
||
(@org_wh, 'F020003', '一次性使用治疗头',
|
||
'XWT-02', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-18 06:41:00', '2026-09-18 06:41:00'),
|
||
(@org_wh, 'F020004', '一次性使用治疗头',
|
||
'XWT-03', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-18 06:41:00', '2026-09-18 06:41:00'),
|
||
(@org_wh, 'F020005', '治疗头线缆',
|
||
'XWL-02', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-18 06:41:00', '2026-09-18 06:41:00'),
|
||
(@org_wh, 'F020006', '治疗头线缆',
|
||
'XWL-03', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-18 06:41:00', '2026-09-18 06:41:00'),
|
||
(@org_wh, 'F020007', '一次性使用治疗头线缆',
|
||
'XWT-02', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-23 14:38:04', '2026-09-23 14:38:04'),
|
||
(@org_wh, 'F020008', '一次性使用治疗头',
|
||
'XWT-03', '自制', NULL,
|
||
NULL, NULL, @c_wh_F02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-09-23 14:38:04', '2026-09-23 14:38:04'),
|
||
(@org_wh, 'B030007', '铝箔',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B03, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-23 14:46:32', '2026-09-23 14:46:32'),
|
||
(@org_wh, 'B010071', '硬板',
|
||
'', NULL, NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-23 14:48:44', '2026-09-23 14:48:44'),
|
||
(@org_wh, 'B010072', 'PI膜(芯片)',
|
||
'', NULL, NULL,
|
||
NULL, NULL, @c_wh_B01, @u_wh_ge, '个',
|
||
'active', 1, '2026-09-23 14:48:44', '2026-09-23 15:01:47'),
|
||
(@org_wh, 'F010001', '硬板PI膜(电阻)',
|
||
'', '自制', NULL,
|
||
NULL, NULL, @c_wh_F01, NULL, '',
|
||
'active', 1, '2026-09-23 15:00:17', '2026-09-23 15:00:17'),
|
||
(@org_wh, 'B010073', 'PI膜(电阻)',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-23 15:02:52', '2026-09-23 15:02:52'),
|
||
(@org_wh, 'A050087', '线缆',
|
||
'', NULL, NULL,
|
||
NULL, NULL, @c_wh_A05, @u_wh_gen, '根',
|
||
'active', 1, '2026-09-23 15:13:12', '2026-09-23 15:13:12'),
|
||
(@org_wh, 'B010074', '线缆插头',
|
||
'', NULL, NULL,
|
||
NULL, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-23 15:13:12', '2026-09-23 15:13:12'),
|
||
(@org_wh, 'B010075', '金手指PCB板',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-09-23 15:16:30', '2026-09-23 15:16:30'),
|
||
(@org_wh, 'A030017', '金手指插头外壳',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_A03, NULL, '',
|
||
'active', 1, '2026-09-23 15:18:45', '2026-09-23 15:18:45'),
|
||
(@org_wh, 'A030018', '气路变径头',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_A03, NULL, '',
|
||
'active', 1, '2026-09-23 15:20:05', '2026-09-23 15:20:05'),
|
||
(@org_wh, 'F010002', '治疗头线缆组件(一代)',
|
||
'', '外协', NULL,
|
||
NULL, NULL, @c_wh_F01, NULL, '',
|
||
'active', 1, '2026-09-23 15:26:31', '2026-09-23 15:28:10'),
|
||
(@org_wh, 'B010076', '触摸屏8寸',
|
||
'8寸', NULL, 'https://item.taobao.com/item.htm?from=cart&id=749116190950&mi_id=000086DKOQjDf9p_N94ymKsE2dWs-QKiH_b2Om7xRMRWkkU&skuId=5940217905947&spm=a1z0d.6639537%2F202410.item.d749116190950.34747484e3AbaM&upStreamPrice=28800&xxc=shop',
|
||
NULL, NULL, @c_wh_B01, NULL, '',
|
||
'obsolete', 1, '2026-09-28 06:17:01', '2026-09-28 06:47:57'),
|
||
(@org_wh, 'B010077', '香橙派开发板Pi 5',
|
||
'Orange Pi 5; 4G', NULL, 'https://item.taobao.com/item.htm?from=cart&id=694426579648&isabs=detail&mi_id=0000Yq1EqNjBiWluUgqbKkRAsDDsHWyfCslQH1T9MsFF1Sg&spm=a1z0d.6639537%2F202410.item.d694426579648.34747484e3AbaM',
|
||
NULL, NULL, @c_wh_B01, @u_wh_kuai, '块',
|
||
'active', 1, '2026-09-28 06:17:01', '2026-09-28 06:18:49'),
|
||
(@org_wh, 'B010078', 'STM32F103VET6开发板',
|
||
'STM32F103VET6', '外购', '【淘宝】7天无理由退货 https://e.tb.cn/h.8EJfDNNHtTAGNt3?tk=D8tJTndQpoE MF287 「STM32F103VET6系统板 核心板 开发板 STM32系统板 工业级 小尺寸」 点击链接直接打开 或者 淘宝搜索直接打开',
|
||
NULL, NULL, @c_wh_B01, @u_wh_kuai, '块',
|
||
'active', 1, '2026-09-29 06:24:26', '2026-09-29 06:24:26'),
|
||
(@org_wh, 'B010079', '香橙派Pi5',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, NULL, '',
|
||
'obsolete', 1, '2026-10-13 07:09:15', '2026-10-13 07:11:26'),
|
||
(@org_wh, 'B010080', '香橙派开发板Pi 3B',
|
||
'', '外购', NULL,
|
||
NULL, NULL, @c_wh_B01, NULL, '',
|
||
'active', 1, '2026-10-13 07:09:15', '2026-10-13 07:11:13'),
|
||
(@org_wh, 'B020053', '硅胶按键',
|
||
'', NULL, NULL,
|
||
NULL, NULL, @c_wh_B02, @u_wh_pcs, '件',
|
||
'active', 1, '2026-10-13 07:26:02', '2026-10-13 07:26:02'),
|
||
(@org_wh, 'F010003', '按键模组',
|
||
'', NULL, NULL,
|
||
NULL, NULL, @c_wh_F01, @u_wh_pcs, '件',
|
||
'active', 1, '2026-10-13 07:27:22', '2026-10-13 07:27:22')
|
||
AS new
|
||
ON DUPLICATE KEY UPDATE
|
||
name = new.name, spec = new.spec, source = new.source, remark = new.remark,
|
||
supplier_id = new.supplier_id, manufacturer_id = new.manufacturer_id,
|
||
category_id = new.category_id, base_unit_id = new.base_unit_id, unit = new.unit,
|
||
status = new.status, updated_at = new.updated_at;
|
||
|
||
-- ---------- 变更日志 → material_logs ----------
|
||
-- 源表没有操作类型,统一记作 update;修改原因进 description。
|
||
-- 不导用户账号,operator_id 留空,operator 存源里的用户名。
|
||
-- ===== 北京:15 条 =====
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"鸣志电机","remark":"","source":"外购","spec":"ESF32016H24-S001","supplier":"上海鸣志","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"鸣志电机","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}',
|
||
'xianwei', '原型号不带编码器现在更换为带编码器的', '2026-09-15 09:00:32'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-15 09:00:32'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"鸣志电机","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"鸣志电机","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}',
|
||
'xianwei', '以电机使用功能命名', '2026-09-17 06:59:33'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 06:59:33'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"鸣志电机","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"鸣志电机-俯仰-进给","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}',
|
||
'xianwei', '以电机功能进行命名', '2026-09-17 07:00:16'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:00:16'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"博通","material_code":"B010202","material_name":"博通多圈绝对值编码器","remark":"","source":"外购","spec":"AS20-M42M-B11","supplier":"","type_code":"B01","unit":"个"}', '{"drawing_no":"","manufacturer":"博通","material_code":"B010202","material_name":"进给自由度-博通多圈绝对值编码器","remark":"","source":"外购","spec":"AS20-M42M-B11","supplier":"","type_code":"B01","unit":"个"}',
|
||
'xianwei', '修改名称', '2026-09-17 07:01:13'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010202'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:01:13'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"鑫拓智能","material_code":"A020201","material_name":"鑫拓智能谐波减速器","remark":"","source":"外购","spec":"HD Mini-05","supplier":"鑫拓智能","type_code":"A02","unit":"个"}', '{"drawing_no":"","manufacturer":"鑫拓智能","material_code":"A020201","material_name":"俯仰关节-鑫拓智能谐波减速器","remark":"","source":"外购","spec":"HD Mini-05","supplier":"鑫拓智能","type_code":"A02","unit":"个"}',
|
||
'xianwei', '修改名称', '2026-09-17 07:01:29'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'A020201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:01:29'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"鑫拓智能","material_code":"A020201","material_name":"俯仰关节-鑫拓智能谐波减速器","remark":"","source":"外购","spec":"HD Mini-05","supplier":"鑫拓智能","type_code":"A02","unit":"个"}', '{"drawing_no":"","manufacturer":"鑫拓智能","material_code":"A020201","material_name":"RCM俯仰关节-鑫拓智能谐波减速器","remark":"","source":"外购","spec":"HD Mini-05","supplier":"鑫拓智能","type_code":"A02","unit":"个"}',
|
||
'xianwei', '修改名称', '2026-09-17 07:01:54'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'A020201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:01:54'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"博通","material_code":"B010202","material_name":"进给自由度-博通多圈绝对值编码器","remark":"","source":"外购","spec":"AS20-M42M-B11","supplier":"","type_code":"B01","unit":"个"}', '{"drawing_no":"","manufacturer":"博通","material_code":"B010202","material_name":"RCM进给自由度-博通多圈绝对值编码器","remark":"","source":"外购","spec":"AS20-M42M-B11","supplier":"","type_code":"B01","unit":"个"}',
|
||
'xianwei', '修改名称', '2026-09-17 07:02:08'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010202'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:02:08'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"鸣志电机-俯仰-进给","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"RCM俯仰-进给-鸣志电机","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}',
|
||
'xianwei', '修改名称', '2026-09-17 07:02:31'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:02:31'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"鑫拓智能","material_code":"A020201","material_name":"RCM俯仰关节-鑫拓智能谐波减速器","remark":"","source":"外购","spec":"HD Mini-05","supplier":"鑫拓智能","type_code":"A02","unit":"个"}', '{"drawing_no":"","manufacturer":"鑫拓智能","material_code":"A020201","material_name":"RCM俯仰关节-谐波减速器","remark":"","source":"外购","spec":"HD Mini-05","supplier":"鑫拓智能","type_code":"A02","unit":"个"}',
|
||
'xianwei', '修改名成', '2026-09-17 07:04:23'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'A020201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:04:23'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"博通","material_code":"B010202","material_name":"RCM进给自由度-博通多圈绝对值编码器","remark":"","source":"外购","spec":"AS20-M42M-B11","supplier":"","type_code":"B01","unit":"个"}', '{"drawing_no":"","manufacturer":"博通","material_code":"B010202","material_name":"RCM进给自由度-多圈绝对值编码器","remark":"","source":"外购","spec":"AS20-M42M-B11","supplier":"","type_code":"B01","unit":"个"}',
|
||
'xianwei', '修改名称', '2026-09-17 07:04:39'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010202'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:04:39'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"RCM俯仰-进给-鸣志电机","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"上海鸣志","material_code":"B010201","material_name":"RCM俯仰-进给-电机","remark":"","source":"外购","spec":"ESF32016H48-S003+I32-2052","supplier":"上海鸣志","type_code":"B01","unit":""}',
|
||
'xianwei', '修改名称', '2026-09-17 07:05:29'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'B010201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 07:05:29'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A040203","material_name":"MX26-0820-1647","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"A040203","material_name":"旋转件1","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":""}',
|
||
'luomabiao', '命名统一', '2026-09-28 06:23:40'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'A040203'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:23:40'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A040202","material_name":"MX26-0820-1619","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"A040202","material_name":"旋转件2-2","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":""}',
|
||
'luomabiao', '命名统一', '2026-09-28 06:24:15'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'A040202'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:24:15'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A040201","material_name":"MX26-0820-1618","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"A040201","material_name":"旋转件2-1","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":""}',
|
||
'luomabiao', '命名统一', '2026-09-28 06:24:29'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'A040201'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:24:29'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A040211","material_name":"LJJ镊子从端-005","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":"Pcs"}', '{"drawing_no":"","manufacturer":"","material_code":"A040211","material_name":"LJJ镊子从端-006","remark":"","source":"外协","spec":"","supplier":"","type_code":"A04","unit":"Pcs"}',
|
||
'luomabiao', '名称重复', '2026-10-10 07:54:57'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_bj
|
||
AND m.material_code = 'A040211'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-10 07:54:57'
|
||
);
|
||
|
||
-- ===== 武汉:30 条 =====
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A050202","material_name":"治疗头线缆","remark":"","source":"外协","spec":"","supplier":"","type_code":"A05","unit":"米"}', '{"drawing_no":"","manufacturer":"","material_code":"A050202","material_name":"治疗头线缆","remark":"","source":"外协","spec":"","supplier":"","type_code":"A05","unit":"厘米"}',
|
||
'xiongsheng', '修改单位', '2026-09-11 08:04:03'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'A050086'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-11 08:04:03'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010069","material_name":"功率放大板","remark":"","source":"","spec":"3.3V高速8路PMOS","supplier":"海葵星","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010069","material_name":"功率放大板","remark":"","source":"","spec":"3.3V高速8路NMOS","supplier":"海葵星","type_code":"B01","unit":""}',
|
||
'xianwei', '参数填写错误', '2026-09-17 11:18:58'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010069'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-17 11:18:58'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A020007","material_name":"主机外壳组件","remark":"","source":"外协","spec":"XWRM-03","supplier":"","type_code":"A02","unit":"套"}', '{"drawing_no":"","manufacturer":"","material_code":"F010007","material_name":"主机外壳组件","remark":"","source":"外协","spec":"XWRM-03","supplier":"","type_code":"F01","unit":"套"}',
|
||
'xianwei', '外壳组件由物料改为半成品', '2026-09-18 05:45:31'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010007'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-18 05:45:31'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A020006","material_name":"主机外壳组件","remark":"","source":"外协","spec":"XWRM-02","supplier":"","type_code":"A02","unit":"套"}', '{"drawing_no":"","manufacturer":"","material_code":"F010006","material_name":"主机外壳组件","remark":"","source":"外协","spec":"XWRM-02","supplier":"","type_code":"F01","unit":"套"}',
|
||
'xianwei', '主机外壳组件由物料改为半成品', '2026-09-18 05:46:15'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010006'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-18 05:46:15'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010047","material_name":"主控板","remark":"","source":"外协","spec":"","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"F010047","material_name":"主控板","remark":"","source":"外协","spec":"","supplier":"","type_code":"F01","unit":"件"}',
|
||
'xianwei', '主控板由物料改为半成品', '2026-09-18 05:46:40'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010047'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-18 05:46:40'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A050085","material_name":"治疗头线缆组件","remark":"","source":"外协","spec":"","supplier":"","type_code":"A05","unit":"套"}', '{"drawing_no":"","manufacturer":"","material_code":"F010085","material_name":"治疗头线缆组件","remark":"","source":"外协","spec":"","supplier":"","type_code":"F01","unit":"套"}',
|
||
'xianwei', '治疗头线缆组件由物料改为半成品', '2026-09-18 05:51:12'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010085'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-18 05:51:12'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B020049","material_name":"气路组件","remark":"","source":"自制","spec":"","supplier":"","type_code":"B02","unit":"套"}', '{"drawing_no":"","manufacturer":"","material_code":"F010049","material_name":"气路组件","remark":"","source":"自制","spec":"","supplier":"","type_code":"F01","unit":"套"}',
|
||
'xianwei', '气路组件由物料改为半成品', '2026-09-18 06:47:57'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010049'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-18 06:47:57'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010046","material_name":"通用电源板","remark":"","source":"外协","spec":"","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010046","material_name":"电源板","remark":"","source":"外协","spec":"","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '通用电源板改为电源板', '2026-09-18 06:50:07'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010046'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-18 06:50:07'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010056","material_name":"硬板PI膜","remark":"","source":"外协","spec":"","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"F010056","material_name":"硬板PI膜","remark":"","source":"自制","spec":"","supplier":"","type_code":"F01","unit":"件"}',
|
||
'xianwei', '改为中间品', '2026-09-23 14:43:45'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010056'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-23 14:43:45'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"F010056","material_name":"硬板PI膜","remark":"","source":"自制","spec":"","supplier":"","type_code":"F01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"F010056","material_name":"硬板PI膜(芯片)","remark":"","source":"自制","spec":"","supplier":"","type_code":"F01","unit":"件"}',
|
||
'xianwei', '芯片', '2026-09-23 14:59:35'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010056'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-23 14:59:35'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010072","material_name":"PI膜","remark":"","source":"","spec":"","supplier":"","type_code":"B01","unit":"个"}', '{"drawing_no":"","manufacturer":"","material_code":"B010072","material_name":"PI膜(芯片)","remark":"","source":"","spec":"","supplier":"","type_code":"B01","unit":"个"}',
|
||
'xianwei', '芯片', '2026-09-23 15:01:47'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010072'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-23 15:01:47'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"F010085","material_name":"治疗头线缆组件","remark":"","source":"外协","spec":"","supplier":"","type_code":"F01","unit":"套"}', '{"drawing_no":"","manufacturer":"","material_code":"F010085","material_name":"治疗头线缆组件(二代)","remark":"","source":"外协","spec":"","supplier":"","type_code":"F01","unit":"套"}',
|
||
'xianwei', '二代', '2026-09-23 15:25:12'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010085'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-23 15:25:12'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"A010001","material_name":"治疗头线缆组件(一代)","remark":"","source":"外协","spec":"","supplier":"","type_code":"A01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"F010002","material_name":"治疗头线缆组件(一代)","remark":"","source":"外协","spec":"","supplier":"","type_code":"F01","unit":""}',
|
||
'xianwei', '半成品', '2026-09-23 15:28:10'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'F010002'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-23 15:28:10'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010048","material_name":"触摸屏","remark":"","source":"外购","spec":"","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010048","material_name":"触摸屏10.1寸","remark":"","source":"外购","spec":"10.1寸","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '添加规格', '2026-09-28 06:14:11'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010048'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:14:11'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"数码屏","remark":"","source":"外购","spec":"","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"10寸数码屏","remark":"","source":"外购","spec":"","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '10寸', '2026-09-28 06:15:03'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010059'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:15:03'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"10寸数码屏","remark":"","source":"外购","spec":"","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"8寸显示屏","remark":"","source":"外购","spec":"","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '8寸', '2026-09-28 06:15:42'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010059'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:15:42'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010077","material_name":"香橙派开发板Pi 5","remark":"https://item.taobao.com/item.htm?from=cart\\u0026id=694426579648\\u0026isabs=detail\\u0026mi_id=0000Yq1EqNjBiWluUgqbKkRAsDDsHWyfCslQH1T9MsFF1Sg\\u0026spm=a1z0d.6639537%2F202410.item.d694426579648.34747484e3AbaM","source":"","spec":"Orange Pi 5","supplier":"","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010077","material_name":"香橙派开发板Pi 5","remark":"https://item.taobao.com/item.htm?from=cart\\u0026id=694426579648\\u0026isabs=detail\\u0026mi_id=0000Yq1EqNjBiWluUgqbKkRAsDDsHWyfCslQH1T9MsFF1Sg\\u0026spm=a1z0d.6639537%2F202410.item.d694426579648.34747484e3AbaM","source":"","spec":"Orange Pi 5; 4G","supplier":"","type_code":"B01","unit":"块"}',
|
||
'xianwei', '添加4G参数', '2026-09-28 06:18:49'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010077'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:18:49'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"8寸显示屏","remark":"","source":"外购","spec":"","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"触摸屏8寸","remark":"","source":"外购","spec":"8寸","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '统一屏幕命名风格', '2026-09-28 06:25:51'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010059'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:25:51'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"触摸屏8寸","remark":"","source":"外购","spec":"8寸","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"触摸屏8寸","remark":"https://item.taobao.com/item.htm?from=cart\\u0026id=749116190950\\u0026mi_id=000086DKOQjDf9p_N94ymKsE2dWs-QKiH_b2Om7xRMRWkkU\\u0026skuId=5940217905947\\u0026spm=a1z0d.6639537%2F202410.item.d749116190950.34747484e3AbaM\\u0026upStreamPrice=28800\\u0026xxc=shop","source":"外购","spec":"8寸","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '增加采购网址', '2026-09-28 06:28:27'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010059'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:28:27'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010076","material_name":"触摸屏8寸","remark":"https://item.taobao.com/item.htm?from=cart\\u0026id=749116190950\\u0026mi_id=000086DKOQjDf9p_N94ymKsE2dWs-QKiH_b2Om7xRMRWkkU\\u0026skuId=5940217905947\\u0026spm=a1z0d.6639537%2F202410.item.d749116190950.34747484e3AbaM\\u0026upStreamPrice=28800\\u0026xxc=shop","source":"","spec":"8寸","status":"active","supplier":"","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010076","material_name":"触摸屏8寸","remark":"https://item.taobao.com/item.htm?from=cart\\u0026id=749116190950\\u0026mi_id=000086DKOQjDf9p_N94ymKsE2dWs-QKiH_b2Om7xRMRWkkU\\u0026skuId=5940217905947\\u0026spm=a1z0d.6639537%2F202410.item.d749116190950.34747484e3AbaM\\u0026upStreamPrice=28800\\u0026xxc=shop","source":"","spec":"8寸","status":"voided","supplier":"","type_code":"B01","unit":""}',
|
||
'xianwei', '与B010059重复', '2026-09-28 06:47:57'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010076'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 06:47:57'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"触摸屏8寸","remark":"https://item.taobao.com/item.htm?from=cart\\u0026id=749116190950\\u0026mi_id=000086DKOQjDf9p_N94ymKsE2dWs-QKiH_b2Om7xRMRWkkU\\u0026skuId=5940217905947\\u0026spm=a1z0d.6639537%2F202410.item.d749116190950.34747484e3AbaM\\u0026upStreamPrice=28800\\u0026xxc=shop","source":"外购","spec":"8寸","status":"active","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010059","material_name":"触摸屏8寸","remark":"https://item.taobao.com/item.htm?from=cart\\u0026id=749116190950\\u0026mi_id=000086DKOQjDf9p_N94ymKsE2dWs-QKiH_b2Om7xRMRWkkU\\u0026skuId=5940217905947\\u0026spm=a1z0d.6639537%2F202410.item.d749116190950.34747484e3AbaM\\u0026upStreamPrice=28800\\u0026xxc=shop","source":"外购","spec":"8寸","status":"active","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '添加规格书', '2026-09-28 08:43:20'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010059'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 08:43:20'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010048","material_name":"触摸屏10.1寸","remark":"","source":"外购","spec":"10.1寸","status":"active","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010048","material_name":"触摸屏10.1寸","remark":"","source":"外购","spec":"10.1寸","status":"active","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '添加规格书', '2026-09-28 08:43:36'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010048'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-09-28 08:43:36'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010048","material_name":"触摸屏10.1寸","remark":"","source":"外购","spec":"10.1寸","status":"active","supplier":"","type_code":"B01","unit":"件"}', '{"drawing_no":"","manufacturer":"","material_code":"B010048","material_name":"触摸屏10.1寸","remark":"","source":"外购","spec":"10.1寸","status":"active","supplier":"","type_code":"B01","unit":"件"}',
|
||
'xianwei', '更新文件', '2026-10-10 11:57:41'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010048'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-10 11:57:41'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010068","material_name":"香橙派CM4核心板","remark":"","source":"","spec":"2G+32G","status":"active","supplier":"香橙派","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010068","material_name":"香橙派CM4核心板","remark":"","source":"","spec":"2G+32G","status":"voided","supplier":"香橙派","type_code":"B01","unit":""}',
|
||
'xianwei', '更换型号', '2026-10-13 07:04:57'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010068'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-13 07:04:57'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010067","material_name":"香橙派CM4底板","remark":"","source":"","spec":"2G+32G","status":"active","supplier":"香橙派","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010067","material_name":"香橙派CM4底板","remark":"","source":"","spec":"2G+32G","status":"voided","supplier":"香橙派","type_code":"B01","unit":""}',
|
||
'xianwei', '型号变更', '2026-10-13 07:07:15'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010067'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-13 07:07:15'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010080","material_name":"香橙派Pi3B","remark":"","source":"外购","spec":"","status":"active","supplier":"","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010080","material_name":"香橙派Pi 3B","remark":"","source":"外购","spec":"","status":"active","supplier":"","type_code":"B01","unit":""}',
|
||
'xianwei', '名称修改', '2026-10-13 07:10:59'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010080'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-13 07:10:59'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010080","material_name":"香橙派Pi 3B","remark":"","source":"外购","spec":"","status":"active","supplier":"","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010080","material_name":"香橙派开发板Pi 3B","remark":"","source":"外购","spec":"","status":"active","supplier":"","type_code":"B01","unit":""}',
|
||
'xianwei', '名称修改', '2026-10-13 07:11:13'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010080'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-13 07:11:13'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010079","material_name":"香橙派Pi5","remark":"","source":"外购","spec":"","status":"active","supplier":"","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010079","material_name":"香橙派Pi5","remark":"","source":"外购","spec":"","status":"voided","supplier":"","type_code":"B01","unit":""}',
|
||
'xianwei', '物料重复', '2026-10-13 07:11:26'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010079'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-13 07:11:26'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010068","material_name":"香橙派CM4核心板","remark":"","source":"","spec":"2G+32G","status":"voided","supplier":"香橙派","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010068","material_name":"香橙派CM4核心板","remark":"","source":"","spec":"2G+32G","status":"active","supplier":"香橙派","type_code":"B01","unit":""}',
|
||
'xianwei', '恢复物料编码', '2026-10-13 07:56:31'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010068'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-13 07:56:31'
|
||
);
|
||
INSERT INTO material_logs
|
||
(operation_type, material_id, operator_id, old_value, new_value, operator, description, created_at)
|
||
SELECT 'update', m.id, NULL,
|
||
'{"drawing_no":"","manufacturer":"","material_code":"B010067","material_name":"香橙派CM4底板","remark":"","source":"","spec":"2G+32G","status":"voided","supplier":"香橙派","type_code":"B01","unit":""}', '{"drawing_no":"","manufacturer":"","material_code":"B010067","material_name":"香橙派CM4底板","remark":"","source":"","spec":"2G+32G","status":"active","supplier":"香橙派","type_code":"B01","unit":""}',
|
||
'xianwei', '恢复物料编码', '2026-10-13 07:56:37'
|
||
FROM materials m
|
||
WHERE m.organization_id = @org_wh
|
||
AND m.material_code = 'B010067'
|
||
AND NOT EXISTS (
|
||
SELECT 1 FROM material_logs l
|
||
WHERE l.material_id = m.id AND l.operation_type = 'update'
|
||
AND l.created_at = '2026-10-13 07:56:37'
|
||
);
|
||
|
||
-- ---------- 编码规则 ----------
|
||
-- 各分类下一个可用序号 = 已导入物料的最大序号 + 1。
|
||
-- 不更新的话,用户新增物料会撞上已有编码。
|
||
-- 北京
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_A01, 'A01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_A02, 'A02', 4, 202, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 202);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_A03, 'A03', 4, 203, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 203);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_A04, 'A04', 4, 212, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 212);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_A05, 'A05', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_A06, 'A06', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_A07, 'A07', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_B01, 'B01', 4, 203, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 203);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_B02, 'B02', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_B03, 'B03', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_B04, 'B04', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_B05, 'B05', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_B06, 'B06', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_B07, 'B07', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_C01, 'C01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_C02, 'C02', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_C03, 'C03', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_D01, 'D01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_D02, 'D02', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_D03, 'D03', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_D04, 'D04', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_E01, 'E01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_E02, 'E02', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_F01, 'F01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_F02, 'F02', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_F03, 'F03', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_F04, 'F04', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_bj, @c_bj_F05, 'F05', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
|
||
-- 武汉
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_A01, 'A01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_A02, 'A02', 4, 6, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 6);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_A03, 'A03', 4, 19, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 19);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_A04, 'A04', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_A05, 'A05', 4, 88, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 88);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_B01, 'B01', 4, 81, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 81);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_B02, 'B02', 4, 54, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 54);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_B03, 'B03', 4, 8, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 8);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_C01, 'C01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_D01, 'D01', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_D02, 'D02', 4, 7, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 7);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_E01, 'E01', 4, 2, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 2);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_E02, 'E02', 4, 13, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 13);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_E03, 'E03', 4, 8, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 8);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_E04, 'E04', 4, 2, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 2);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_E05, 'E05', 4, 1, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 1);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_F01, 'F01', 4, 86, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 86);
|
||
INSERT INTO code_rules (organization_id, category_id, prefix, sequence_length, next_sequence, status)
|
||
SELECT @org_wh, @c_wh_F02, 'F02', 4, 9, 'active'
|
||
ON DUPLICATE KEY UPDATE next_sequence = GREATEST(next_sequence, 9);
|