SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- 用户表添加字段
ALTER TABLE xjr_user ADD COLUMN `credential_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件类型(xjr_dictionary_item[credential_type])' AFTER sort_code;
ALTER TABLE xjr_user ADD COLUMN `credential_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证件号码' AFTER sort_code;

-- 新闻添加字段
ALTER TABLE xjr_oa_news ADD COLUMN `emergent` int NULL DEFAULT NULL COMMENT '紧急程度  1=一般 2=紧急';
ALTER TABLE xjr_oa_news ADD COLUMN `send_dept_id` bigint NULL DEFAULT NULL COMMENT '发送部门';
ALTER TABLE xjr_oa_news ADD COLUMN `send_start_date` datetime NULL DEFAULT NULL COMMENT '张贴开起时间';
ALTER TABLE xjr_oa_news ADD COLUMN `send_end_date` datetime NULL DEFAULT NULL COMMENT '张贴结束时间';
ALTER TABLE xjr_oa_news ADD COLUMN `open_reply` int NULL DEFAULT NULL COMMENT '接收人回复要求 1=必须回复 2=不允许回复 3=可以回复 (不强制要求)';
ALTER TABLE xjr_oa_news ADD COLUMN `open_forward` int NULL DEFAULT NULL COMMENT '是否允许接收人转发 0=不能转发 1=允许转发';
ALTER TABLE xjr_oa_news ADD COLUMN `open_view_other` int NULL DEFAULT NULL COMMENT '是否允许接收人查看其他接收人 0=不允许查看 1=允许查看';
ALTER TABLE xjr_oa_news ADD COLUMN `level` int NULL DEFAULT NULL COMMENT '级别 1=校级 2=班级';
ALTER TABLE xjr_oa_news ADD COLUMN `send_range` int NULL DEFAULT NULL COMMENT '发送范围 1=所有人 2=根据权限';

-- 新闻关联
ALTER TABLE xjr_oa_news_relation ADD COLUMN `read_mark` int NULL DEFAULT NULL COMMENT '阅读标记  0=未读 1=已读';
ALTER TABLE xjr_oa_news_relation ADD COLUMN `read_date` datetime NULL DEFAULT NULL COMMENT '阅读时间';
ALTER TABLE xjr_oa_news_relation ADD COLUMN `reply_content` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '回复内容';

-- ----------------------------
-- 新闻附件
-- ----------------------------
DROP TABLE IF EXISTS `xjr_oa_news_appendix`;
CREATE TABLE `xjr_oa_news_appendix` (
    `id` bigint NOT NULL COMMENT '主键',
    `news_id` bigint NULL DEFAULT NULL COMMENT '新闻ID',
    `file_id` bigint NULL DEFAULT NULL COMMENT '文件ID(xjr_file)',
    `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '新闻附件'


-- ----------------------------
-- 新闻关联配置
-- ----------------------------
DROP TABLE IF EXISTS `xjr_oa_news_relation_config`;
CREATE TABLE `xjr_oa_news_relation_config` (
    `id` bigint NOT NULL COMMENT '主键',
    `news_id` bigint NULL DEFAULT NULL COMMENT '新闻ID',
    `relation_type` int NULL DEFAULT NULL COMMENT '关系类型 1=部门 2=人员',
    `relation_id` bigint NULL DEFAULT NULL COMMENT '关系ID',
    `relation_name` varchar(100) NULL DEFAULT NULL COMMENT '关系名称',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '新闻关联配置'

-- ----------------------------
-- 接口文件
-- ----------------------------
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])',
  `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` json 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;

-- ----------------------------
-- 车辆管理
-- ----------------------------
DROP TABLE IF EXISTS `base_car_management`;
CREATE TABLE `base_car_management`  (
  `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 COMMENT '用户(xjr_user)',
  `car_no` varchar(9) not null COMMENT '车牌号码',
  `c_name` varchar(20) COMMENT '姓名',
  `c_id` varchar(18) COMMENT '身份证号',
  `c_phone` varchar(50) COMMENT '联系电话',
  `c_address` varchar(50) COMMENT '住址',
  `c_type` int not null default 1 COMMENT '车牌类型 1=民用 2=军队 3=警用 4=武警',
  `c_fee_type` int not null default 1 COMMENT '收费类型 1=月卡 2=临时车 3=免费车 4=储值卡',
  `sync_status` tinyint(4) unsigned default 1 not null COMMENT '数据同步状态 1=未同步 2=已同步 3=同步失败',
  `status` tinyint(4) unsigned default 1 not null COMMENT '状态 1=启用 2=禁用',
  `c_sync_id` int default 0 not null COMMENT '数据同步编号',
  `c_start_time` datetime not null COMMENT '开始时间',
  `c_end_time` datetime not null COMMENT '结束时间',
  PRIMARY KEY (`id`) USING BTREE,
  unique key `only`(`car_no`)
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '车辆管理' ROW_FORMAT = Dynamic;


-- ----------------------------
-- 车辆进出记录
-- ----------------------------
DROP TABLE IF EXISTS `base_car_park_records`;
CREATE TABLE `base_car_park_records`  (
  `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 '有效标志',
  `base_car_management_id` bigint COMMENT '车辆编号(base_car_management)',
  `car_no` varchar(9) not null COMMENT '车牌号码',
  `in_time` datetime not null COMMENT '进场时间',
  `out_time` datetime COMMENT '出场时间',
  `status` tinyint(4) unsigned default 1 not null COMMENT '状态 1=进 2=出',
  `in_passing` tinyint(4) unsigned default 0 not null COMMENT '进类型 0=识别过车  1=手工进免费车 2=手工进临时车 3=匹配进车',
  `out_passing` tinyint(4) unsigned default 0 not null COMMENT '出类型 0=识别过车  1=手工出免费车 2=手工进临时车 3=匹配进车',
  `remark` varchar(500) COMMENT '备注',
  `c_sync_id` int default 0 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_face_management`;
CREATE TABLE `base_face_management`  (
  `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 COMMENT '用户(xjr_user)',
  `face_code` varchar(50) not null default '' COMMENT '人脸编码',
  `name` varchar(50) not null default '' COMMENT '姓名',
  `sex` varchar(10) not null default '' COMMENT '性别 男, 女',
  `idno` varchar(20) not null default '' COMMENT '身份证号',
  `people_start_date` datetime COMMENT '名单有效期开始时间',
  `people_end_date` datetime COMMENT '名单有效期结束时间',
  `icno` varchar(20) not null default '' COMMENT ' ic卡号（10位10进制）',
  `register_base64` mediumblob COMMENT '图片的base64字符串',
  `verify_status` tinyint(4) unsigned default 1 not null COMMENT '验证状态 1=未验证 2=通过 3=失败',
  `verify_error_msg` varchar(200) not null default '' COMMENT '验证失败说明',
  `sync_status` tinyint(4) unsigned default 1 not null COMMENT '数据同步状态 1=未同步 2=已同步 3=同步失败',
  `status` tinyint(4) unsigned default 1 not 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_face_identify_records`;
CREATE TABLE `base_face_identify_records`  (
  `id` bigint NOT NULL COMMENT '主键',
  `mac_addr` varchar(100) COMMENT '设备唯一标识码',
  `verify_time` datetime COMMENT '比对时间 yyyy-MM-dd HH:mm:ss',
  `device_name` varchar(100) COMMENT '设备名称',
  `location` varchar(100) COMMENT '安装位置',
  `inout_direction` tinyint(4) unsigned COMMENT '出入 0=出口 1=入口',
  `face_code` varchar(50) not null default '' COMMENT '人脸编码',
  `name` varchar(50) COMMENT '姓名',
  `temperature` varchar(50) COMMENT '体温',
  `face_base64` text COMMENT '比对抓拍照片 base64位字符串',
  `result_status` tinyint(4) unsigned COMMENT '比对结果 1=比对成功 0=比对失败',
  `identify_type` tinyint(4) unsigned COMMENT '识别方式（比对类型）：0人脸识别， 1 黑名单识别（预留字段），2人证比对， 3 IC卡识别',
  `face_identify_sync_id` int default 0 not null COMMENT '数据同步编号',
  PRIMARY KEY (`id`) USING BTREE,
  unique index index_no(face_identify_sync_id)
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '人脸识别记录' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 短信验证码
-- ----------------------------
DROP TABLE IF EXISTS sms_send_record;
create table sms_send_record
(
    id bigint not null comment '主键编号' ,
    mobile_number varchar(64) not null comment '手机号码',
    sms varchar(512) not null default '' comment '短信内容',
    `status` tinyint(4) unsigned default 1 not null comment '状态 1=已发送 2=发送失败',
    `error_msg` varchar(200) not null default '' COMMENT '验证失败说明',
    `create_date` date null default null COMMENT '创建时间',
    `modify_date` date null default null COMMENT '修改时间',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '短信发送记录';

-- ----------------------------
-- 家长学生关联表
-- ----------------------------
DROP TABLE IF EXISTS base_user_student;
create table base_user_student
(
    `id` bigint NOT NULL COMMENT '主键',
    user_id bigint not null comment '家长ID(xjr_user)',
    student_id bigint not null comment '学生ID(xjr_user)',
    `create_date` date null default null COMMENT '创建时间',
    `modify_date` date null default null COMMENT '修改时间',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '家长学生关联表';

-- ----------------------------
-- 上课时间
-- ----------------------------
drop table if exists class_time;
create table class_time
(
    id bigint not null comment '主键编号' ,
    time_period int default 0 not null  comment '时段（1=上午 2=下午 3=晚上）',
    number int not null comment '节次',
    full_name varchar(200)  not null default '' comment '全称',
    short_name varchar(100)  not null default '' comment '简称',
    `summer_start_time` time not null comment '夏天开始时间',
    `summer_end_time` time not null comment '夏天结束时间',
    `winter_start_time` time not null comment '冬天开始时间',
    `winter_end_time` time not null comment '冬天结束时间',
    remark varchar(2000) not null default '' comment '备注',
    `create_date` date null default null COMMENT '创建时间',
    `modify_date` date null default null COMMENT '修改时间',
    primary key (`id`),
    unique key `only`(`time_period`,`number`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '上课时间';

-- ----------------------------
-- 课表
-- ----------------------------
drop table if exists course_table;
create table course_table
(
    id bigint not null comment '主键编号' ,
    `base_semester_id` bigint COMMENT '学期ID(base_semester)',
    teacher_id bigint not null default 0 comment '教师编号(用户表)',
    teacher_name varchar(50) not null default '' comment '教师名称',
    course_id bigint not null default 0 comment '课程编号(course)',
    course_name varchar(200) not null default '' comment '课程名称',
    class_id bigint not null default 0 comment '班级编号(class)',
    class_name varchar(200) not null default '' comment '班级名称',
    week int comment '周',
    weeks int comment '星期几(1-7)',
    weeks_cn varchar(200) comment '星期中文',
    time_period int default 0 not null  comment '时段（1=上午 2=下午 3=晚上）',
    time_number  int comment '节次',
    site_id int not null default 0 comment '场地编号(site)',
    site_name varchar(200) not null default '' comment '场地名称',
    status int not null default 1 comment '状态 1=正常 2=错误',
    err_msg varchar(200) not null default '' comment '错误信息描述',
    `create_date` date null default null COMMENT '创建时间',
    `modify_date` date null default null COMMENT '修改时间',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '课表';

-- ----------------------------
-- 三方客户端管理
-- ----------------------------
drop table if exists oauth_client_details;
create table oauth_client_details
(
    id bigint not null comment '主键编号' ,
    `client_id` varchar(100) not null COMMENT '应用标识',
    `client_name` varchar(200) not null COMMENT '应用名称',
    `client_secret` varchar(200) not null COMMENT '应用密钥',
    `allow_url` varchar(4000) not null default '*' COMMENT '应用允许授权的所有URL, 多个用逗号隔开',
    `scope` varchar(200) not null default 'all' COMMENT '应用签约的所有权限, 多个用逗号隔开',
    access_token_timeout bigint not null default 3600 comment '令牌时效(s)' ,
    refresh_token_validity_seconds bigint not null default 28800 comment '刷新时效(s)' ,
    authorized_grant_types varchar(1000) not null default 'authorization_code,password,client_credentials,implicit' COMMENT '授权模式',
    status int not null default 1 comment '状态 1=启用 2=禁用',
    `create_date` date null default null COMMENT '创建时间',
    `modify_date` date null default null COMMENT '修改时间',
    `delete_mark` int NOT NULL COMMENT '删除标记',
    `enabled_mark` int NOT NULL COMMENT '有效标志',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment 'oauth用户列表';

-- ----------------------------
-- 材料提交任务类型
-- ----------------------------
drop table if exists material_type;
create table material_type
(
    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(100) NULL DEFAULT NULL COMMENT '任务名称',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '材料提交任务类型';

-- ----------------------------
-- 材料提交任务类型分配
-- ----------------------------
drop table if exists material_type_assign;
create table material_type_assign
(
    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 '有效标志',
    `material_type_id` bigint NULL DEFAULT NULL COMMENT '材料提交任务类型(material_type)',
    user_id bigint not null comment '用户(xjr_user)',
    user_type int not null comment '用户类型 1=孝职工 2=学生',
    `user_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学号/工号',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '材料提交任务类型分配';

-- ----------------------------
-- 材料提交任务
-- ----------------------------
drop table if exists material_task;
create table material_task
(
    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 '有效标志',
    `material_type_id` bigint NULL DEFAULT NULL COMMENT '材料提交任务类型(material_type)',
    `name` varchar(100) NULL DEFAULT NULL COMMENT '任务名称',
    status int not null default 1 comment '状态 1=未开始 2=进行中 3=结束',
    required_complete_time date null default null COMMENT '要求完成日期',
    `requirement` text NULL DEFAULT NULL COMMENT '要求',
    assign_person int null default 0 comment '指派给几人',
    submited_person int null default 0 comment '已提交人数',
    on_time_person int null default 0 comment '按时提交',
    time_delay int null default 0 comment '延迟提交',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '材料提交任务';

-- ----------------------------
-- 材料提交任务分配
-- ----------------------------
drop table if exists material_task_assign;
create table material_task_assign
(
    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 '有效标志',
    `material_task_id` bigint NULL DEFAULT NULL COMMENT '材料提交任务(material_task)',
    user_id bigint not null comment '用户(xjr_user)',
    user_type int not null comment '用户类型 1=孝职工 2=学生',
    `user_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学号/工号',
    status int not null default 1 comment '状态 1=未提交 2=待审核 3=通过 4=重做',
    executive_status int not null default 1 comment '执行提交 1=未提交 2=按时提交 3=延迟提交',
    transfer_material_task_id bigint NULL DEFAULT NULL COMMENT '转办任务分配ID(material_task_assign)',
    transfer_assign_person int null default 0 comment '转办给几人',
    transfer_submited_person int null default 0 comment '转办已提交人数',
    send_message int null default 0 comment '是否发送消息 0=不发 1=发送',
    send_message_status int null default 0 comment '发送消息状态 0=未不发 1=已发送',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '材料提交任务分配';


ALTER TABLE material_task_assign ADD COLUMN `opinion` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '审核意见';


-- ----------------------------
-- 材料提交任务附件
-- ----------------------------
drop table if exists material_task_appendix;
create table material_task_appendix
(
    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 '有效标志',
    `material_task_id` bigint NULL DEFAULT NULL COMMENT '材料提交任务(material_task)',
    `file_id` bigint NULL DEFAULT NULL COMMENT '文件ID(xjr_file)',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '材料提交任务附件';

-- ----------------------------
-- 文件接收管理
-- ----------------------------
drop table if exists file_receive;
create table file_receive
(
    id bigint not null comment '主键编号',
    `receiver_user_id` bigint NULL DEFAULT NULL COMMENT '接收用户编号',
    `create_date` date NULL DEFAULT NULL COMMENT '创建时间',
    `data_id` bigint NULL DEFAULT NULL COMMENT '数据编号（根据文件类型判断，数据来源->wf_oa_push,wf_oa_pull）',
    `file_type` int NULL DEFAULT NULL COMMENT '文件类型 1=发文 2=收文',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '文件接收管理';

-- ----------------------------
-- APP端功能模块管理
-- ----------------------------
drop table if exists base_app_function;
create table base_app_function
(
    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 '有效标志',
    `type` varchar(20) NULL DEFAULT NULL COMMENT '功能分类(xjr_dictionary_item[APPFUNC])',
    `name` varchar(100) NULL DEFAULT NULL COMMENT '名称',
    `icon` varchar(100) NULL DEFAULT NULL COMMENT '图标',
    `prefix` varchar(50) NULL DEFAULT NULL COMMENT '图标前缀',
    `color` varchar(10) NULL DEFAULT NULL COMMENT '图标颜色',
    `schema_id` bigint NULL DEFAULT NULL COMMENT '模板ID',
    `sort_code` int NULL DEFAULT NULL COMMENT '排序',
    `is_directory`  int NULL DEFAULT NULL COMMENT '菜单类型 0=菜单 1=目录',
    `url` varchar(100) NULL DEFAULT NULL COMMENT '功能地址',
    primary key (`id`)
) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment 'APP端功能模块管理';

SET FOREIGN_KEY_CHECKS = 1;
