mes-tm.sql 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. -- ----------------------------
  2. -- 1、工装夹具类型表
  3. -- ----------------------------
  4. drop table if exists tm_tool_type;
  5. create table tm_tool_type (
  6. tool_type_id bigint(20) not null auto_increment comment '工装夹具类型ID',
  7. tool_type_code varchar(64) not null comment '类型编码',
  8. tool_type_name varchar(255) not null comment '类型名称',
  9. code_flag char(1) default 'Y' not null comment '是否编码管理',
  10. mainten_type varchar(20) comment '保养维护类型',
  11. mainten_period int(11) comment '保养周期',
  12. remark varchar(500) default '' comment '备注',
  13. attr1 varchar(64) default null comment '预留字段1',
  14. attr2 varchar(255) default null comment '预留字段2',
  15. attr3 int(11) default 0 comment '预留字段3',
  16. attr4 int(11) default 0 comment '预留字段4',
  17. create_by varchar(64) default '' comment '创建者',
  18. create_time datetime comment '创建时间',
  19. update_by varchar(64) default '' comment '更新者',
  20. update_time datetime comment '更新时间',
  21. primary key (tool_type_id)
  22. ) engine=innodb auto_increment=200 comment = '工装夹具类型表';
  23. -- ----------------------------
  24. -- 2、工装夹具清单表
  25. -- ----------------------------
  26. drop table if exists tm_tool;
  27. create table tm_tool (
  28. tool_id bigint(20) not null auto_increment comment '工装夹具ID',
  29. tool_code varchar(64) comment '工装夹具编码',
  30. tool_name varchar(255) not null comment '工装夹具名称',
  31. brand varchar(255) comment '品牌',
  32. spec varchar(255) comment '型号',
  33. tool_type_id bigint(11) not null comment '工装夹具类型ID',
  34. tool_type_code varchar(64) comment '工装夹具类型编码',
  35. tool_type_name varchar(255) comment '工装夹具类型名称',
  36. code_flag char(1) default 'Y' not null comment '是否单独编码管理',
  37. quantity int(11) default 1 not null comment '数量',
  38. quantity_avail int(11) default 1 comment '可用数量',
  39. mainten_type varchar(20) comment '保养维护类型',
  40. next_mainten_period int(11) comment '下一次保养周期',
  41. next_mainten_date datetime comment '下一次保养日期',
  42. status varchar(64) default 'STORE' comment '状态[MES_TOOL_STATUS]',
  43. remark varchar(500) default '' comment '备注',
  44. attr1 varchar(64) default null comment '预留字段1',
  45. attr2 varchar(255) default null comment '预留字段2',
  46. attr3 int(11) default 0 comment '预留字段3',
  47. attr4 int(11) default 0 comment '预留字段4',
  48. create_by varchar(64) default '' comment '创建者',
  49. create_time datetime comment '创建时间',
  50. update_by varchar(64) default '' comment '更新者',
  51. update_time datetime comment '更新时间',
  52. primary key (tool_id)
  53. ) engine=innodb auto_increment=200 comment = '工装夹具清单表';