ALTER TABLE `t_equipment_info` 
ADD COLUMN `video_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '视频流url' AFTER `rtmp_url`;

CREATE TABLE `t_algorithm_interface`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '接口名称',
  `ability_info` json NULL COMMENT '能力配置',
  `interface_url` varchar(522) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '接口地址',
  `input_params` json NULL COMMENT '接口入参',
  `output_params` json NULL COMMENT '接口出参',
  `enabled` int(1) NULL DEFAULT 1 COMMENT '是否启动能力：0-否；1-是',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接口描述',
  `create_time` datetime(0) NOT NULL COMMENT '创建时间',
  `create_user` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_user` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `is_delete` int(4) NOT NULL COMMENT '删除标记',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 47 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;

CREATE TABLE `t_equipment_interface_ref`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `equipment_id` int(11) NOT NULL COMMENT '设备id',
  `algorithm_interface_id` int(1) NOT NULL COMMENT '算法接口id',
  `create_time` datetime(0) NOT NULL COMMENT '创建时间',
  `create_user` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_user` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `is_delete` int(4) NOT NULL COMMENT '删除标记',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_equipment_interface_id`(`equipment_id`, `algorithm_interface_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;

INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (34, 'system-ability', '能力管理', '/system/algorithmInterface', 6, '2021-03-03 15:38:11', NULL, NULL, '2021-03-03 15:38:14', 0);
INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (35, 'system-ability-add', '新增算法接口', '/system/algorithmInterface/add', 34, '2021-03-03 15:30:26', NULL, NULL, '2021-03-03 15:30:28', 0);
INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (36, 'system-ability-list', '算法接口列表', '/system/algorithmInterface/queryList', 34, '2021-03-03 15:31:20', NULL, NULL, '2021-03-03 15:31:22', 0);
INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (37, 'system-ability-page', '算法接口分页查询', '/system/algorithmInterface/queryByPage', 34, '2021-03-04 13:28:25', NULL, NULL, '2021-03-04 13:28:30', 0);
INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (38, 'system-ability-detail', '算法接口详情', '/system/algorithmInterface/detail', 34, '2021-03-04 13:29:15', NULL, NULL, '2021-03-04 13:29:17', 0);
INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (39, 'system-ability-update', '修改算法接口', '/system/algorithmInterface/update', 34, '2021-03-04 13:29:53', NULL, NULL, '2021-03-04 13:29:55', 0);
INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (40, 'system-ability-delete', '删除算法接口', '/system/algorithmInterface/delete', 34, '2021-03-04 13:30:40', NULL, NULL, '2021-03-04 13:30:43', 0);
INSERT INTO `t_permission`(`id`, `permission_name`, `description`, `url`, `pid`, `create_time`, `create_user`, `update_user`, `update_time`, `is_delete`) VALUES (41, 'system-ability-status', '更新算法接口状态', '/system/algorithmInterface/updateStatus', 34, '2021-03-04 13:31:13', NULL, NULL, '2021-03-04 13:31:15', 0);
