加入规程管理sql

This commit is contained in:
2026-04-19 14:29:57 +08:00
parent deb684ce27
commit cdcf5e2428

View File

@@ -7,7 +7,8 @@ create table wms_process_spec
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 '是否启用',
is_enabled tinyint(1) default 1 not null comment '是否启用0=否1=是)',
del_flag tinyint(1) default 0 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 '创建人',
@@ -27,8 +28,9 @@ create table wms_process_spec_version
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 '是否当前生效版本',
is_active tinyint(1) default 0 not null comment '是否当前生效版本1=是)',
status tinyint(1) default 1 not null comment '状态0=禁用1=启用)',
del_flag tinyint(1) default 0 not null comment '删除标志',
remark varchar(255) null comment '备注',
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
create_by varchar(50) null comment '创建人',
@@ -41,25 +43,27 @@ create table wms_process_spec_version
engine = InnoDB
row_format = DYNAMIC;
create table wms_process_plan
(
plan_id bigint auto_increment comment '方案ID'
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 '更新'
version_id bigint not null comment '版本ID',
segment_type varchar(50) not null comment '段类型(INLET/PROCESS/OUTLET',
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设备点位',
sort_order int default 0 not null comment '排序',
del_flag tinyint(1) default 0 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 '更新人',
index idx_version_id (version_id)
)
comment '方案详情(段+点位'
comment '方案点位'
engine = InnoDB
row_format = DYNAMIC;
@@ -68,16 +72,22 @@ 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设定值',
param_code varchar(50) not null comment '参数编码TEMP/PRESS等',
param_name varchar(100) not null comment '参数名称',
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 '单位',
sort_order int default 0 not null comment '排序',
del_flag tinyint(1) default 0 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 '更新人'
update_by varchar(50) null comment '更新人',
index idx_plan_id (plan_id)
)
comment '方案参数配置'
comment '方案参数'
engine = InnoDB
row_format = DYNAMIC;