
-- ----------------------------
-- 二维码规则
-- 日期20200917
-- ----------------------------
-- DROP TABLE IF EXISTS `siger_tr_serinumCfg`;
CREATE TABLE `siger_tr_serinumCfg` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ProjectId` int(7) NOT NULL,
  `Rule` int(10) DEFAULT NULL COMMENT '规则类型 1:sn 2:box',
  `Seq` int(7) DEFAULT NULL,
  `ProductID` varchar(200) DEFAULT NULL,
  `ItemType` int(7) DEFAULT '0',
  `TypeFormat` varchar(20) DEFAULT NULL,
  `ItemValue` varchar(500) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT '1',
  `length` int(10) DEFAULT NULL COMMENT '长度',
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
SET FOREIGN_KEY_CHECKS=1;

-- ----------------------------
-- 打印机配置
-- 日期20200917
-- ----------------------------
SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for siger_tr_printer_setting
-- ----------------------------
-- DROP TABLE IF EXISTS `siger_tr_printer_setting`;
CREATE TABLE `siger_tr_printer_setting` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `projectid` int(11) NOT NULL,
  `line` int(20) NOT NULL,
  `station` int(20) NOT NULL,
  `printtype` varchar(80) NOT NULL,
  `port` varchar(80) NOT NULL,
  `uid` varchar(20) DEFAULT NULL,
  `printername` varchar(200) NOT NULL,
  `transdatetime` datetime DEFAULT NULL,
  `status` int(1) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
SET FOREIGN_KEY_CHECKS=1;

-- ----------------------------
-- 打印机模板
-- 日期20200917
-- ----------------------------
SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for siger_tr_printer_labelfile
-- ----------------------------
-- DROP TABLE IF EXISTS `siger_tr_printer_labelfile`;
CREATE TABLE `siger_tr_printer_labelfile` (
  `id` int NOT NULL AUTO_INCREMENT,
  `projectid` int NOT NULL,
  `ProductID` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `PN` varchar(20) NOT NULL,
  `LabelFileName` varchar(80) NOT NULL,
  `FilePath` varchar(200) NOT NULL,
  `UID` varchar(20) DEFAULT NULL,
  `TransDateTime` datetime DEFAULT NULL,
  `labeltype` varchar(20) DEFAULT NULL,
  `Status` int NOT NULL,
  `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '图片说明',
  `Printtype` int DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
SET FOREIGN_KEY_CHECKS=1;


-- ----------------------------
-- 打印机模板关系维护
-- 日期20200928
-- ----------------------------
SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for siger_tr_printer_relation
-- ----------------------------
--DROP TABLE IF EXISTS `siger_tr_printer_relation`;
CREATE TABLE `siger_tr_printer_relation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `projectid` int NOT NULL,
  `fileid` int NOT NULL,
  `txt_parameters` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `table_name` int NOT NULL,
  `table_parameters` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `status` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
SET FOREIGN_KEY_CHECKS=1;


ALTER TABLE siger_tr_printer_labelfile ADD COLUMN printtype int(11) DEFAULT 0 COMMENT 'printtype';
ALTER TABLE siger_tr_sn_list ADD COLUMN WoType varchar(100) DEFAULT "" COMMENT '订单类型';
ALTER TABLE siger_tr_printer_labelfile ADD COLUMN printCount int(11) DEFAULT 0 COMMENT 'printCount';
ALTER TABLE siger_tr_assemb_details ADD COLUMN number int(11) DEFAULT 0 COMMENT 'number';
ALTER TABLE siger_qms_inspection_standard ADD COLUMN image varchar(255) DEFAULT "" COMMENT 'image';
ALTER TABLE siger_tr_sn_trace ADD COLUMN type int(11) DEFAULT 0 COMMENT 'type';


-- ----------------------------
-- Table structure for siger_tr_assist_materials
-- ----------------------------
-- DROP TABLE IF EXISTS `siger_tr_assist_materials`;
CREATE TABLE `siger_tr_assist_materials` (
  `id` int NOT NULL AUTO_INCREMENT,
  `productcode` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '产品编号',
  `workordertype` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '工单类型',
  `wo` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '工单号',
  `batch` varchar(500) NOT NULL COMMENT '批次号码',
  `serial` varchar(500) NOT NULL COMMENT '序号',
  `transdatetime` datetime NOT NULL COMMENT '同步时间',
  `lastupdatetime` datetime NOT NULL COMMENT '最后更新时间',
  `specification` varchar(255) NOT NULL DEFAULT '' COMMENT '规格',
  `pn` varchar(255) NOT NULL DEFAULT '' COMMENT '料号',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '辅料名称',
  `number` int NOT NULL DEFAULT '0' COMMENT '数量',
  `status` int NOT NULL DEFAULT '1',
  `projectId` int NOT NULL DEFAULT '0',
  `printCount` int NOT NULL DEFAULT '0' COMMENT '打印次数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
SET FOREIGN_KEY_CHECKS=1;