/*
Navicat MySQL Data Transfer

Source Server         : 116.62.209.98
Source Server Version : 50717
Source Host           : 116.62.209.98:3306
Source Database       : bbyb_examination

Target Server Type    : MYSQL
Target Server Version : 50717
File Encoding         : 65001

Date: 2023-08-08 11:08:35
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for examination_apply
-- ----------------------------
DROP TABLE IF EXISTS `examination_apply`;
CREATE TABLE `examination_apply` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id;id',
  `user_id` int(20) DEFAULT NULL COMMENT '考生id;考生id',
  `plan_id` int(20) DEFAULT NULL COMMENT '考试计划id;考试计划id',
  `examination_code` varchar(20) DEFAULT NULL COMMENT '考号;考号',
  `apply_state` int(2) DEFAULT '0' COMMENT '申请状态;申请状态（0 未处理 1 已通过 2 未通过）',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人;创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间;创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人;更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间;更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试申请表;考试申请表';

-- ----------------------------
-- Records of examination_apply
-- ----------------------------

-- ----------------------------
-- Table structure for examination_major
-- ----------------------------
DROP TABLE IF EXISTS `examination_major`;
CREATE TABLE `examination_major` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id;id',
  `major_code` varchar(50) DEFAULT NULL COMMENT '专业编码;专业编码',
  `major_name` varchar(50) DEFAULT NULL COMMENT '专业名称;专业名称',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人;创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间;创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人;更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间;更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试专业表;考试专业表';

-- ----------------------------
-- Records of examination_major
-- ----------------------------

-- ----------------------------
-- Table structure for examination_paper
-- ----------------------------
DROP TABLE IF EXISTS `examination_paper`;
CREATE TABLE `examination_paper` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `paper_name` varchar(100) DEFAULT NULL COMMENT '试卷名称;试卷名称',
  `paper_code` varchar(50) DEFAULT NULL COMMENT '试卷号;试卷号',
  `subject_id` int(20) DEFAULT NULL COMMENT '考试科目id;考试科目id',
  `examination_start_time` datetime DEFAULT NULL COMMENT '考试开始时间;考试开始时间',
  `examination_end_time` datetime DEFAULT NULL COMMENT '考试结束时间;考试结束时间',
  `plan_id` int(20) DEFAULT NULL COMMENT '所属考试计划id;所属考试计划id',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='试卷表;试卷表';

-- ----------------------------
-- Records of examination_paper
-- ----------------------------

-- ----------------------------
-- Table structure for examination_paper_answer
-- ----------------------------
DROP TABLE IF EXISTS `examination_paper_answer`;
CREATE TABLE `examination_paper_answer` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `question_id` int(20) DEFAULT NULL COMMENT '题目id;题目id',
  `answer_text` varchar(4000) DEFAULT NULL COMMENT '标准答案;标准答案',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='试卷答案表;试卷答案表';

-- ----------------------------
-- Records of examination_paper_answer
-- ----------------------------

-- ----------------------------
-- Table structure for examination_paper_question
-- ----------------------------
DROP TABLE IF EXISTS `examination_paper_question`;
CREATE TABLE `examination_paper_question` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id;id',
  `paper_id` int(20) DEFAULT NULL COMMENT '试卷id;试卷id',
  `question_title` varchar(4000) DEFAULT NULL COMMENT '题目标题;题目标题',
  `quertion_num` varchar(3) DEFAULT NULL COMMENT '题目号;题目号',
  `quertion_type` varchar(10) DEFAULT NULL COMMENT '题型;题型',
  `pre_question_id` int(20) DEFAULT NULL COMMENT '上一道题目id;上一道题目id',
  `score` decimal(5,1) DEFAULT NULL COMMENT '题目分数;题目分数',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人;创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间;创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人;更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间;更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='试卷题目表;试卷题目表';

-- ----------------------------
-- Records of examination_paper_question
-- ----------------------------

-- ----------------------------
-- Table structure for examination_paper_result
-- ----------------------------
DROP TABLE IF EXISTS `examination_paper_result`;
CREATE TABLE `examination_paper_result` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `question_id` int(20) DEFAULT NULL COMMENT '考试题目id;考试题目id',
  `user_id` int(20) DEFAULT NULL COMMENT '考试人;考试人',
  `answer_text` varchar(4000) DEFAULT NULL COMMENT '答案;答案',
  `score` decimal(4,1) DEFAULT NULL COMMENT '得分;得分',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试结果表;考试结果表';

-- ----------------------------
-- Records of examination_paper_result
-- ----------------------------

-- ----------------------------
-- Table structure for examination_paper_score
-- ----------------------------
DROP TABLE IF EXISTS `examination_paper_score`;
CREATE TABLE `examination_paper_score` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `paper_id` int(20) DEFAULT NULL COMMENT '试卷id;paper_id',
  `user_id` int(20) DEFAULT NULL COMMENT '考生id;user_id',
  `score` decimal(4,1) DEFAULT '0.0' COMMENT '总分数',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试数据表;考试数据表';

-- ----------------------------
-- Records of examination_paper_score
-- ----------------------------

-- ----------------------------
-- Table structure for examination_plan
-- ----------------------------
DROP TABLE IF EXISTS `examination_plan`;
CREATE TABLE `examination_plan` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `plan_name` varchar(100) DEFAULT NULL COMMENT '考试计划名称;考试计划名称',
  `plan_explain` varchar(255) DEFAULT NULL COMMENT '计划说明;计划说明',
  `plan_start_time` datetime DEFAULT NULL COMMENT '计划开始时间;考试开始时间',
  `plan_end_time` datetime DEFAULT NULL COMMENT '计划结束时间;考试结束时间',
  `major_id` int(20) DEFAULT NULL COMMENT '考试专业;考试专业',
  `user_in_charge` int(20) DEFAULT NULL COMMENT '计划负责人;计划负责人',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试计划;考试计划';

-- ----------------------------
-- Records of examination_plan
-- ----------------------------

-- ----------------------------
-- Table structure for examination_subject
-- ----------------------------
DROP TABLE IF EXISTS `examination_subject`;
CREATE TABLE `examination_subject` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `subject_code` varchar(50) DEFAULT NULL COMMENT '学科编码;学科编码',
  `subject_name` varchar(50) DEFAULT NULL COMMENT '学科名称;学科名称',
  `major_id` int(20) DEFAULT NULL COMMENT '专业id;专业id',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试学科表;考试学科表';

-- ----------------------------
-- Records of examination_subject
-- ----------------------------

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `menu_code` varchar(50) DEFAULT NULL COMMENT '菜单编码',
  `menu_name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
  `menu_authority_code` varchar(50) DEFAULT NULL COMMENT '菜单权限编码',
  `menu_path` varchar(100) DEFAULT NULL COMMENT '菜单路径',
  `parent_menu_id` int(11) DEFAULT NULL COMMENT '父级菜单id',
  `level` int(2) DEFAULT NULL COMMENT '菜单等级',
  `menu_type` int(1) DEFAULT '0' COMMENT '菜单类型（0 菜单 1 按钮）',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) DEFAULT '0' COMMENT '数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8 COMMENT='菜单表;菜单表';

-- ----------------------------
-- Records of menu
-- ----------------------------
INSERT INTO `menu` VALUES ('3', '基础设置', '基础设置', 'system/base', 'system/base', '0', '1', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('4', '账号信息', '账号信息', 'system/base/user', 'system/base/user', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('5', '菜单信息', '菜单信息', 'system/base/menu', 'system/base/menu', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('6', '角色信息', '角色信息', 'system/base/role', 'system/base/role', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('7', '字典信息', '字典信息', 'system/base/dic', 'system/base/dic', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('8', '题型信息', '题型信息', 'system/base/questionType', 'system/base/questionType', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('9', '考试管理', '考试管理', 'system/examination', 'system/examination', '0', '1', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('10', '考试计划', '考试计划', 'system/examination/plan', 'system/examination/plan', '9', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('11', '试卷管理', '试卷管理', 'system/examination/paper', 'system/examination/paper', '9', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('12', '考试申请', '考试申请', 'system/examination/apply', 'system/examination/apply', '9', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('13', '答卷管理', '答卷管理', 'system/examination/result', 'system/examination/result', '9', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('14', '考试结果统计', '考试结果统计', 'system/examination/statistics', 'system/examination/statistics', '9', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('15', '考试学科', '考试学科', 'system/base/subject', 'system/base/subject', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('16', '考试专业', '考试专业', 'system/base/major', 'system/base/major', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('17', '新增', '新增', 'system/base/user/add', 'system/base/useradd', '4', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('18', '修改', '修改', 'system/base/user/update', 'system/base/user/update', '4', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('19', '删除', '删除', 'system/base/user/delete', 'system/base/user/delete', '4', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('20', '新增', '新增', 'system/base/menu/add', 'system/base/menu/add', '5', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('21', '修改', '修改', 'system/base/menu/update', 'system/base/menu/update', '5', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('22', '删除', '删除', 'system/base/menu/delete', 'system/base/menu/delete', '5', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('23', '新增', '新增', 'system/base/role/add', 'system/base/role/add', '6', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('24', '修改', '修改', 'system/base/role/update', 'system/base/role/update', '6', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('25', '删除', '删除', 'system/base/role/delete', 'system/base/role/delete', '6', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('26', '新增', '新增', 'system/base/dic/add', 'system/base/dic/add', '7', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('27', '修改', '修改', 'system/base/dic/update', 'system/base/dic/update', '7', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('28', '删除', '删除', 'system/base/dic/delete', 'system/base/dic/delete', '7', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('29', '新增', '新增', 'system/base/questionType/add', 'system/base/questionType/add', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('30', '修改', '修改', 'system/base/questionType/update', 'system/base/questionType/update', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('31', '删除', '删除', 'system/base/questionType/delete', 'system/base/questionType/delete', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('32', '新增', '新增', 'system/examination/plan/add', 'system/examination/plan/add', '10', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('33', '修改', '修改', 'system/examination/plan/update', 'system/examination/plan/update', '10', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('34', '删除', '删除', 'system/examination/plan/delete', 'system/examination/plan/delete', '10', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('35', '新增', '新增', 'system/examination/paper/add', 'system/examination/paper/add', '11', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('36', '修改', '修改', 'system/examination/paper/update', 'system/examination/paper/update', '11', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('37', '删除', '删除', 'system/examination/paper/delete', 'system/examination/paper/delete', '11', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('38', '申请', '申请', 'system/examination/apply/add', 'system/examination/apply/add', '12', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('39', '修改', '修改', 'system/examination/apply/update', 'system/examination/apply/update', '12', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('40', '删除', '删除', 'system/examination/apply/delete', 'system/examination/apply/delete', '12', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('41', '审核', '审核', 'system/examination/apply/audit', 'system/examination/apply/audit', '12', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('42', '修改', '修改', 'system/examination/result/update', 'system/examination/result/update', '13', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('43', '重新核对答案', '重新核对答案', 'system/examination/result/recheck', 'system/examination/result/recheck', '13', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('44', '新增', '新增', 'system/base/subject/add', 'system/base/subject/add', '15', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('45', '修改', '修改', 'system/base/subject/update', 'system/base/subject/update', '15', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('46', '删除', '删除', 'system/base/subject/delete', 'system/base/subject/delete', '15', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('47', '新增', '新增', 'system/base/major/add', 'system/base/major/add', '16', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('48', '修改', '修改', 'system/base/major/update', 'system/base/major/update', '16', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu` VALUES ('49', '删除', '删除', 'system/base/major/delete', 'system/base/major/delete', '16', '3', '1', 'admin', '2023-02-10 13:31:26', null, null, '0');

-- ----------------------------
-- Table structure for menu_copy1
-- ----------------------------
DROP TABLE IF EXISTS `menu_copy1`;
CREATE TABLE `menu_copy1` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `menu_code` varchar(50) DEFAULT NULL COMMENT '菜单编码',
  `menu_name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
  `menu_authority_code` varchar(50) DEFAULT NULL COMMENT '菜单权限编码',
  `menu_path` varchar(100) DEFAULT NULL COMMENT '菜单路径',
  `parent_menu_id` int(11) DEFAULT NULL COMMENT '父级菜单id',
  `level` int(2) DEFAULT NULL COMMENT '菜单等级',
  `menu_type` int(1) DEFAULT '0' COMMENT '菜单类型（0 菜单 1 按钮）',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) DEFAULT '0' COMMENT '数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='菜单表;菜单表';

-- ----------------------------
-- Records of menu_copy1
-- ----------------------------
INSERT INTO `menu_copy1` VALUES ('3', '基础设置', '基础设置', 'system/base', 'system/base', '0', '1', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu_copy1` VALUES ('4', '账号信息', '账号信息', 'system/base/user', 'system/base/user', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu_copy1` VALUES ('5', '菜单信息', '菜单信息', 'system/base/menu', 'system/base/menu', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');
INSERT INTO `menu_copy1` VALUES ('6', '角色信息', '角色信息', 'system/base/role', 'system/base/role', '3', '2', '0', 'admin', '2023-02-10 13:31:26', null, null, '0');

-- ----------------------------
-- Table structure for question_type
-- ----------------------------
DROP TABLE IF EXISTS `question_type`;
CREATE TABLE `question_type` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id;id',
  `question_code` varchar(50) DEFAULT NULL COMMENT '题型编码;题型编码',
  `question_name` varchar(50) DEFAULT NULL COMMENT '题型名称;题型名称',
  `grading_type` int(1) DEFAULT NULL COMMENT '判卷方式;判卷方式（1 匹配答案 2 主观判断）',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人;创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间;创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人;更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间;更新时间',
  `invalid` int(1) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='题型表;题型表';

-- ----------------------------
-- Records of question_type
-- ----------------------------

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_code` varchar(50) DEFAULT NULL COMMENT '角色编码',
  `role_name` varchar(50) DEFAULT NULL COMMENT '角色名称',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COMMENT='角色表;角色表';

-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', 'asd', 'qwe', 'zxc', '2023-08-07 12:12:12', '杰克', '2023-08-07 12:12:12', '1');
INSERT INTO `role` VALUES ('2', 'asd', 'qwe', 'zxc', '2023-08-07 12:12:12', '杰克', '2023-08-07 12:12:12', '1');
INSERT INTO `role` VALUES ('3', '11246', 'fghcj', 'qwf', '2023-09-02 12:23:23', 'ssssssdf', '2023-09-02 12:23:23', '1');
INSERT INTO `role` VALUES ('5', '12344', 'fghj', 'qwf', '2023-09-02 12:23:23', 'ssssssdf', '2023-09-02 12:23:23', '1');
INSERT INTO `role` VALUES ('7', '12345', 'fghej', 'qwf', '2023-09-02 12:23:23', 'ssssssdf', '2023-09-02 12:23:23', '1');
INSERT INTO `role` VALUES ('19', 'qwe', 'qwd', 'asdv', '2023-01-01 12:12:23', 'wef', '2023-01-01 12:12:23', '1');
INSERT INTO `role` VALUES ('21', 'lign_role_code1', 'lign_role_name1', '张三', '2023-03-06 16:38:16', '张三', '2023-03-06 16:38:16', '1');
INSERT INTO `role` VALUES ('27', 'lign_role_code3', 'lign_role_name3', '张三', '2023-03-07 09:26:03', '张三', '2023-03-07 09:26:03', '0');
INSERT INTO `role` VALUES ('28', 'test_role1', '测试角色1', null, '2023-03-07 13:37:50', null, '2023-03-07 13:37:50', '1');
INSERT INTO `role` VALUES ('29', 'test_role1', '测试角色1', null, '2023-03-07 14:30:29', null, '2023-03-07 14:30:29', '0');
INSERT INTO `role` VALUES ('30', 'TEST', '测试角色2', null, '2023-03-07 14:39:56', null, '2023-03-07 15:19:15', '1');
INSERT INTO `role` VALUES ('31', 'test_role1', '测试角色1', null, '2023-03-07 17:05:26', null, '2023-03-07 17:05:26', '1');
INSERT INTO `role` VALUES ('32', 'test_role3', '测试角色3', null, '2023-03-07 17:33:30', null, '2023-03-07 17:33:30', '1');
INSERT INTO `role` VALUES ('33', 'asd', 'qwe', 'zxc', '2023-08-07 12:12:12', '杰克', '2023-08-07 12:12:12', '1');

-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
DROP TABLE IF EXISTS `role_menu`;
CREATE TABLE `role_menu` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` int(20) DEFAULT NULL COMMENT '角色id',
  `menu_id` int(20) DEFAULT NULL COMMENT '菜单id',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8 COMMENT='角色菜单关联表;角色菜单关联表';

-- ----------------------------
-- Records of role_menu
-- ----------------------------
INSERT INTO `role_menu` VALUES ('28', '19', '3', '创建人', '2023-03-06 15:34:28', null, null, '0');
INSERT INTO `role_menu` VALUES ('29', '19', '4', '创建人', '2023-03-06 15:34:28', null, null, '0');
INSERT INTO `role_menu` VALUES ('30', '19', '17', '创建人', '2023-03-06 15:34:28', null, null, '0');
INSERT INTO `role_menu` VALUES ('31', '19', '5', '创建人', '2023-03-06 15:34:28', null, null, '0');
INSERT INTO `role_menu` VALUES ('32', '19', '20', '创建人', '2023-03-06 15:34:28', null, null, '0');
INSERT INTO `role_menu` VALUES ('33', '19', '21', '创建人', '2023-03-06 15:34:28', null, null, '0');
INSERT INTO `role_menu` VALUES ('81', '11', '5', '系统管理员', '2023-08-08 00:19:35', '系统管理员', '2023-08-08 00:19:35', '1');
INSERT INTO `role_menu` VALUES ('82', '11', '6', '系统管理员', '2023-08-08 00:19:35', '系统管理员', '2023-08-08 00:19:35', '1');
INSERT INTO `role_menu` VALUES ('83', '11', '7', '系统管理员', '2023-08-08 00:19:35', '系统管理员', '2023-08-08 00:19:35', '1');
INSERT INTO `role_menu` VALUES ('84', '11', '5', '系统管理员', '2023-08-08 00:19:35', '系统管理员', '2023-08-08 00:19:35', '0');
INSERT INTO `role_menu` VALUES ('85', '11', '6', '系统管理员', '2023-08-08 00:19:35', '系统管理员', '2023-08-08 00:19:35', '0');
INSERT INTO `role_menu` VALUES ('86', '11', '7', '系统管理员', '2023-08-08 00:19:35', '系统管理员', '2023-08-08 00:19:35', '0');

-- ----------------------------
-- Table structure for role_user
-- ----------------------------
DROP TABLE IF EXISTS `role_user`;
CREATE TABLE `role_user` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` int(20) DEFAULT NULL COMMENT '角色id',
  `user_id` int(20) DEFAULT NULL COMMENT '用户id',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=100041 DEFAULT CHARSET=utf8 COMMENT='角色用户关联表;角色用户关联表';

-- ----------------------------
-- Records of role_user
-- ----------------------------
INSERT INTO `role_user` VALUES ('100001', '19', '29', '创建人', '2023-03-06 15:51:11', null, null, '0');
INSERT INTO `role_user` VALUES ('100002', '19', '11', '张三', '2023-08-07 02:05:18', '张三', '2023-08-07 02:05:18', '1');
INSERT INTO `role_user` VALUES ('100008', '11', '11', '张三', '2023-08-07 02:05:24', null, '2023-08-07 02:05:24', '0');
INSERT INTO `role_user` VALUES ('100009', '33', '11', '张三', '2023-08-07 01:55:27', null, '2023-08-07 01:55:27', '0');
INSERT INTO `role_user` VALUES ('100010', '29', '11', null, '2023-08-07 01:55:29', null, '2023-08-07 01:55:29', '0');
INSERT INTO `role_user` VALUES ('100011', '30', '29', null, '2023-03-07 14:40:11', null, '2023-03-07 14:40:11', '1');
INSERT INTO `role_user` VALUES ('100032', '2', '1', '系统管理员', '2023-08-07 15:08:48', '系统管理员', '2023-08-07 15:08:48', '0');
INSERT INTO `role_user` VALUES ('100033', '3', '1', '系统管理员', '2023-08-07 15:08:48', '系统管理员', '2023-08-07 15:08:48', '0');
INSERT INTO `role_user` VALUES ('100034', '3', '1', '系统管理员', '2023-08-07 15:08:48', '系统管理员', '2023-08-07 15:08:48', '0');
INSERT INTO `role_user` VALUES ('100035', '4', '19', '系统管理员', '2023-08-08 00:19:30', '系统管理员', '2023-08-08 00:19:30', '1');
INSERT INTO `role_user` VALUES ('100036', '5', '19', '系统管理员', '2023-08-08 00:19:30', '系统管理员', '2023-08-08 00:19:30', '1');
INSERT INTO `role_user` VALUES ('100037', '6', '19', '系统管理员', '2023-08-08 00:19:30', '系统管理员', '2023-08-08 00:19:30', '1');
INSERT INTO `role_user` VALUES ('100038', '4', '19', '系统管理员', '2023-08-08 00:19:30', '系统管理员', '2023-08-08 00:19:30', '0');
INSERT INTO `role_user` VALUES ('100039', '5', '19', '系统管理员', '2023-08-08 00:19:30', '系统管理员', '2023-08-08 00:19:30', '0');
INSERT INTO `role_user` VALUES ('100040', '6', '19', '系统管理员', '2023-08-08 00:19:30', '系统管理员', '2023-08-08 00:19:30', '0');

-- ----------------------------
-- Table structure for sys_dic
-- ----------------------------
DROP TABLE IF EXISTS `sys_dic`;
CREATE TABLE `sys_dic` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `group_name` varchar(50) DEFAULT NULL COMMENT '字典分组名称',
  `item_name` varchar(50) DEFAULT NULL COMMENT '项目名称',
  `item_code` varchar(50) DEFAULT NULL COMMENT '项目编码',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(2) NOT NULL DEFAULT '0' COMMENT '是否作废;数据作废标识（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据字典表;数据字典表';

-- ----------------------------
-- Records of sys_dic
-- ----------------------------

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_code` varchar(50) DEFAULT NULL COMMENT '用户编码',
  `user_name` varchar(50) DEFAULT NULL COMMENT '用户名称',
  `phone` varchar(100) DEFAULT NULL COMMENT '手机号',
  `password` varchar(255) DEFAULT NULL COMMENT '密码',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `id_card` varchar(100) DEFAULT NULL COMMENT '身份证号',
  `gender` int(1) DEFAULT NULL COMMENT '性别（1 男 2 女）',
  `is_admin` int(1) DEFAULT '0' COMMENT '是否超级管理员（0 否 1 是）',
  `is_enable` int(1) DEFAULT '0' COMMENT '是否启用（0 启用 1 禁用）',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `invalid` int(1) DEFAULT NULL COMMENT '数据是否作废（0 正常 1 作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COMMENT='用户表;用户表';

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', '110001', '管理员', '13211112222', '670b14728ad9902aecba32e22fa4f6bd', null, null, '1', '1', '0', 'abc', '2023-02-10 13:31:26', null, null, null);
INSERT INTO `user` VALUES ('2', '110002', '业务人员张', '13211116666', '670b14728ad9902aecba32e22fa4f6bd', null, null, '1', '0', '0', 'abc', '2023-02-10 13:31:26', null, null, null);
INSERT INTO `user` VALUES ('23', 'lign', 'lign', '15551123333', '123456', null, null, null, '0', '0', null, null, null, null, null);
INSERT INTO `user` VALUES ('29', 'test002', '测试002', '18612345678', '98745678', 'abc@qq.com', '', '1', '1', '0', '', null, null, null, '0');

-- ----------------------------
-- Function structure for queryMenuChildren
-- ----------------------------
DROP FUNCTION IF EXISTS `queryMenuChildren`;
DELIMITER ;;
CREATE DEFINER=`root`@`%` FUNCTION `queryMenuChildren`(nodeId INT) RETURNS varchar(20000) CHARSET utf8
BEGIN
DECLARE sTemp INT;
DECLARE sTempChd INT;

SET sTemp='$';
SET sTempChd = nodeId;

WHILE sTempChd IS NOT NULL DO

SET sTemp= CONCAT(sTemp,',',sTempChd);
SELECT GROUP_CONCAT(id) INTO sTempChd FROM `menu` WHERE FIND_IN_SET(parent_menu_id,sTempChd)>0;

END WHILE;
RETURN sTemp;
END
;;
DELIMITER ;
