SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- 接口文件
-- ----------------------------
CREATE TABLE `magic_api_file` (
  `file_path` varchar(512) NOT NULL COMMENT '文件地址',
  `file_content` mediumtext COMMENT '文件内容',
  PRIMARY KEY (`file_path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '接口文件'

-- ----------------------------
-- 接口文件备份
-- ----------------------------
CREATE TABLE `magic_backup_record` (
  `id` varchar(32) NOT NULL COMMENT '原对象ID',
  `create_date` bigint(13) NOT NULL COMMENT '备份时间',
  `tag` varchar(32) DEFAULT NULL COMMENT '标签',
  `type` varchar(32) DEFAULT NULL COMMENT '类型',
  `name` varchar(64) DEFAULT NULL COMMENT '原名称',
  `content` blob COMMENT '备份内容',
  `create_by` varchar(64) DEFAULT NULL COMMENT '操作人',
  PRIMARY KEY (`id`,`create_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '接口文件备份'

-- ----------------------------
-- 年级表
-- ----------------------------
DROP TABLE IF EXISTS `base_grade`;
CREATE TABLE `base_grade`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '年级名称',
  `title` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '年份',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '年级表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 专业表
-- ----------------------------
DROP TABLE IF EXISTS `base_major`;
CREATE TABLE `base_major`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '专业名称',
  `code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '专业代码',
  `study_year` decimal(6, 1) NOT NULL COMMENT '修业年限(0.5的整数倍)',
  `key_major` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '重点专业(xjr_dictionary_item[key_major])',
  `feature_major` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '特色专业(xjr_dictionary_item[feature_major])',
  `approve_set_date` date NULL DEFAULT NULL COMMENT '批准设置日期',
  `first_recruit_student_date` date NULL DEFAULT NULL COMMENT '首次招生日期(年月)',
  `status` int NULL DEFAULT NULL COMMENT '专业状态(1:正常、2:停招、3:撤销)',
  `leader_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业带头人',
  `director_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业负责人',
  `office_start_date` date NULL DEFAULT NULL COMMENT '任职日期开始',
  `office_end_date` date NULL DEFAULT NULL COMMENT '任职日期结束',
  `is_full_time` int NULL DEFAULT NULL COMMENT '是否全日制',
  `major_gradation_id` bigint NOT NULL COMMENT '办学层次(base_major_gradation)',
  `major_categor_id` bigint NOT NULL COMMENT '专业分类(base_major_categor)',
  `department_id` bigint NOT NULL COMMENT '所属机构(xjr_department)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '专业表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 专业分类表
-- ----------------------------
DROP TABLE IF EXISTS `base_major_categor`;
CREATE TABLE `base_major_categor`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '专业分类名称',
  `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '专业分类代码',
  `remark` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  `major_gradation_id` bigint NOT NULL COMMENT '办学层次(base_major_gradation)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '专业分类表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 办学层次表
-- ----------------------------
DROP TABLE IF EXISTS `base_major_gradation`;
CREATE TABLE `base_major_gradation`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '层次名称',
  `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '层次代码',
  `school_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属职业教育层次(xjr_dictionary_item[school_level])',
  `remark` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '办学层次表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 专业方向表
-- ----------------------------
DROP TABLE IF EXISTS `base_major_set`;
CREATE TABLE `base_major_set`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '专业方向名称',
  `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '专业方向代码',
  `short_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '专业方向简称',
  `skill_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '上报专业技能方向名称',
  `remark` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业方向说明',
  `major_gradation_id` bigint NOT NULL COMMENT '办学层次(base_major_gradation)',
  `major_categor_id` bigint NOT NULL COMMENT '专业分类(base_major_categor)',
  `department_id` bigint NOT NULL COMMENT '所属机构(xjr_department)',
  `major_id` bigint NOT NULL COMMENT '专业(base_major)',
  `study_year` decimal(6, 1) NOT NULL COMMENT '适用学制(base_major)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '专业方向表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 办学层次表
-- ----------------------------
DROP TABLE IF EXISTS `base_school_level`;
CREATE TABLE `base_school_level`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '层次名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '办学层次表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 学期表
-- ----------------------------
DROP TABLE IF EXISTS `base_semester`;
CREATE TABLE `base_semester`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学期名称',
  `start_date` date NULL DEFAULT NULL COMMENT '学期开始日期',
  `end_date` date NULL DEFAULT NULL COMMENT '学期结束日期',
  `teaching_start` date NULL DEFAULT NULL COMMENT '教学开始日期',
  `teaching_end` date NULL DEFAULT NULL COMMENT '教学结束日期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学期表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 课程学科
-- ----------------------------
DROP TABLE IF EXISTS `base_course_subject`;
CREATE TABLE `base_course_subject`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '课程学科名称',
  `code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '课程学科代码',
  `remark` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '课程学科' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 教职工基本信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_teacher`;
CREATE TABLE `base_teacher`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
  -- `job_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '工号',
  -- `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '姓名',
  `as_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '别名',
  `en_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '英文姓名',
  `py_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名拼音',
  `former_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '曾用名',
  -- `gender` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别(xjr_dictionary_item[gender])',
  `job_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '在职状态(xjr_dictionary_item[job_state])',
  `credential_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件类型(xjr_dictionary_item[credential_type])',
  `credential_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件号码',
  `day_of_birth` date NULL DEFAULT NULL COMMENT '出生日期',
  `birth_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '生日类型(xjr_dictionary_item[date_type])',
  `nation` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '民族(xjr_dictionary_item[nation])',
  `blood_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '血型(xjr_dictionary_item[blood_type])',
  `health` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '健康状况(xjr_dictionary_item[health])',
  `marital_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '婚姻状况(xjr_dictionary_item[marital_state])',
  `political_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '政治面貌(xjr_dictionary_item[political_state])',
  `nationality` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '国籍地区(xjr_dictionary_item[nationality])',
  `chinese_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '港澳台侨外(xjr_dictionary_item[chinese_type])',
  `house_hold_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '户口类别(xjr_dictionary_item[house_hold_type])',
  `provinces` bigint NULL DEFAULT NULL COMMENT '省(xjr_area)',
  `city` bigint NULL DEFAULT NULL COMMENT '市(xjr_area)',
  `district` bigint NULL DEFAULT NULL COMMENT '区/县(xjr_area)',
  `house_hold_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '户籍地址',
  `start_work_time` date NULL DEFAULT NULL COMMENT '参加工作年月',
  `join_time` date NULL DEFAULT NULL COMMENT '来校年月',
  `is_organized` smallint NULL DEFAULT NULL COMMENT '是否在编',
  `employ_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '聘用类型(xjr_dictionary_item[employ_type])',
  `employ_way` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '聘用方式(xjr_dictionary_item[employ_type])上级聘用类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教职工基本信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 教职工聘用信息表 未定
-- ----------------------------
DROP TABLE IF EXISTS `base_teacher_employ`;
CREATE TABLE `base_teacher_employ`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
	`type` int NULL COMMENT '岗位类型 (1:校内主岗 2:校内兼职岗位 3:事业制单位主岗)',
  `job_category` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '校内主岗位类别(xjr_dictionary_item[school_job_type])',
  `job_post` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '校内主岗位(xjr_dictionary_item[school_job_type])上级校内主岗位类别',
  `job_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '岗位等级(xjr_dictionary_item[school_job_level])',
  `job_level_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '岗位等级类型(xjr_dictionary_item[school_job_level_type])',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教职工聘用信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 教职工联系信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_teacher_contact`;
CREATE TABLE `base_teacher_contact`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
	-- `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '手机号',
  `office_tel` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '办公室电话',
  `office_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '办公室地址',
  -- `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '邮箱',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '现住地址',
  `qq_msn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT 'QQ&MSN',
  `wechat` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '微信号',
  `microblog` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '微博地址',
  `zip_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '住址邮编',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教职工联系信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 教职工专任信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_teacher_regular`;
CREATE TABLE `base_teacher_regular`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
	`certificate_Type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '教师资格证种类(xjr_dictionary_item[certificate_Type])',
	`belong_org` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属系统(xjr_dictionary_item[belong_org])',
	`mandarin_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '普通话等级(xjr_dictionary_item[mandarin_level])',
  `start_teach_time` date NULL COMMENT '从教起始年月',
  `teaching_status` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '任课状况(xjr_dictionary_item[teaching_status])多选',
  `major_categor_id` bigint NULL COMMENT '任教学科类别(base_major_categor)',
  `is_double_teacher` int NULL COMMENT '是否双师型教师',
  `course_subject_id` bigint NULL COMMENT '任教学科(base_course_subject)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教职工专任信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 教职工学历学位表
-- ----------------------------
DROP TABLE IF EXISTS `base_teacher_education`;
CREATE TABLE `base_teacher_education`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
	`specialty` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '所学专业',
  `education` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '最高学历(xjr_dictionary_item[education])',
	`education_college` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '获得最高学历的院校',
  `degree` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '最高学位(xjr_dictionary_item[degree])',
	`degree_college` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '获得最高学位的院校',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教职工学历学位表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 教职工家庭基本信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_teacher_family`;
CREATE TABLE `base_teacher_family`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
  `zip_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭邮编',
  `telephone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭电话',
  `contact` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '联系人姓名',
  `population` int NULL COMMENT '家庭人口',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭住址',
  `finance` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭经济情况',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教职工家庭基本信息表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 教职工家庭成员表
-- ----------------------------
DROP TABLE IF EXISTS `base_teacher_family_member`;
CREATE TABLE `base_teacher_family_member`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
  `relationship` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '与本人关系(xjr_dictionary_item[relationship])',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '姓名',
  `gender` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别(xjr_dictionary_item[gender])',
  `is_guardian` int NULL COMMENT '是否为监护人',
  `day_of_birth` date NULL DEFAULT NULL COMMENT '出生日期',
  `political_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '政治面貌(xjr_dictionary_item[political_state])',
  `occupation` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '职业',
  `work_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '工作单位',
	`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '联系电话',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教职工家庭成员表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 学生毕业中学表
-- ----------------------------
DROP TABLE IF EXISTS `base_graduate_school`;
CREATE TABLE `base_graduate_school`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学校名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生毕业中学表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 学生基本信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_student`;
CREATE TABLE `base_student`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户(xjr_user)',
  `student_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学号',
  -- `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '姓名',
  `as_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '别名',
  `en_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '英文姓名',
  `py_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名拼音',
  `former_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '曾用名',
  -- `gender` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别(xjr_dictionary_item[gender])',
  `credential_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件类型(xjr_dictionary_item[credential_type])',
  `credential_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件号码',
  `day_of_birth` date NULL DEFAULT NULL COMMENT '出生日期',
  `birth_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '生日类型(xjr_dictionary_item[date_type])',
  `nation` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '民族(xjr_dictionary_item[nation])',
  `blood_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '血型(xjr_dictionary_item[blood_type])',
  `health` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '健康状况(xjr_dictionary_item[health])',
  `marital_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '婚姻状况(xjr_dictionary_item[marital_state])',
  `political_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '政治面貌(xjr_dictionary_item[political_state])',
  `religion` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '信仰宗教(xjr_dictionary_item[religion])',
  `nationality` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '国籍地区(xjr_dictionary_item[nationality])',
  `chinese_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '港澳台侨外(xjr_dictionary_item[chinese_type])',
  `provinces` bigint NULL DEFAULT NULL COMMENT '籍贯 省(xjr_area)',
  `city` bigint NULL DEFAULT NULL COMMENT '籍贯 市(xjr_area)',
  `district` bigint NULL DEFAULT NULL COMMENT '籍贯 区/县(xjr_area)',
  `house_hold_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '户口类别(xjr_dictionary_item[house_hold_type])',
  `house_provinces` bigint NULL DEFAULT NULL COMMENT '户口所在地 省(xjr_area)',
  `house_city` bigint NULL DEFAULT NULL COMMENT '户口所在地 市(xjr_area)',
  `house_district` bigint NULL DEFAULT NULL COMMENT '户口所在地 区/县(xjr_area)',
  `house_hold_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '户口所在详细地址',
  `belongs_police` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '所属派出所',
  `birth_provinces` bigint NULL DEFAULT NULL COMMENT '出生地 省(xjr_area)',
  `birth_city` bigint NULL DEFAULT NULL COMMENT '出生地 市(xjr_area)',
  `birth_district` bigint NULL DEFAULT NULL COMMENT '出生地 区/县(xjr_area)',
  `graduate_school_id` bigint null  COMMENT '生源地(base_graduate_school)',
  `residence_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学生居住地类型(xjr_dictionary_item[residence_type])',
  `is_migrate_children` smallint NULL DEFAULT NULL COMMENT '是否随迁子女',
  `train_interval` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '乘火车区间',
  `is_floating_population` smallint NULL DEFAULT NULL COMMENT '是否流动人口',
  `height` decimal(6, 1) NULL DEFAULT NULL COMMENT '身高（cm）',
  `weight` decimal(6, 1) NULL DEFAULT NULL COMMENT '体重（kg）',
  `vision` decimal(6, 1) NULL DEFAULT NULL COMMENT '视力',
  `specialty` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '特长',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生基本信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 学生学籍信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_student_school_roll`;
CREATE TABLE `base_student_school_roll`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
  `roll_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学籍号',
  `archives_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学生档案编号',
  `enrollment_date` date NULL DEFAULT NULL COMMENT '入学年月',
  `enrollment_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '入学方式(xjr_dictionary_item[enrollment_type])',
  `grade_id` bigint NOT NULL COMMENT '入学年级(base_grade)',
  `enroll_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '入学招生类型(xjr_dictionary_item[enroll_type])',
  `major_set_id` bigint NOT NULL COMMENT '在读专业方向(base_major_set)',
  `study_year` decimal(6, 1) NOT NULL COMMENT '学制(base_major_set)',
  `class_id` bigint NOT NULL COMMENT '班级(base_class)',
  `student_source` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学生来源(xjr_dictionary_item[student_type])',
  `student_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学生类别(xjr_dictionary_item[student_type])',
  `archives_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学籍状态(xjr_dictionary_item[archives_status])',
  `stduy_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '就读方式(xjr_dictionary_item[stduy_status])',
  `learn_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学习形式(xjr_dictionary_item[learn_status])',
  `choose_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分流状态(xjr_dictionary_item[choose_status])',
  `foster_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分段培养方式(xjr_dictionary_item[foster_type])',
  `recruit_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '招生方式(xjr_dictionary_item[recruit_type])',
  `recruit_target` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '招生对象(xjr_dictionary_item[recruit_target])',
  `highest_education` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '入学前最高学历(xjr_dictionary_item[education])',
  `graduated_university` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '毕业学校',
  `graduated_score` decimal(6, 1) NULL COMMENT '毕业成绩',
  `examinee_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '考生号',
  `ticket_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '准考证号',
  `admission_scores` decimal(6, 1) NULL DEFAULT 0 COMMENT '入学总分',
  `remark` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生学籍信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 学生资助信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_student_subsidize`;
CREATE TABLE `base_student_subsidize`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
  `is_indemnify` smallint NULL DEFAULT NULL COMMENT '是否低保',
  `is_stipend` smallint NULL DEFAULT NULL COMMENT '是否享受国家助学金',
  `stipend_stand` decimal(6, 1) NULL DEFAULT 0 COMMENT '助学金发放标准（元）',
  `stipend_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学生资助卡号',
  `is_free` smallint NULL DEFAULT NULL COMMENT '是否免学费',
  `is_filing_card` smallint NULL DEFAULT NULL COMMENT '是否建档立卡',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生资助信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 学生联系信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_student_contact`;
CREATE TABLE `base_student_contact`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
	-- `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '手机号',
  -- `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '邮箱',
  `qq_msn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT 'QQ&MSN',
  `wechat` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '微信号',
  `user_page` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '个人主页',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生联系信息表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 学生家庭基本信息表
-- ----------------------------
DROP TABLE IF EXISTS `base_student_family`;
CREATE TABLE `base_student_family`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
  `zip_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭邮编',
  `telephone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭电话',
  `contact` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '联系人姓名',
  `population` int NULL COMMENT '家庭人口',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭住址',
  `income_source` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '家庭主要收入来源',
  `income_number` decimal(6, 1) NULL DEFAULT 0 COMMENT '家庭月收入金额',
  `railway_station` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '离家最近火车站',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生家庭基本信息表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 学生家庭成员表
-- ----------------------------
DROP TABLE IF EXISTS `base_student_family_member`;
CREATE TABLE `base_student_family_member`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
	`user_id` bigint not null COMMENT '用户ID(xjr_user)',
  `relationship` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '与本人关系(xjr_dictionary_item[relationship])',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '姓名',
  `gender` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别(xjr_dictionary_item[gender])',
  `day_of_birth` date NULL DEFAULT NULL COMMENT '出生日期',
  `birth_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '生日类型(xjr_dictionary_item[date_type])',
  `nation` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '民族(xjr_dictionary_item[nation])',
  `work_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '工作单位',
  `occupation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '从事的工作(职业)',
  `position` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '职务',
	`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '联系电话',
  `is_guardian` smallint NULL COMMENT '是否为监护人',
  `credential_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件类型(xjr_dictionary_item[credential_type])',
  `credential_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件号码',
  `political_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '政治面貌(xjr_dictionary_item[political_state])',
  `health` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '健康状况(xjr_dictionary_item[health])',
  `house_provinces` bigint NULL DEFAULT NULL COMMENT '户口所在地 省(xjr_area)',
  `house_city` bigint NULL DEFAULT NULL COMMENT '户口所在地 市(xjr_area)',
  `house_district` bigint NULL DEFAULT NULL COMMENT '户口所在地 区/县(xjr_area)',
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '邮箱',
  `wechat` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '微信号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生家庭成员表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 教学办公楼表
-- ----------------------------
DROP TABLE IF EXISTS `base_office_build`;
CREATE TABLE `base_office_build`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '楼栋名称',
  `org_id` bigint NOT NULL COMMENT '所属校区(xjr_department)第一级',
  `floor_total` int NOT NULL COMMENT '楼层数',
  `build_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '楼栋类型(xjr_dictionary_item[build_type])',
  `status` int NOT NULL COMMENT '状态（1:可用 0:停用）',
  `address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '地址',
  `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL COMMENT '描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教学办公楼表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 教室表
-- ----------------------------
DROP TABLE IF EXISTS `base_classroom`;
CREATE TABLE `base_classroom`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '教室名称',
  `office_build_id` bigint NOT NULL COMMENT '楼栋(base_office_build)',
  `floor_num` int NOT NULL COMMENT '楼层',
  `purpose` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '教室用途(xjr_dictionary_item[purpose])',
  `classroom_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '教室类型(xjr_dictionary_item[classroom_type])',
  `org_id` bigint NOT NULL COMMENT '组织机构(xjr_department)',
  `square` decimal(6, 1) DEFAULT NULL COMMENT '面积（平米）',
  `capacity` decimal(6, 1) DEFAULT NULL COMMENT '容量（人数）',
  `status` int NOT NULL COMMENT '状态（1:可用 0:停用）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '教室表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 班级表
-- ----------------------------
DROP TABLE IF EXISTS `base_class`;
CREATE TABLE `base_class`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '班级名称',
  `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '班级代码',
  `grade_id` bigint NOT NULL COMMENT '所属年级(base_grade)',
  `enroll_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '招生类型(xjr_dictionary_item[enroll_type])',
  `org_id` bigint NOT NULL COMMENT '组织机构(xjr_department)',
  `is_order_class` int DEFAULT NULL COMMENT '是否订单班',
  `classroom_id` bigint DEFAULT NULL COMMENT '固定教室(base_classroom)',
  `teacher_id` bigint DEFAULT NULL COMMENT '班主任(xjr_user)',
  `is_graduate` int DEFAULT NULL COMMENT '在读状态(1: 在读 2: 毕业)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '班级表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 班级专业方向表
-- ----------------------------
DROP TABLE IF EXISTS `base_class_major_set`;
CREATE TABLE `base_class_major_set`  (
  `id` bigint NOT NULL COMMENT '主键',
  `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人',
  `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
  `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人',
  `modify_date` date NULL DEFAULT NULL COMMENT '修改时间',
  `delete_mark` int NOT NULL COMMENT '删除标记',
  `enabled_mark` int NOT NULL COMMENT '有效标志',
  `class_id` bigint NOT NULL COMMENT '班级(base_class_major_set)',
  `major_set_id` bigint NOT NULL COMMENT '专业方向(base_major_set)',
  `plan_total_student` int DEFAULT NULL COMMENT '计划人数',
  `total_student` int DEFAULT NULL COMMENT '班级人数',
  `boy_num` int DEFAULT NULL COMMENT '男生人数',
  `girl_num` int DEFAULT NULL COMMENT '女生人数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '班级专业方向表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
