-- ----------------------------
-- Table structure for purchase_check_details
-- ----------------------------
DROP TABLE IF EXISTS `purchase_check_details`;
CREATE TABLE `purchase_check_details`  (
                                           `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                           `task_id` bigint(20) NOT NULL COMMENT '任务ID',
                                           `type_id` int(11) NOT NULL COMMENT '规格id',
                                           `purchase_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '采购单价',
                                           `purchase_num` int(11) NULL DEFAULT 0 COMMENT '采购数量',
                                           `check_num` int(11) NULL DEFAULT 0 COMMENT '验收数量',
                                           `bind_num` int(11) NULL DEFAULT 0 COMMENT '绑定数量',
                                           `check_result` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验收结论',
                                           `supplier_id` int(11) NULL DEFAULT NULL COMMENT '供应商id',
                                           `status` int(11) NULL DEFAULT NULL COMMENT '0-未验收,1-已验收,2-待通知,3-验收不通过,4-已入库,5-入库驳回,6-综合服务中心审核通过，7-综合服务中心不通过',
                                           `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
                                           `production_time` datetime NULL DEFAULT NULL COMMENT '出厂日期',
                                           `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                           `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
                                           `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                           `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
                                           `check_url_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验收图片',
                                           `check_url` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验收图片名称',
                                           `input_num` int(11) NULL DEFAULT 0 COMMENT '入库数量',
                                           `input_status` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '是否入库',
                                           `input_time` datetime NULL DEFAULT NULL COMMENT '入库时间',
                                           `file_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验收附件名称',
                                           `file_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验收附件',
                                           `company_id` int(11) NULL DEFAULT NULL COMMENT '数据所属组织',
                                           `del_flag` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '删除标志（0代表存在 2代表删除）',
                                           PRIMARY KEY (`id`) USING BTREE,
                                           INDEX `idx_task_id`(`task_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '新购验收任务详细表purchase_check_details' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for purchase_check_info
-- ----------------------------
DROP TABLE IF EXISTS `purchase_check_info`;
CREATE TABLE `purchase_check_info`  (
                                        `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                        `task_id` bigint(20) NOT NULL COMMENT '任务ID',
                                        `purchase_time` datetime NOT NULL COMMENT '采购日期',
                                        `arrival_time` datetime NULL DEFAULT NULL COMMENT '到货日期',
                                        `purchaser` int(11) NULL DEFAULT NULL COMMENT '采购员',
                                        `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
                                        `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                        `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
                                        `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                        `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
                                        `company_id` int(11) NULL DEFAULT NULL COMMENT '数据所属组织',
                                        `del_flag` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '删除标志（0代表存在 2代表删除）',
                                        PRIMARY KEY (`id`) USING BTREE,
                                        INDEX `idx_task_id`(`task_id`) USING BTREE,
                                        INDEX `idx_arrival_time`(`arrival_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '新购验收任务表purchase_check_info' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for purchase_macode_info
-- ----------------------------
DROP TABLE IF EXISTS `purchase_macode_info`;
CREATE TABLE `purchase_macode_info`  (
                                         `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                         `task_id` int(11) NOT NULL COMMENT '任务ID',
                                         `type_id` int(11) NOT NULL COMMENT '类型ID',
                                         `ma_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机具编号',
                                         `qr_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '二维码',
                                         `fix_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否是固定资产编号(0,是 1,否)',
                                         `code_type` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号类型',
                                         `status` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态（0,待入库 1,已入库）',
                                         `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
                                         `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                         `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
                                         `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                         `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
                                         `company_id` int(11) NULL DEFAULT NULL COMMENT '数据所属组织',
                                         `del_flag` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '删除标志（0代表存在 2代表删除）',
                                         PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '新购验收编号管理purchase_macode_info' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for purchase_part_details
-- ----------------------------
DROP TABLE IF EXISTS `purchase_part_details`;
CREATE TABLE `purchase_part_details`  (
                                          `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
                                          `task_id` int(11) NULL DEFAULT NULL COMMENT '任务ID',
                                          `part_id` int(11) NULL DEFAULT NULL COMMENT '配件id',
                                          `purchase_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '采购单价',
                                          `purchase_num` int(11) NULL DEFAULT 0 COMMENT '采购数量',
                                          `supplier_id` int(11) NULL DEFAULT NULL COMMENT '供应商id',
                                          `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
                                          `production_time` datetime NULL DEFAULT NULL COMMENT '出厂日期',
                                          `check_num` int(11) NULL DEFAULT 0 COMMENT '验收数量',
                                          `check_result` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验收结论',
                                          `input_num` int(11) NULL DEFAULT 0 COMMENT '入库数量',
                                          `input_time` datetime NULL DEFAULT NULL COMMENT '入库时间',
                                          `file_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
                                          `file_url` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件路径',
                                          `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                          `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
                                          `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                          `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
                                          `company_id` int(11) NULL DEFAULT NULL COMMENT '数据所属组织',
                                          `status` int(11) NULL DEFAULT 0 COMMENT '0待验收，1已验收 , 2,验收不通过 3,已入库 4，审核不通过',
                                          `del_flag` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '删除标志（0代表存在 2代表删除）',
                                          PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '新购配件验收任务详细表purchase_part_details' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for purchase_part_info
-- ----------------------------
DROP TABLE IF EXISTS `purchase_part_info`;
CREATE TABLE `purchase_part_info`  (
                                       `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
                                       `task_id` int(11) NULL DEFAULT NULL COMMENT '任务ID',
                                       `purchase_time` datetime NOT NULL COMMENT '采购日期',
                                       `arrival_time` datetime NULL DEFAULT NULL COMMENT '到货日期',
                                       `purchaser` int(11) NULL DEFAULT NULL COMMENT '采购员',
                                       `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
                                       `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                       `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
                                       `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                       `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
                                       `company_id` int(11) NULL DEFAULT NULL COMMENT '数据所属组织',
                                       `del_flag` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '删除标志（0代表存在 2代表删除）',
                                       PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '新购配件验收任务表purchase_part_info' ROW_FORMAT = DYNAMIC;
