SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE IF EXISTS `ams_hexdefine_detail`;
CREATE TABLE `ams_hexdefine_detail`  (
 `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
 `business_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '任务类型',
 `col_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字段',
 `col_type` int(11) NULL DEFAULT NULL COMMENT '1值2绑定字段',
 `bind_table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '绑定表',
 `col_val` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'col_type1为值否则为bind_TABLE if not exists指定表字段',
 `val_type` int(11) NOT NULL DEFAULT 1 COMMENT '1字符串2数字',
 `sort_index` int(11) NOT NULL DEFAULT 1 COMMENT '字段排序',
 PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 227 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '任务定义表（lp0-lp30）' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for ams_hexdefine_header
-- ----------------------------
DROP TABLE IF EXISTS `ams_hexdefine_header`;
CREATE TABLE `ams_hexdefine_header`  (
 `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
 `task_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '任务名称',
 `business_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '任务类型',
 `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '16进制指令定义表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for ams_ndc_event
-- ----------------------------
DROP TABLE IF EXISTS `ams_ndc_event`;
CREATE TABLE `ams_ndc_event`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` int(11) NULL DEFAULT NULL,
  `eCode` int(11) NULL DEFAULT NULL,
  `locationIndex` int(11) NULL DEFAULT NULL,
  `lp1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `lp2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `lp3` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `lp4` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `display` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `displayID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `level` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 140 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'Ndc反馈事件代码字典表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for ams_task
-- ----------------------------
DROP TABLE IF EXISTS `ams_task`;
CREATE TABLE `ams_task`  (
 `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `task_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 `iKey` int(11) NULL DEFAULT NULL,
 `aci_index` tinyint(3) UNSIGNED NULL DEFAULT NULL,
 `st_from` int(10) UNSIGNED NOT NULL,
 `st_to` int(10) UNSIGNED NOT NULL,
 `priority` int(10) UNSIGNED NOT NULL DEFAULT 0,
 `system_status` int(10) UNSIGNED NULL DEFAULT NULL,
 `event` int(10) UNSIGNED NULL DEFAULT NULL,
 `server_ack` tinyint(3) UNSIGNED NULL DEFAULT 0,
 `aci_accept` tinyint(3) UNSIGNED NULL DEFAULT 0,
 `is_delete` tinyint(3) UNSIGNED NULL DEFAULT 0,
 `callBackUrl` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 `addtime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
 `addwho` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 `sys_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '调用系统名称',
 `device_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '设备名称',
 `business_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '任务类型(01普通任务60进判断位90出判断位m释放判断位)',
 `ext1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 `ext2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 `ext3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 `height_level` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '1(低) 2(中) 3(高）',
 `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 `roadway` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巷道',
 `tier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '层',
 PRIMARY KEY (`id`) USING BTREE,
 INDEX `id`(`id`) USING BTREE,
 INDEX `task_no`(`task_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1731588496044228611 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for base_location_info
-- ----------------------------
DROP TABLE IF EXISTS `base_location_info`;
CREATE TABLE `base_location_info`  (
`id` int(64) NOT NULL COMMENT '主键',
`warehouse_id` int(11) NULL DEFAULT NULL COMMENT '车间id',
`zone_id` int(11) NULL DEFAULT NULL COMMENT '区域id',
`location_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '库位编码',
`row_no` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '排号',
`row_index` int(11) NULL DEFAULT NULL COMMENT '排序号',
`col_no` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '列号',
`col_index` int(11) NULL DEFAULT NULL COMMENT '列序号',
`shift_no` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '层号',
`shift_index` int(11) NULL DEFAULT NULL COMMENT '层序号',
`stock_status` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '储位状态(00)空闲,(10)占用,(20)完成,(90)合格,(99)不合格(80封存)',
`is_empty` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否为空(Y空/N非空)',
`bind_sku` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '指定产品',
`location_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '储位类型（1货架2地堆3流离货架）',
`rack_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '盘架编号',
`agv_station` int(11) NULL DEFAULT NULL COMMENT 'AGV点位',
`folded_tag` int(11) NULL DEFAULT 0 COMMENT '是否堆叠',
`folded_count` int(11) NULL DEFAULT 0 COMMENT '叠空托盘上限（当folded_tag为1时有效）',
`height_limit` double(12, 0) NULL DEFAULT 0 COMMENT '限高',
  `weight_limit` double(12, 0) NULL DEFAULT 0 COMMENT '限重',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '库位信息' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for car_info
-- ----------------------------
DROP TABLE IF EXISTS `car_info`;
CREATE TABLE `car_info`  (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `carNo` int(11) NULL DEFAULT NULL COMMENT '车编号',
 `warehouse_id` int(11) NULL DEFAULT NULL COMMENT '仓库编号',
 `state` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '状态',
 `active_flag` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'Y' COMMENT '是否启用',
 `userdefine1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 `userdefine2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 `userdefine3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 `userdefine4` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 `userdefine5` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 `battery` int(11) NULL DEFAULT NULL COMMENT '电池',
 `x` int(11) NULL DEFAULT NULL COMMENT 'x轴',
 `y` int(11) NULL DEFAULT NULL COMMENT 'y轴',
 PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;
