-- ---------------------------- -- 1、OPC配置 -- ---------------------------- drop table if exists sc_opc_conf; create table sc_opc_conf ( id bigint(20) not null auto_increment comment '主键id', location_code varchar(16) default null comment '工位编码', location_name varchar(32) default null comment '工位名称', node varchar(64) default '' comment '地址', type char(1) default '' comment '采集类型', subscribe char(1) default '0' comment '是否订阅', del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)', create_by varchar(64) default '' comment '创建者', create_time datetime comment '创建时间', update_by varchar(64) default '' comment '更新者', update_time datetime comment '更新时间', primary key (id) ) engine=innodb auto_increment=1 comment = 'OPC交互配置'; -- ---------------------------- -- 2、参数采集配置 -- ---------------------------- drop table if exists sc_opc_conf; create table sc_collection_param_conf ( id bigint(20) not null auto_increment comment '主键id', product_code varchar(64) default '' comment '产品编码', product_type varchar(64) default '' comment '产品型号', location_code varchar(16) default null comment '工位编码', param_code varchar(32) default null comment '参数编码', param_name varchar(32) default null comment '参数名称', param_set_code varchar(32) default null comment '参数集编码', param_set_name varchar(32) default null comment '参数集名称', node varchar(64) default '' comment '采集地址', type char(1) default '' comment '采集类型(1物料追溯,2拧紧追溯,其他)', unit varchar(16) default '' comment '单位', param_upper varchar(64) default '' comment '上限值', param_lower varchar(64) default '' comment '下限值', param_central varchar(64) default '' comment '中心值', order_num int(4) default 0 comment '显示顺序', subscribe char(1) default '0' comment '是否订阅', del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)', create_by varchar(64) default '' comment '创建者', create_time datetime comment '创建时间', update_by varchar(64) default '' comment '更新者', update_time datetime comment '更新时间', primary key (id) ) engine=innodb auto_increment=1 comment = '参数采集配置'; -- ---------------------------- -- 1、拧紧追溯 -- ---------------------------- drop table if exists da_tighten_collection; create table da_tighten_collection ( id bigint(20) not null auto_increment comment '主键id', sfc_code varchar(64) default null comment '总成序列号', location_code varchar(16) default null comment '工位编码', param_set_code varchar(32) default null comment '参数集编码', param_set_name varchar(32) default null comment '参数集名称', torque varchar(64) default '' comment '扭矩值', torque_status char(1) default '' comment '扭矩状态', angle varchar(64) default '' comment '角度值', angle_status char(1) default '' comment '角度状态', collect_time datetime comment '采集时间', primary key (id) ) engine=innodb auto_increment=1 comment = '拧紧采集'; -- ---------------------------- -- 1、物料追溯 -- ---------------------------- drop table if exists da_material_collection; create table da_material_collection ( id bigint(20) not null auto_increment comment '主键id', sfc_code varchar(64) default null comment '总成序列号', location_code varchar(16) default null comment '工位编码', param_code varchar(32) default null comment '参数编码', param_name varchar(32) default null comment '参数名称', param_value varchar(64) default '' comment '参数值', collect_time datetime comment '采集时间', primary key (id) ) engine=innodb auto_increment=1 comment = '拧紧采集'; -- ---------------------------- -- 1、参数采集 -- ---------------------------- drop table if exists da_param_collection; create table da_param_collection ( id bigint(20) not null auto_increment comment '主键id', sfc_code varchar(64) default null comment '总成序列号', location_code varchar(16) default null comment '工位编码', param_code varchar(32) default null comment '参数编码', param_name varchar(32) default null comment '参数名称', param_value varchar(64) default '' comment '参数值', collect_time datetime comment '采集时间', primary key (id) ) engine=innodb auto_increment=1 comment = '参数采集'; -- ---------------------------- -- 1、过站采集 -- ---------------------------- drop table if exists da_station_collection; create table da_station_collection ( id bigint(20) not null auto_increment comment '主键id', sfc_code varchar(64) default null comment '总成序列号', location_code varchar(16) default null comment '工位编码', inbound_time datetime comment '进站时间', outbound_time datetime comment '出站时间', status char(1) default '' comment '状态(1合格0不合格)', collect_time datetime comment '采集时间', primary key (id) ) engine=innodb auto_increment=1 comment = '过站采集';