/*
Navicat MySQL Data Transfer
Source Server : eee
Source Server Version : 50617
Source Host : localhost:3306
Source Database : didi
Target Server Type : MYSQL
Target Server Version : 50617
File Encoding : 65001
Date: 2018-01-14 19:31:12
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `t_a_type`
-- ----------------------------
DROP TABLE IF EXISTS `t_a_type`;
CREATE TABLE `t_a_type` (
`a_t_id` int(11) NOT NULL AUTO_INCREMENT,
`a_t_name` varchar(20) DEFAULT NULL,
PRIMARY KEY (`a_t_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_a_type
-- ----------------------------
INSERT INTO `t_a_type` VALUES ('1', '系统管理员');
INSERT INTO `t_a_type` VALUES ('2', '普通管理员');
INSERT INTO `t_a_type` VALUES ('3', '公司管理员');
-- ----------------------------
-- Table structure for `t_admin`
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
`a_id` int(11) NOT NULL AUTO_INCREMENT,
`a_t_id` int(11) DEFAULT NULL,
`a_count` varchar(20) NOT NULL,
`a_password` varchar(15) NOT NULL,
PRIMARY KEY (`a_id`),
KEY `FK_a_t_a` (`a_t_id`),
CONSTRAINT `FK_a_t_a` FOREIGN KEY (`a_t_id`) REFERENCES `t_a_type` (`a_t_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_admin
-- ----------------------------
INSERT INTO `t_admin` VALUES ('1', '1', 'admin', 'admin');
INSERT INTO `t_admin` VALUES ('2', '2', 'admin123', 'admin123');
INSERT INTO `t_admin` VALUES ('3', '3', 'nanchang', 'nanchang');
INSERT INTO `t_admin` VALUES ('4', '3', 'nanchang2', 'nanchang2');
INSERT INTO `t_admin` VALUES ('5', '2', 'admin2', 'admin2');
INSERT INTO `t_admin` VALUES ('6', '3', 'beijing', 'beijing');
INSERT INTO `t_admin` VALUES ('7', '2', '333', '444');
INSERT INTO `t_admin` VALUES ('8', '3', '555', '666');
INSERT INTO `t_admin` VALUES ('9', '2', '666', '777');
INSERT INTO `t_admin` VALUES ('10', '3', '888', '999');
INSERT INTO `t_admin` VALUES ('11', '3', '1010', '1010');
INSERT INTO `t_admin` VALUES ('13', '2', '1313', '1313');
INSERT INTO `t_admin` VALUES ('14', '1', '3434', '3434');
INSERT INTO `t_admin` VALUES ('15', '1', '4545', '4545');
INSERT INTO `t_admin` VALUES ('16', '1', '45456', '45456');
INSERT INTO `t_admin` VALUES ('17', '1', '454567', '454567');
INSERT INTO `t_admin` VALUES ('18', '1', '4545678', '454567');
INSERT INTO `t_admin` VALUES ('20', '1', '1234', '1234');
INSERT INTO `t_admin` VALUES ('21', '1', '12345', '12345');
INSERT INTO `t_admin` VALUES ('22', '1', '123456', '12345');
INSERT INTO `t_admin` VALUES ('24', '1', '1111', '1111');
-- ----------------------------
-- Table structure for `t_allocation`
-- ----------------------------
DROP TABLE IF EXISTS `t_allocation`;
CREATE TABLE `t_allocation` (
`allo_id` int(11) NOT NULL AUTO_INCREMENT,
`c_id` int(11) DEFAULT NULL,
`u_id` int(11) DEFAULT NULL,
PRIMARY KEY (`allo_id`),
KEY `FK_a_c_a` (`c_id`),
KEY `FK_e_a_e` (`u_id`),
CONSTRAINT `FK_a_c_a` FOREIGN KEY (`c_id`) REFERENCES `t_cpn_car` (`c_id`),
CONSTRAINT `FK_e_a_e` FOREIGN KEY (`u_id`) REFERENCES `t_employee` (`u_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_allocation
-- ----------------------------
-- ----------------------------
-- Table structure for `t_c_type`
-- ----------------------------
DROP TABLE IF EXISTS `t_c_type`;
CREATE TABLE `t_c_type` (
`c_t_id` int(11) NOT NULL AUTO_INCREMENT,
`c_t_name` varchar(20) DEFAULT NULL,
PRIMARY KEY (`c_t_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_c_type
-- ----------------------------
INSERT INTO `t_c_type` VALUES ('1', '小轿车');
-- ----------------------------
-- Table structure for `t_car`
-- ----------------------------
DROP TABLE IF EXISTS `t_car`;
CREATE TABLE `t_car` (
`c_id` int(11) NOT NULL AUTO_INCREMENT,
`c_t_id` int(11) DEFAULT NULL,
`c_plate_number` varchar(8) DEFAULT NULL,
`c_buy_time` date DEFAULT NULL,
`c_brand` varchar(20) DEFAULT NULL,
`c_color` varchar(10) DEFAULT NULL,
`c_max_number` int(11) DEFAULT '5',
`c_picture` varchar(100) DEFAULT NULL,
`c_state` int(11) DEFAULT '3',
PRIMARY KEY (`c_id`),
KEY `FK_c_t_c` (`c_t_id`),
CONSTRAINT `FK_c_t_c` FOREIGN KEY (`c_t_id`) REFERENCES `t_c_type` (`c_t_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_car
-- ----------------------------
INSERT INTO `t_car` VALUES ('1', '1', 'aaaa', '2018-01-11', '', null, '5', null, '3');
INSERT INTO `t_car` VALUES ('2', '1', 'eeee', '2018-01-12', '大众', '白', '5', null, '3');
-- ----------------------------
-- Table structure for `t_comment`
-- ----------------------------
DROP TABLE IF EXISTS `t_comment`;
CREATE TABLE `t_comment` (
`m_id` int(11) NOT NULL AUTO_INCREMENT,
`u_id` int(11) DEFAULT NULL,
`p_id` int(11) DEFAULT NULL,
`m_content` text,
`m_pub_time` datetime DEFAULT NULL,
`m_target` int(11) DEFAULT NULL,
PRIMARY KEY (`m_id`),
KEY `FK_p_m_p` (`p_id`),
KEY `FK_u_m_u` (`u_id`),
CONSTRAINT `FK_p_m_p` FOREIGN KEY (`p_id`) REFERENCES `t_post` (`p_id`),
CONSTRAINT `FK_u_m_u` FOREIGN KEY (`u_id`) REFERENCES `t_user` (`u_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_comment
-- ----------------------------
INSERT INTO `t_comment` VALUES ('1', null, null, '鹅鹅鹅鹅', null, null);
-- ----------------------------
-- Table structure for `t_company`
-- ----------------------------
DROP TABLE IF EXISTS `t_company`;
CREATE TABLE `t_company` (
`cpn_id` int(11) NOT NULL AUTO_INCREMENT,
`cpn_name` varchar(50) DEFAULT NULL,
`cpn_ico` varchar(100) DEFAULT '/didi/images/user_default_pic.jpg',
PRIMARY KEY (`cpn_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_company
-- ----------------------------
INSERT INTO `t_company` VALUES ('1', '南昌出租车公司', '/didi/images/user_default_pic.jpg');
INSERT INTO `t_company` VALUES ('2', '北京出租车公司', '/didi/images/user_default_pic.jpg');
-- ----------------------------
-- Table structure for `t_cpn_admin`
-- ----------------------------
DROP TABLE IF EXISTS `t_cpn_admin`;
CREATE TABLE `t_cpn_admin` (
`a_id` int(11) NOT NULL,
`cpn_id` int(11) DEFAULT NULL,
PRIMARY KEY (`a_id`),
KEY `FK_cpn_a_cpn` (`cpn_id`),
CONSTRAINT `FK_a_cpn_a` FOREIGN KEY (`a_id`) REFERENCES `t_admin` (`a_id`),
CONSTRAINT `FK_cpn_a_cpn` FOREIGN KEY (`cpn_id`) REFERENCES `t_company` (`cpn_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_cpn_admin
-- ----------------------------
INSERT INTO `t_cpn_admin` VALUES ('3', '1');
INSERT INTO `t_cpn_admin` VALUES ('4', '1');
INSERT INTO `t_cpn_admin` VALUES ('10', '1');
INSERT INTO `t_cpn_admin` VALUES ('11', '1');
INSERT INTO `t_cpn_admin` VALUES ('6', '2');
INSERT INTO `t_cpn_admin` VALUES ('8', '2');
-- ----------------------------
-- Table structure for `t_cpn_car`
-- ----------------------------
DROP TABLE IF EXISTS `t_cpn_car`;
CREATE TABLE `t_cpn_car` (
`c_id` int(11) NOT NULL,
`cpn_id` int(11) DEFAULT NULL,
PRIMARY KEY (`c_id`),
KEY `FK_cpn_c_cpn` (`cpn_id`),
CONSTRAINT `FK_cpn_c_cpn` FOREIGN KEY (`cpn_id`) REFERENCES `t_company` (`cpn_id`),
CONSTRAINT `FK_c_cpn_c` FOREIGN KEY (`c_id`) REFERENCES `t_car` (`c_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_cpn_car
-- ----------------------------
INSERT INTO `t_cpn_car` VALUES ('1', '1');
-- ----------------------------
-- Table structure for `t_driver`
-- ----------------------------
DROP TABLE IF EXISTS `t_driver`;
CREATE TABLE `t_driver` (
`u_id` int(11) NOT NULL AUTO_INCREMENT,
`d_real_name` varchar(20) NOT NULL,
`d_car_class` char(2) DEFAULT NULL,
`d_first_issue`