aidmt-ms/sql/video_stream_detection_crea...

30 lines
1.9 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ----------------------------
-- 视频流检测记录表(第三方推送)
-- 每条 description 落库一行need_alert=1 表示违反规则需报警
-- ----------------------------
DROP TABLE IF EXISTS `cons_video_detection`;
CREATE TABLE `cons_video_detection` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`stream_id` varchar(128) DEFAULT NULL COMMENT '视频流ID',
`frame_timestamp` bigint(20) DEFAULT NULL COMMENT '帧时间13位时间戳',
`name` varchar(128) DEFAULT NULL COMMENT '检测名称,如:物体检测、动火作业',
`label` varchar(512) DEFAULT NULL COMMENT '标签/描述',
`need_alert` char(1) DEFAULT '0' COMMENT '是否需报警0否 1是true=违反规则需报警)',
`box_json` varchar(256) DEFAULT NULL COMMENT '检测框 JSON [x1,y1,x2,y2]',
`confidence` decimal(5,4) DEFAULT NULL COMMENT '视觉检测置信度 0-1',
`tag` varchar(128) DEFAULT NULL COMMENT '标签,如:物体检测、有火源',
`detect_type` int(11) DEFAULT NULL COMMENT '检测类型:-1物体检测 0动火作业 1高空作业 2用电作业 3起重吊装 4有限空间 5补充规则',
`img_url` varchar(512) DEFAULT NULL COMMENT '问题照片或视频的URL',
`review_status` char(1) DEFAULT '0' COMMENT '复核状态0待复核 1合格 2不合格',
`review_by` varchar(64) DEFAULT NULL COMMENT '复核人',
`review_time` datetime DEFAULT NULL COMMENT '复核时间',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_stream_id` (`stream_id`) USING BTREE,
KEY `idx_frame_timestamp` (`frame_timestamp`) USING BTREE,
KEY `idx_need_alert` (`need_alert`) USING BTREE,
KEY `idx_detect_type` (`detect_type`) USING BTREE,
KEY `idx_review_status` (`review_status`) USING BTREE,
KEY `idx_create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='AI视频检测存储表 cons_video_detection';