From 3f300e05e9a6849b282e4d7b8ff19df26460a92c Mon Sep 17 00:00:00 2001 From: 86156 <823267011@qq.com> Date: Sun, 19 Apr 2026 14:27:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=A7=84=E7=A8=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/sql/mysql/spec.sql | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 script/sql/mysql/spec.sql diff --git a/script/sql/mysql/spec.sql b/script/sql/mysql/spec.sql new file mode 100644 index 00000000..6edb883b --- /dev/null +++ b/script/sql/mysql/spec.sql @@ -0,0 +1,83 @@ +create table wms_process_spec +( + spec_id bigint auto_increment comment '规程ID' + primary key, + spec_code varchar(50) not null comment '规程编号', + spec_name varchar(100) not null comment '规程名称', + spec_type varchar(20) not null comment '规程类型(PROCESS=工艺规程,STANDARD=工艺标准)', + line_id bigint not null comment '产线ID', + product_type varchar(50) null comment '产品类型(如HB)', + is_enabled tinyint(1) default 1 not null comment '是否启用', + remark varchar(255) null comment '备注', + create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间', + create_by varchar(50) null comment '创建人', + update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间', + update_by varchar(50) null comment '更新人', + constraint uk_spec_code + unique (spec_code) +) + comment '规程/工艺标准主表' + engine = InnoDB + row_format = DYNAMIC; + + +create table wms_process_spec_version +( + version_id bigint auto_increment comment '版本ID' + primary key, + spec_id bigint not null comment '规程ID', + version_code varchar(50) not null comment '版本号', + is_active tinyint(1) default 0 not null comment '是否当前生效版本', + status tinyint(1) default 1 not null comment '状态(0=禁用,1=启用)', + remark varchar(255) null comment '备注', + create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间', + create_by varchar(50) null comment '创建人', + update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间', + update_by varchar(50) null comment '更新人', + constraint uk_spec_version + unique (spec_id, version_code) +) + comment '规程版本表' + engine = InnoDB + row_format = DYNAMIC; + + +create table wms_process_plan +( + plan_id bigint auto_increment comment '方案ID' + primary key, + version_id bigint not null comment '版本ID', + segment_type varchar(50) not null comment '段类型(入口段/工艺段/出口段)', + segment_name varchar(100) not null comment '段名称', + point_name varchar(100) not null comment '点位名称', + point_code varchar(100) null comment '点位编码', + actual_point_id bigint null comment '实际点位ID(设备点位)', + unit varchar(20) null comment '单位', + remark varchar(255) null comment '备注', + create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间', + create_by varchar(50) null comment '创建人', + update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间', + update_by varchar(50) null comment '更新人' +) + comment '方案详情(段+点位)' + engine = InnoDB + row_format = DYNAMIC; + +create table wms_process_plan_param +( + param_id bigint auto_increment comment '参数ID' + primary key, + plan_id bigint not null comment '方案ID', + param_name varchar(100) not null comment '参数名称(如L1设定值)', + target_value decimal(18, 4) null comment '设定值', + lower_limit decimal(18, 4) null comment '下限', + upper_limit decimal(18, 4) null comment '上限', + unit varchar(20) null comment '单位', + create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间', + create_by varchar(50) null comment '创建人', + update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间', + update_by varchar(50) null comment '更新人' +) + comment '方案参数配置' + engine = InnoDB + row_format = DYNAMIC;