
CREATE TABLE if not exists `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指定表字段',
    `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;

CREATE TABLE if not exists `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;

CREATE TABLE if not exists `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;

CREATE TABLE if not exists `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 = 2503 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

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