
-- ----------------------------
-- 预警表
-- ----------------------------
CREATE TABLE `hazmat_manage`.`hz_warning`  (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`hazmat_id` bigint NOT NULL COMMENT '危化品id',
`basic_id` bigint NOT NULL COMMENT '危化品基础数据id',
`state` tinyint NOT NULL DEFAULT 0 COMMENT '操作状态(0未处理，1已处理)',
`create_id` bigint NOT NULL COMMENT '领用人ID',
`use_time` datetime NOT NULL COMMENT '领用时间',
`handle_time` datetime  NULL  COMMENT '处理时间',
`company_id` bigint NOT NULL COMMENT '企业id',
`create_by` varchar(20) NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_by` varchar(20) NULL,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`remark` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`version` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
INDEX `index_hazmat`(`hazmat_id`) USING BTREE,
INDEX `index_basic`(`basic_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '预警表' ROW_FORMAT = Dynamic;