/*
Navicat MariaDB Data Transfer

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

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 utilization_apply
-- ----------------------------
DROP TABLE IF EXISTS `utilization_apply`;
CREATE TABLE `utilization_apply` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `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 AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for utilization_audit
-- ----------------------------
DROP TABLE IF EXISTS `utilization_audit`;
CREATE TABLE `utilization_audit` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `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 `utilization_audit_ibfk_1` FOREIGN KEY (`id`) REFERENCES `utilization_apply` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for utilization_borrow
-- ----------------------------
DROP TABLE IF EXISTS `utilization_borrow`;
CREATE TABLE `utilization_borrow` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `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 `utilization_borrow_ibfk_1` FOREIGN KEY (`id`) REFERENCES `utilization_apply` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for utilization_evaluation
-- ----------------------------
DROP TABLE IF EXISTS `utilization_evaluation`;
CREATE TABLE `utilization_evaluation` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `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 `utilization_evaluation_ibfk_1` FOREIGN KEY (`id`) REFERENCES `utilization_borrow` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for utilization_remind
-- ----------------------------
DROP TABLE IF EXISTS `utilization_remind`;
CREATE TABLE `utilization_remind` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `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 `utilization_remind_ibfk_1` FOREIGN KEY (`id`) REFERENCES `utilization_borrow` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for utilization_rules
-- ----------------------------
DROP TABLE IF EXISTS `utilization_rules`;
CREATE TABLE `utilization_rules` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `enable` bit(1) NOT NULL DEFAULT b'1' COMMENT '逻辑删标识,0表示删除',
  `remark` varchar(1024) DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(20) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_by` varchar(20) DEFAULT NULL COMMENT '更新人',
  `borrow_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8;
