CREATE TABLE if not exists `pallet_match_log`
(
    `id`          varchar(255) NOT NULL COMMENT 'id',
    `pallet_no`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '托盘',
    `sku`         varchar(255)                                                  DEFAULT NULL COMMENT '物料/产品',
    `total_qty`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '数量',
    `order_nos`   varchar(2000)                                                 DEFAULT NULL COMMENT '所扫描出库单（多出库单以，隔开）',
    `location_id` varchar(255)                                                  DEFAULT NULL COMMENT '库位id',
    `agv_no`      varchar(255)                                                  DEFAULT NULL COMMENT 'agv车号',
    `remark`      varchar(255)                                                  DEFAULT NULL COMMENT '备注',
    `userdefine1` varchar(255)                                                  DEFAULT NULL,
    `userdefine2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci       DEFAULT NULL,
    `userdefine3` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci       DEFAULT NULL,
    `userdefine4` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci       DEFAULT NULL,
    `userdefine5` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci       DEFAULT NULL,
    `create_by`   varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  DEFAULT '' COMMENT '创建者',
    `create_time` datetime                                                      DEFAULT NULL COMMENT '创建时间',
    `update_by`   varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  DEFAULT '' COMMENT '更新者',
    `update_time` datetime                                                      DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='托盘匹配记录';

CREATE TABLE if not exists `stock_take_record` (
     `id` varchar(64) NOT NULL COMMENT 'id',
     `stock_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '盘点单号',
     `bar_code` varchar(255) DEFAULT NULL COMMENT '条形码',
     `scan_pallet` varchar(255) DEFAULT NULL COMMENT '扫描托盘',
     `stock_pallet` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '盘点托盘（实际栈板）',
     `source_pallet` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '来源托盘（账面栈板）',
     `stock_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '盘点状态 1：已完成 2：未完成',
     `stock_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '盘点类型 1：盘亏 2：盘盈',
     `del_flag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '取消盘点标志 Y/N',
     `remark` varchar(255) DEFAULT NULL COMMENT '备注',
     `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
     `create_time` datetime DEFAULT NULL COMMENT '创建时间',
     `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
     `update_time` datetime DEFAULT NULL COMMENT '更新时间',
     PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='盘点记录';

ALTER TABLE wms_box_info
    RENAME COLUMN box_remark TO remark;