You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

350 lines
17 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80023 (8.0.23)
Source Host : localhost:3306
Source Schema : db_exam
Target Server Type : MySQL
Target Server Version : 80023 (8.0.23)
File Encoding : 65001
Date: 22/07/2024 11:45:24
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_certificate
-- ----------------------------
DROP TABLE IF EXISTS `t_certificate`;
CREATE TABLE `t_certificate` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID ',
`certificate_name` varchar(255) NOT NULL COMMENT '',
`image` varchar(255) DEFAULT NULL COMMENT '',
`certification_nuit` varchar(50) NOT NULL COMMENT '',
`create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_certificate_user
-- ----------------------------
DROP TABLE IF EXISTS `t_certificate_user`;
CREATE TABLE `t_certificate_user` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID ',
`user_id` int DEFAULT NULL COMMENT 'id',
`exam_id` int DEFAULT NULL COMMENT 'id',
`code` varchar(255) DEFAULT NULL COMMENT '',
`certificate_id` int DEFAULT NULL COMMENT 'id',
`create_time` datetime DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_exam
-- ----------------------------
DROP TABLE IF EXISTS `t_exam`;
CREATE TABLE `t_exam` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`title` varchar(255) NOT NULL COMMENT '',
`exam_duration` int NOT NULL COMMENT '',
`passed_score` int NOT NULL COMMENT '',
`gross_score` int NOT NULL COMMENT '',
`max_count` int DEFAULT NULL COMMENT '',
`user_id` int DEFAULT NULL COMMENT 'id',
`certificate_id` int DEFAULT NULL COMMENT 'id',
`radio_count` int DEFAULT NULL COMMENT '',
`radio_score` int DEFAULT NULL COMMENT ' *100/100',
`multi_count` int DEFAULT NULL COMMENT ' ',
`multi_score` int DEFAULT NULL COMMENT ' *100/100',
`judge_count` int DEFAULT NULL COMMENT ' ',
`judge_score` int DEFAULT NULL COMMENT ' *100/100',
`saq_count` int DEFAULT NULL COMMENT '',
`saq_score` int DEFAULT NULL COMMENT ' *100/100',
`start_time` datetime DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
`end_time` datetime DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
`create_time` datetime DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss ',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`,`passed_score`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_exam_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_grade`;
CREATE TABLE `t_exam_grade` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`exam_id` int DEFAULT NULL COMMENT 'id ',
`grade_id` int DEFAULT NULL COMMENT 'id ',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=191 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_exam_qu_answer
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_qu_answer`;
CREATE TABLE `t_exam_qu_answer` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`user_id` int NOT NULL COMMENT 'id',
`exam_id` int NOT NULL COMMENT 'id',
`question_id` int NOT NULL COMMENT 'id',
`question_type` int DEFAULT NULL COMMENT '',
`answer_id` varchar(255) DEFAULT NULL COMMENT 'id id使',
`answer_content` varchar(255) DEFAULT NULL COMMENT ' ',
`checkout` int DEFAULT NULL COMMENT ' 0 1',
`is_sign` int DEFAULT NULL COMMENT ' 0 1',
`is_right` int DEFAULT NULL COMMENT ' 0 1',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `user_id` (`user_id`,`exam_id`,`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=276 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_exam_question
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_question`;
CREATE TABLE `t_exam_question` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`exam_id` int NOT NULL COMMENT 'id',
`question_id` int NOT NULL COMMENT 'id',
`score` int NOT NULL COMMENT '',
`sort` int DEFAULT NULL COMMENT '',
`type` int DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=499 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_exam_repo
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_repo`;
CREATE TABLE `t_exam_repo` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`exam_id` int NOT NULL COMMENT 'id ',
`repo_id` int DEFAULT NULL COMMENT 'id ',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_exercise_record
-- ----------------------------
DROP TABLE IF EXISTS `t_exercise_record`;
CREATE TABLE `t_exercise_record` (
`id` int NOT NULL AUTO_INCREMENT,
`repo_id` int NOT NULL COMMENT 'id',
`question_id` int NOT NULL COMMENT 'id',
`user_id` int NOT NULL COMMENT 'id',
`answer` varchar(255) DEFAULT NULL COMMENT '',
`question_type` int NOT NULL COMMENT '',
`options` varchar(255) DEFAULT NULL COMMENT ' ,id使","',
`is_right` int DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `repo_id` (`repo_id`,`question_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=160 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_grade`;
CREATE TABLE `t_grade` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`grade_name` varchar(255) NOT NULL COMMENT '',
`user_id` int DEFAULT NULL COMMENT 'id',
`code` varchar(255) NOT NULL COMMENT '',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `grade_name` (`grade_name`) USING BTREE,
UNIQUE KEY `code` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_grade_exercise
-- ----------------------------
DROP TABLE IF EXISTS `t_grade_exercise`;
CREATE TABLE `t_grade_exercise` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`repo_id` int DEFAULT NULL COMMENT 'id',
`grade_id` int DEFAULT NULL COMMENT 'id',
`user_id` int DEFAULT NULL COMMENT 'id',
`create_time` datetime DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_manual_score
-- ----------------------------
DROP TABLE IF EXISTS `t_manual_score`;
CREATE TABLE `t_manual_score` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`exam_qu_answer_id` int DEFAULT NULL COMMENT 'id',
`user_id` int DEFAULT NULL COMMENT 'id',
`score` int DEFAULT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_notice
-- ----------------------------
DROP TABLE IF EXISTS `t_notice`;
CREATE TABLE `t_notice` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID ',
`title` varchar(255) NOT NULL COMMENT '',
`image` varchar(255) DEFAULT NULL COMMENT '',
`content` text NOT NULL COMMENT '',
`user_id` int DEFAULT NULL COMMENT 'ID ',
`create_time` datetime DEFAULT NULL COMMENT '',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_notice_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_notice_grade`;
CREATE TABLE `t_notice_grade` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID ',
`notice_id` int DEFAULT NULL COMMENT 'id',
`grade_id` int DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=119 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_option
-- ----------------------------
DROP TABLE IF EXISTS `t_option`;
CREATE TABLE `t_option` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`qu_id` int NOT NULL COMMENT 'id',
`is_right` int DEFAULT NULL COMMENT '',
`image` varchar(255) DEFAULT NULL COMMENT ' 0 1',
`content` varchar(255) NOT NULL COMMENT '',
`sort` int DEFAULT NULL COMMENT '',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2608 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_question
-- ----------------------------
DROP TABLE IF EXISTS `t_question`;
CREATE TABLE `t_question` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`qu_type` varchar(255) NOT NULL COMMENT '',
`image` varchar(255) DEFAULT NULL COMMENT '',
`content` varchar(255) NOT NULL COMMENT '',
`create_time` datetime NOT NULL COMMENT '',
`analysis` varchar(255) DEFAULT NULL COMMENT '',
`repo_id` int NOT NULL COMMENT 'id',
`user_id` int DEFAULT NULL COMMENT 'id',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=702 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_repo
-- ----------------------------
DROP TABLE IF EXISTS `t_repo`;
CREATE TABLE `t_repo` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`user_id` int NOT NULL COMMENT 'id',
`title` varchar(255) NOT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID ',
`role_name` varchar(10) NOT NULL COMMENT '',
`code` varchar(10) NOT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
`user_name` varchar(255) NOT NULL COMMENT '',
`real_name` varchar(20) DEFAULT NULL COMMENT '',
`password` varchar(255) DEFAULT NULL COMMENT '',
`avatar` varchar(255) DEFAULT 'https://online-exam-system-backend.oss-cn-beijing.aliyuncs.com/da93c2a6-6879-46c3-b38f-a99956f70d22.jpg' COMMENT '头像地址',
`role_id` int DEFAULT '1' COMMENT 'id',
`grade_id` int DEFAULT NULL COMMENT 'id',
`create_time` datetime DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
`status` int DEFAULT '1' COMMENT ' 10',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '01',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `user_name` (`user_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_user_book
-- ----------------------------
DROP TABLE IF EXISTS `t_user_book`;
CREATE TABLE `t_user_book` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID ',
`exam_id` int DEFAULT NULL COMMENT 'id ',
`user_id` int DEFAULT NULL COMMENT 'id ',
`qu_id` int DEFAULT NULL COMMENT 'id ',
`create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT ' YYYY-MM-DD hh:mm:ss',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=208 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_user_daily_login_duration
-- ----------------------------
DROP TABLE IF EXISTS `t_user_daily_login_duration`;
CREATE TABLE `t_user_daily_login_duration` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '',
`user_id` int DEFAULT NULL COMMENT 'ID',
`login_date` date DEFAULT NULL COMMENT '',
`total_seconds` int DEFAULT NULL COMMENT '线',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Table structure for t_user_exams_score
-- ----------------------------
DROP TABLE IF EXISTS `t_user_exams_score`;
CREATE TABLE `t_user_exams_score` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`user_id` int DEFAULT NULL COMMENT 'id ',
`exam_id` int DEFAULT NULL COMMENT 'id ',
`total_time` int DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
`user_time` int DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
`user_score` int unsigned DEFAULT '0' COMMENT '',
`limit_time` datetime DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
`count` int DEFAULT '0' COMMENT '',
`state` int DEFAULT NULL COMMENT ' 0 1',
`create_time` datetime DEFAULT NULL COMMENT ' YYYY-MM-DD hh:mm:ss',
`whether_mark` int DEFAULT NULL COMMENT '-101',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `user_id` (`user_id`,`exam_id`)
) ENGINE=InnoDB AUTO_INCREMENT=194 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for t_user_exercise_record
-- ----------------------------
DROP TABLE IF EXISTS `t_user_exercise_record`;
CREATE TABLE `t_user_exercise_record` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id ',
`user_id` int DEFAULT NULL COMMENT 'id',
`repo_id` int DEFAULT NULL COMMENT 'id',
`total_count` int DEFAULT NULL COMMENT '',
`exercise_count` int DEFAULT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;