/*
Navicat MariaDB Data Transfer

Source Server         : archives
Source Server Version : 100032
Source Host           : 192.168.1.124:3307
Source Database       : archives_usage

Target Server Type    : MariaDB
Target Server Version : 100032
File Encoding         : 65001

Date: 2018-02-02 16:30:10
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for usage_apply
-- ----------------------------
DROP TABLE IF EXISTS `usage_apply`;
CREATE TABLE `usage_apply` (
  `id` bigint(20) NOT NULL,
  `enable` tinyint(4) DEFAULT NULL,
  `remark` varchar(1024) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `create_by` varchar(20) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `update_by` varchar(20) DEFAULT NULL,
  `property` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `idcard_number` varchar(50) DEFAULT NULL,
  `credentials_file` varchar(255) NOT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `archives_name` varchar(255) NOT NULL,
  `apply_time` datetime NOT NULL,
  `apply_purpose` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for usage_audit
-- ----------------------------
DROP TABLE IF EXISTS `usage_audit`;
CREATE TABLE `usage_audit` (
  `id` bigint(20) NOT NULL,
  `enable` tinyint(4) DEFAULT NULL,
  `remark` varchar(1024) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `create_by` varchar(20) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `update_by` varchar(20) DEFAULT NULL,
  `name` varchar(50) NOT NULL,
  `position` varchar(50) DEFAULT NULL,
  `result` varchar(50) DEFAULT NULL,
  `time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `usage_audit_ibfk_1` FOREIGN KEY (`id`) REFERENCES `usage_apply` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for usage_borrow
-- ----------------------------
DROP TABLE IF EXISTS `usage_borrow`;
CREATE TABLE `usage_borrow` (
  `id` bigint(20) NOT NULL,
  `enable` tinyint(4) DEFAULT NULL,
  `remark` varchar(1024) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `create_by` varchar(20) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `update_by` varchar(20) DEFAULT NULL,
  `borrow_time` datetime NOT NULL,
  `duration` varchar(50) DEFAULT NULL,
  `deadline` datetime DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `usage_borrow_ibfk_1` FOREIGN KEY (`id`) REFERENCES `usage_apply` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for usage_evaluation
-- ----------------------------
DROP TABLE IF EXISTS `usage_evaluation`;
CREATE TABLE `usage_evaluation` (
  `id` bigint(20) NOT NULL,
  `enable` tinyint(4) DEFAULT NULL,
  `remark` varchar(1024) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `create_by` varchar(20) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `update_by` varchar(20) DEFAULT NULL,
  `evaluate_score` varchar(10) NOT NULL,
  `evaluate_content` varchar(255) DEFAULT NULL,
  `evaluate_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `usage_evaluation_ibfk_1` FOREIGN KEY (`id`) REFERENCES `usage_borrow` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for usage_remind
-- ----------------------------
DROP TABLE IF EXISTS `usage_remind`;
CREATE TABLE `usage_remind` (
  `id` bigint(20) NOT NULL,
  `enable` tinyint(4) DEFAULT NULL,
  `remark` varchar(1024) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `create_by` varchar(20) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `update_by` varchar(20) DEFAULT NULL,
  `extra_time` datetime DEFAULT NULL,
  `remind` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `usage_remind_ibfk_1` FOREIGN KEY (`id`) REFERENCES `usage_borrow` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for usage_rules
-- ----------------------------
DROP TABLE IF EXISTS `usage_rules`;
CREATE TABLE `usage_rules` (
  `id` bigint(20) NOT NULL,
  `enable` tinyint(4) DEFAULT NULL,
  `remark` varchar(1024) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `create_by` varchar(20) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `update_by` varchar(20) DEFAULT NULL,
  `borrow_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
