-- 离线数据管理
DROP TABLE
IF
	EXISTS t_offline_data_management;
CREATE TABLE t_offline_data_management (
	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '序号',
	name VARCHAR ( 64 )  COMMENT '数据名称',
	air_number VARCHAR ( 64 )  COMMENT '机号',
	flight_duration VARCHAR ( 64 )  COMMENT '飞行时长',
	data_path VARCHAR ( 256 ) COMMENT '飞行数据',
	remark VARCHAR ( 256 ) COMMENT '备注',
	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
	create_time datetime COMMENT '创建时间',
	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
	update_time datetime COMMENT '更新时间',
PRIMARY KEY ( id )
) ENGINE = INNODB auto_increment = 1 COMMENT = '离线数据管理';

-- 离线数据分析
DROP TABLE
IF
	EXISTS t_offline_data_analysis;
CREATE TABLE t_offline_data_analysis (
	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '序号',
	data_id BIGINT ( 20 ) COMMENT '数据管理',
	air_number VARCHAR ( 0 )  COMMENT '机号',
	flight_duration VARCHAR ( 0 )  COMMENT '飞行时长',
	type VARCHAR ( 64 )  COMMENT '分析类型',
	result_path VARCHAR ( 256 ) COMMENT '分析结果',
	remark VARCHAR ( 256 ) COMMENT '备注',
	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
	create_time datetime COMMENT '创建时间',
	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
	update_time datetime COMMENT '更新时间',
PRIMARY KEY ( id )
) ENGINE = INNODB auto_increment = 1 COMMENT = '离线数据分析';

-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据管理', '2056', '3', 'management', 'showInfo/management/index', 1, 0, 'C', '0', '0', 'showInfo:management:list', 'table', 'admin', sysdate(), '', null, '离线数据管理菜单');

-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();

-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据管理查询', @parentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:management:query',        '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据管理新增', @parentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:management:add',          '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据管理修改', @parentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:management:edit',         '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据管理删除', @parentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:management:remove',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据管理导出', @parentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:management:export',       '#', 'admin', sysdate(), '', null, '');

-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据分析', '2056', '4', 'analysis', 'showInfo/analysis/index', 1, 0, 'C', '0', '0', 'showInfo:analysis:list', 'tool', 'admin', sysdate(), '', null, '离线数据分析菜单');

-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();

-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据分析查询', @parentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:analysis:query',        '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据分析新增', @parentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:analysis:add',          '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据分析修改', @parentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:analysis:edit',         '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据分析删除', @parentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:analysis:remove',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('离线数据分析导出', @parentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'showInfo:analysis:export',       '#', 'admin', sysdate(), '', null, '');
