/*
 Navicat Premium Data Transfer

 Source Server         : ry-ido 华为云
 Source Server Type    : MySQL
 Source Server Version : 80020
 Source Host           : 122.9.44.92:3306
 Source Schema         : ry-ido

 Target Server Type    : MySQL
 Target Server Version : 80020
 File Encoding         : 65001

 Date: 11/01/2021 16:55:09
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for ido_anonymous_comment
-- ----------------------------
DROP TABLE IF EXISTS `ido_anonymous_comment`;
CREATE TABLE `ido_anonymous_comment`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '评论id',
  `moment_id` int(0) NOT NULL COMMENT '所评论的动态id',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论内容，不超过200字',
  `from_id` int(0) NOT NULL COMMENT '发表评论者id',
  `to_id` int(0) NULL DEFAULT NULL COMMENT '被评论者id 如果直接评论动态则为空',
  `time` datetime(0) NOT NULL COMMENT '评论时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `moment_id`(`moment_id`) USING BTREE,
  INDEX `from_id`(`from_id`) USING BTREE,
  INDEX `to_id`(`to_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '撕逼墙的评论' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_anonymous_comment
-- ----------------------------

-- ----------------------------
-- Table structure for ido_anonymous_moment
-- ----------------------------
DROP TABLE IF EXISTS `ido_anonymous_moment`;
CREATE TABLE `ido_anonymous_moment`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '撕逼墙动态id',
  `report_id` int(0) NOT NULL COMMENT '发布者id（用户id）',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '动态文本内容',
  `picture_1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片1',
  `picture_2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片2',
  `picture_3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片3',
  `time` datetime(0) NOT NULL COMMENT '发布动态时间',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '审核，0为审核不通过，1为通过',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `report_id`(`report_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '撕逼墙 文本长度限制 200 图片数量 最多3张' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_anonymous_moment
-- ----------------------------

-- ----------------------------
-- Table structure for ido_anonymous_thumb
-- ----------------------------
DROP TABLE IF EXISTS `ido_anonymous_thumb`;
CREATE TABLE `ido_anonymous_thumb`  (
  `id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `moment_id` int(0) NOT NULL COMMENT '点赞对应的动态id',
  `time` datetime(0) NOT NULL COMMENT '点赞时间',
  `thumbed_id` int(0) NOT NULL COMMENT '点赞者的id',
  `thumbed_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '点赞者姓名',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `moment_id`(`moment_id`) USING BTREE,
  INDEX `thumbed_id`(`thumbed_id`) USING BTREE,
  INDEX `thumbed_name`(`thumbed_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '撕逼墙动态点赞' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_anonymous_thumb
-- ----------------------------

-- ----------------------------
-- Table structure for ido_area
-- ----------------------------
DROP TABLE IF EXISTS `ido_area`;
CREATE TABLE `ido_area`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '地区ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '地区名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '地区' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_area
-- ----------------------------
INSERT INTO `ido_area` VALUES (1, '未知');

-- ----------------------------
-- Table structure for ido_cheer_comment
-- ----------------------------
DROP TABLE IF EXISTS `ido_cheer_comment`;
CREATE TABLE `ido_cheer_comment`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '评论id',
  `moment_id` int(0) NOT NULL COMMENT '所评论的动态id',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论内容，不超过200字',
  `from_id` int(0) NOT NULL COMMENT '发表评论者id',
  `to_id` int(0) NULL DEFAULT NULL COMMENT '被评论者id 如果直接评论动态则为空',
  `time` datetime(0) NOT NULL COMMENT '评论时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `moment_id`(`moment_id`) USING BTREE,
  INDEX `from_id`(`from_id`) USING BTREE,
  INDEX `to_id`(`to_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '加油站的评论' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_cheer_comment
-- ----------------------------

-- ----------------------------
-- Table structure for ido_cheer_moment
-- ----------------------------
DROP TABLE IF EXISTS `ido_cheer_moment`;
CREATE TABLE `ido_cheer_moment`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '加油站动态id',
  `report_id` int(0) NOT NULL COMMENT '发布者id（用户id）',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '动态文本内容',
  `picture_1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片1',
  `picture_2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片2',
  `picture_3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片3',
  `topic_id` int(0) NULL DEFAULT NULL COMMENT '主题id 可以为空',
  `time` datetime(0) NOT NULL COMMENT '发布动态时间',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '审核，0为审核不通过，1为通过',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `report_id`(`report_id`) USING BTREE,
  INDEX `topic_id`(`topic_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '加油站 文本长度限制200 图片数量 最多3张' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_cheer_moment
-- ----------------------------

-- ----------------------------
-- Table structure for ido_cheer_thumb
-- ----------------------------
DROP TABLE IF EXISTS `ido_cheer_thumb`;
CREATE TABLE `ido_cheer_thumb`  (
  `id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `moment_id` int(0) NOT NULL COMMENT '点赞对应的动态id',
  `time` datetime(0) NOT NULL COMMENT '点赞时间',
  `thumbed_id` int(0) NOT NULL COMMENT '点赞者的id',
  `thumbed_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '点赞者姓名',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `moment_id`(`moment_id`) USING BTREE,
  INDEX `thumbed_id`(`thumbed_id`) USING BTREE,
  INDEX `thumbed_name`(`thumbed_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '加油站动态点赞' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_cheer_thumb
-- ----------------------------

-- ----------------------------
-- Table structure for ido_communication
-- ----------------------------
DROP TABLE IF EXISTS `ido_communication`;
CREATE TABLE `ido_communication`  (
  `id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `sender_id` int(0) NOT NULL COMMENT '发送者ID（用户ID）',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '消息内容',
  `time` datetime(0) NOT NULL COMMENT '发送时间',
  `guard_id` int(0) NOT NULL COMMENT '守护关系ID',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sender_id`(`sender_id`) USING BTREE,
  INDEX `ido_communication_ibfk_2`(`guard_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天内容' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_communication
-- ----------------------------

-- ----------------------------
-- Table structure for ido_enterprise
-- ----------------------------
DROP TABLE IF EXISTS `ido_enterprise`;
CREATE TABLE `ido_enterprise`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '企业ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '企业名称',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '注册码',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系电话',
  `area_id` int(0) NOT NULL COMMENT '地区ID',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系地址',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '企业联系邮箱',
  `img_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '企业图片',
  `order_num` int(0) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `area_id`(`area_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_enterprise
-- ----------------------------
INSERT INTO `ido_enterprise` VALUES (1, '王狗子大酒店', 'wang', '18577930163', 1, '湖南师范大学', '1339426648@qq.com', 'http://122.9.44.92:5000/profile/upload/2021/01/11/5c0761bf-f6a9-4af3-b13f-4ca8e181a181.png', 0);

-- ----------------------------
-- Table structure for ido_guard
-- ----------------------------
DROP TABLE IF EXISTS `ido_guard`;
CREATE TABLE `ido_guard`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '守护关系ID',
  `guardian_id` int(0) NOT NULL COMMENT '守护者ID（用户ID）',
  `protected_id` int(0) NOT NULL COMMENT '被守护者ID（用户ID）',
  `time` datetime(0) NOT NULL COMMENT '关系生成时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `guardian_id`(`guardian_id`) USING BTREE,
  INDEX `protected_id`(`protected_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '守护天使的守护关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_guard
-- ----------------------------

-- ----------------------------
-- Table structure for ido_message
-- ----------------------------
DROP TABLE IF EXISTS `ido_message`;
CREATE TABLE `ido_message`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '消息ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '消息标题',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '消息内容',
  `time` datetime(0) NOT NULL COMMENT '发布时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统消息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_message
-- ----------------------------
INSERT INTO `ido_message` VALUES (1, '王二狗的系统消息', '<p>王二狗的系统消息</p><p><br></p><p><img src=\"http://122.9.44.92:5000/profile/userUpload/admin/2021/01/11/256d68de-b230-4f5c-a957-582c0bc05741.png\"></p>', '2021-01-11 16:50:28');
INSERT INTO `ido_message` VALUES (2, '王三狗的系统消息', '<p>王三狗的系统消息</p><p><br></p><p><img src=\"http://122.9.44.92:5000/profile/userUpload/admin/2021/01/11/b7ce9400-157b-404a-9b9c-2871b9f5dd43.png\"></p>', '2021-01-11 16:50:42');
INSERT INTO `ido_message` VALUES (3, '王四狗的系统消息', '<p>王四狗的系统消息</p><p><img src=\"http://122.9.44.92:5000/profile/userUpload/admin/2021/01/11/2b1584c9-9360-477a-b625-52fead4eaa89.png\"></p>', '2021-01-11 16:50:54');

-- ----------------------------
-- Table structure for ido_message_receive
-- ----------------------------
DROP TABLE IF EXISTS `ido_message_receive`;
CREATE TABLE `ido_message_receive`  (
  `id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `message_id` int(0) NOT NULL COMMENT '消息ID',
  `receiver_id` int(0) NOT NULL COMMENT '接收用户ID',
  `state` int(0) NOT NULL COMMENT '0表示未阅读，1表示已阅读',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `message_id`(`message_id`) USING BTREE,
  INDEX `receiver_id`(`receiver_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '消息接收与阅读状态' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_message_receive
-- ----------------------------

-- ----------------------------
-- Table structure for ido_student
-- ----------------------------
DROP TABLE IF EXISTS `ido_student`;
CREATE TABLE `ido_student`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '学生ID',
  `user_id` int(0) NOT NULL COMMENT '用户ID',
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学号',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
  `school` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学校',
  `major` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '专业',
  `grade` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '年级',
  `area_id` int(0) NULL DEFAULT NULL COMMENT '地区ID',
  `enterprise_id` int(0) NULL DEFAULT NULL COMMENT '企业ID',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `area_id`(`area_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '学生' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_student
-- ----------------------------
INSERT INTO `ido_student` VALUES (1, 100, '201830123001', '王二狗001', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (2, 101, '201830123002', '王二狗002', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (3, 102, '201830123003', '王二狗003', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (4, 103, '201830123004', '王二狗004', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (5, 104, '201830123005', '王二狗005', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (6, 105, '201830123006', '王二狗006', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (7, 106, '201830123007', '王二狗007', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (8, 107, '201830123008', '王二狗008', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (9, 108, '201830123009', '王二狗009', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (10, 109, '201830123010', '王二狗010', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (11, 110, '201830123011', '王二狗011', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (12, 111, '201830123012', '王二狗012', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (13, 112, '201830123013', '王二狗013', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (14, 113, '201830123014', '王二狗014', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (15, 114, '201830123015', '王二狗015', '湖南师范大学', '软件工程', '2018', 1, NULL);
INSERT INTO `ido_student` VALUES (16, 115, '201830123016', '王二狗016', '湖南师范大学', '软件工程', '2018', 1, NULL);

-- ----------------------------
-- Table structure for ido_student_worker
-- ----------------------------
DROP TABLE IF EXISTS `ido_student_worker`;
CREATE TABLE `ido_student_worker`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `student_user_id` int(0) NOT NULL COMMENT '学生用户ID',
  `worker_user_id` int(0) NOT NULL COMMENT '企业员工用户ID',
  `datetime` datetime(0) NOT NULL COMMENT '关系生成时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '企业员工与学生关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_student_worker
-- ----------------------------

-- ----------------------------
-- Table structure for ido_task
-- ----------------------------
DROP TABLE IF EXISTS `ido_task`;
CREATE TABLE `ido_task`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '任务ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称',
  `describe` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务描述',
  `star` int(0) NOT NULL COMMENT '星星数目上限',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_task
-- ----------------------------
INSERT INTO `ido_task` VALUES (1, '王二狗的实习宝藏任务', '这是王二狗的实习宝藏任务', 2);
INSERT INTO `ido_task` VALUES (2, '王三狗的实习宝藏任务', '这是王三狗的实习宝藏任务', 3);
INSERT INTO `ido_task` VALUES (3, '王四狗的实习宝藏任务', '这是王四狗的实习宝藏任务', 4);

-- ----------------------------
-- Table structure for ido_task_record
-- ----------------------------
DROP TABLE IF EXISTS `ido_task_record`;
CREATE TABLE `ido_task_record`  (
  `id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `task_id` int(0) NOT NULL COMMENT '任务ID',
  `student_id` int(0) NOT NULL COMMENT '学生ID',
  `state` int(0) NOT NULL COMMENT '0为进行中，1为审核中，2为已完成',
  `describe` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '自我描述',
  `time` datetime(0) NOT NULL COMMENT '状态更新时间',
  `star` int(0) NOT NULL COMMENT '所获得的星星的数目',
  `picture` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务图片URL',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_id`(`task_id`) USING BTREE,
  INDEX `student_id`(`student_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务记录' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_task_record
-- ----------------------------

-- ----------------------------
-- Table structure for ido_teacher
-- ----------------------------
DROP TABLE IF EXISTS `ido_teacher`;
CREATE TABLE `ido_teacher`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '老师ID',
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '职工号',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
  `user_id` int(0) NOT NULL COMMENT '用户ID',
  `area_id` int(0) NULL DEFAULT NULL COMMENT '地区ID',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `area_id`(`area_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '老师' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_teacher
-- ----------------------------
INSERT INTO `ido_teacher` VALUES (1, '202130123001', '王三狗001', 116, 1);
INSERT INTO `ido_teacher` VALUES (2, '202130123002', '王三狗002', 117, 1);
INSERT INTO `ido_teacher` VALUES (3, '202130123003', '王三狗003', 118, 1);
INSERT INTO `ido_teacher` VALUES (4, '202130123004', '王三狗004', 119, 1);
INSERT INTO `ido_teacher` VALUES (5, '202130123005', '王三狗005', 120, 1);

-- ----------------------------
-- Table structure for ido_topic
-- ----------------------------
DROP TABLE IF EXISTS `ido_topic`;
CREATE TABLE `ido_topic`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '每周主题id',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '每周主题内容',
  `begin_date` date NULL DEFAULT NULL COMMENT '主题开始时间',
  `end_date` date NOT NULL COMMENT '主题结束时间',
  `time` datetime(0) NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '每周主题' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_topic
-- ----------------------------

-- ----------------------------
-- Table structure for ido_user
-- ----------------------------
DROP TABLE IF EXISTS `ido_user`;
CREATE TABLE `ido_user`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
  `type` int(0) NOT NULL COMMENT '用户类型，0代表学生，1代表老师，2代表企业人员',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '邮箱',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `username`(`username`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_user
-- ----------------------------

-- ----------------------------
-- Table structure for ido_worker
-- ----------------------------
DROP TABLE IF EXISTS `ido_worker`;
CREATE TABLE `ido_worker`  (
  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '企业人员ID',
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '职工号',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
  `user_id` int(0) NOT NULL COMMENT '用户ID',
  `enterprise_id` int(0) NOT NULL COMMENT '企业ID',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `enterprise_id`(`enterprise_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业人员' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ido_worker
-- ----------------------------
INSERT INTO `ido_worker` VALUES (1, '202030123001', '王四狗', 121, 1);

SET FOREIGN_KEY_CHECKS = 1;
