/*
Navicat MySQL Data Transfer

Source Server         : local
Source Server Version : 50562
Source Host           : localhost:3306
Source Database       : version_management

Target Server Type    : MYSQL
Target Server Version : 50562
File Encoding         : 65001

Date: 2021-08-04 15:19:08
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for t_aircraft
-- ----------------------------
DROP TABLE IF EXISTS `t_aircraft`;
CREATE TABLE `t_aircraft` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `aircraft_type` varchar(50) NOT NULL,
  `remarks` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_department
-- ----------------------------
DROP TABLE IF EXISTS `t_department`;
CREATE TABLE `t_department` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '部门ID',
  `parent_id` int(10) unsigned zerofill NOT NULL DEFAULT '0000000000' COMMENT '上级部门用于级别管理',
  `parent_name` varchar(255) NOT NULL,
  `department_name` varchar(25) NOT NULL DEFAULT '部门名' COMMENT '部门名',
  `master_id` int(11) NOT NULL DEFAULT '0' COMMENT '负责人',
  `master_name` varchar(25) NOT NULL DEFAULT '负责人姓名' COMMENT '负责人姓名',
  `remark` varchar(255) NOT NULL DEFAULT '备注',
  `department_type` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='部门';

-- ----------------------------
-- Table structure for t_device
-- ----------------------------
DROP TABLE IF EXISTS `t_device`;
CREATE TABLE `t_device` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `device_name` varchar(255) DEFAULT NULL,
  `device_type` int(11) DEFAULT '0',
  `software_version` varchar(50) DEFAULT NULL,
  `s_update_reason` varchar(255) DEFAULT NULL,
  `s_update_time` datetime DEFAULT NULL,
  `s_file_num` varchar(50) DEFAULT NULL,
  `hardware_version` varchar(50) DEFAULT NULL,
  `h_update_reason` varchar(255) DEFAULT NULL,
  `h_update_time` datetime DEFAULT NULL,
  `h_file_num` varchar(50) DEFAULT NULL,
  `update_test` int(11) DEFAULT NULL,
  `update_user` varchar(50) DEFAULT NULL,
  `equipment_id` int(11) DEFAULT NULL,
  `syst_id` int(11) DEFAULT NULL,
  `subsys_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_equipment
-- ----------------------------
DROP TABLE IF EXISTS `t_equipment`;
CREATE TABLE `t_equipment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `aircraft_id` int(11) NOT NULL,
  `equipment_num` varchar(50) NOT NULL,
  `equipment_time` datetime NOT NULL,
  `remarks` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_history
-- ----------------------------
DROP TABLE IF EXISTS `t_history`;
CREATE TABLE `t_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `device_id` int(11) DEFAULT NULL,
  `device_name` varchar(255) DEFAULT NULL,
  `software_version` varchar(50) DEFAULT NULL,
  `s_update_reason` varchar(255) DEFAULT NULL,
  `s_update_time` datetime DEFAULT NULL,
  `s_file_num` varchar(50) DEFAULT NULL,
  `hardware_version` varchar(50) DEFAULT NULL,
  `h_update_reason` varchar(255) DEFAULT NULL,
  `h_update_time` datetime DEFAULT NULL,
  `h_file_num` varchar(50) DEFAULT NULL,
  `update_test` int(11) DEFAULT NULL,
  `update_user` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_log
-- ----------------------------
DROP TABLE IF EXISTS `t_log`;
CREATE TABLE `t_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
  `real_name` varchar(25) NOT NULL DEFAULT '未知用户' COMMENT '操作用户姓名',
  `begin_time` varchar(25) NOT NULL DEFAULT '1970-01-1' COMMENT '操作开始时刻',
  `finish_time` varchar(25) NOT NULL DEFAULT '1970-01-1' COMMENT '操作结束时刻',
  `user_ip` varchar(255) NOT NULL DEFAULT '用户ip' COMMENT '用户ip',
  `request_url` varchar(255) NOT NULL DEFAULT '请求地址' COMMENT '请求的url',
  `request_description` varchar(255) NOT NULL DEFAULT '请求描述' COMMENT '请求描述',
  `arguments` text COMMENT '数据',
  `exec_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '执行结果',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29082 DEFAULT CHARSET=utf8 COMMENT='日志';

-- ----------------------------
-- Table structure for t_rights
-- ----------------------------
DROP TABLE IF EXISTS `t_rights`;
CREATE TABLE `t_rights` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rights_path` varchar(255) NOT NULL DEFAULT '/api/path' COMMENT '请求路径',
  `rights_name` varchar(25) NOT NULL DEFAULT '权限名' COMMENT '权限名',
  `remark` varchar(255) NOT NULL DEFAULT '备注',
  `is_hide` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=256 DEFAULT CHARSET=utf8 COMMENT='权限';

-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role_name` varchar(25) NOT NULL DEFAULT '角色名' COMMENT '角色名',
  `rights` varchar(255) NOT NULL DEFAULT '0' COMMENT '权限',
  `remark` varchar(255) NOT NULL DEFAULT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='角色';

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(25) NOT NULL DEFAULT 'user_name' COMMENT '用户名',
  `real_name` varchar(25) NOT NULL DEFAULT '真实姓名' COMMENT '真实姓名',
  `password` varchar(255) NOT NULL DEFAULT 'password' COMMENT '密码',
  `department_id` int(11) NOT NULL DEFAULT '0' COMMENT '部门ID',
  `department_name` varchar(25) NOT NULL DEFAULT '部门名' COMMENT '部门名',
  `role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色ID',
  `role_name` varchar(25) NOT NULL DEFAULT '角色名' COMMENT '角色名',
  `sex` int(11) NOT NULL DEFAULT '0' COMMENT '0女1男',
  `birth` varchar(25) NOT NULL DEFAULT '1970-01-01' COMMENT '出生日期',
  `img` varchar(255) NOT NULL DEFAULT '' COMMENT '图像',
  `is_enable` int(11) NOT NULL DEFAULT '0' COMMENT '启用状态0正常',
  `remark` varchar(255) NOT NULL DEFAULT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=115 DEFAULT CHARSET=utf8 COMMENT='用户';
