/*
 Navicat Premium Data Transfer

 Source Server         : mydb
 Source Server Type    : MySQL
 Source Server Version : 50172
 Source Host           : localhost
 Source Database       : zk_tk

 Target Server Type    : MySQL
 Target Server Version : 50172
 File Encoding         : utf-8

 Date: 02/20/2017 20:53:22 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `b_attachment`
-- ----------------------------
DROP TABLE IF EXISTS `b_attachment`;
CREATE TABLE `b_attachment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `original_name` varchar(500) NOT NULL COMMENT '原始文件名',
  `cur_name` varchar(50) NOT NULL COMMENT '现在文件名',
  `store_path` varchar(500) NOT NULL COMMENT '物理文件存放路径',
  `file_length` double NOT NULL COMMENT '文件大小',
  `status` varchar(20) NOT NULL COMMENT '附件状态：草稿 DRAFT 、正在使用 USING、已删除 DELETEED',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `created_by` int(11) NOT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=759 DEFAULT CHARSET=utf8 COMMENT='附件表';

-- ----------------------------
--  Table structure for `b_batch`
-- ----------------------------
DROP TABLE IF EXISTS `b_batch`;
CREATE TABLE `b_batch` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(30) DEFAULT NULL,
  `name` varchar(200) DEFAULT NULL,
  `start_date` varchar(10) DEFAULT NULL,
  `end_date` varchar(10) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `master_id` int(11) DEFAULT NULL COMMENT '负责人id',
  `remark` varchar(256) DEFAULT NULL,
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `b_book`
-- ----------------------------
DROP TABLE IF EXISTS `b_book`;
CREATE TABLE `b_book` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `code` varchar(50) DEFAULT NULL,
  `editor` varchar(100) NOT NULL,
  `press` varchar(100) NOT NULL,
  `version` varchar(50) DEFAULT NULL,
  `price` decimal(5,2) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `status` int(11) DEFAULT NULL COMMENT '0停用 1启用',
  `remark` varchar(255) DEFAULT NULL,
  `chapter_size` int(11) DEFAULT NULL,
  `enable_date` datetime DEFAULT NULL COMMENT '启用时间',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2267 DEFAULT CHARSET=utf8 COMMENT='教材';

-- ----------------------------
--  Table structure for `b_course`
-- ----------------------------
DROP TABLE IF EXISTS `b_course`;
CREATE TABLE `b_course` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(10) NOT NULL,
  `code_hubei` varchar(10) DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `score` float DEFAULT NULL,
  `type` tinyint(1) DEFAULT NULL COMMENT '课程类型：0：省考；1：国考',
  `remark` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT NULL COMMENT '0停考 1开考',
  `open_edit` int(255) DEFAULT NULL COMMENT '是否开放编辑，如果为1，表示录入员可以强制修改此课程的所有试题',
  `update_date` datetime DEFAULT NULL COMMENT '最近更新时间',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  UNIQUE KEY `INDEX_B_COURSE_CODE_UNIQUE` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1495 DEFAULT CHARSET=utf8 COMMENT='课程';

-- ----------------------------
--  Table structure for `b_course_book`
-- ----------------------------
DROP TABLE IF EXISTS `b_course_book`;
CREATE TABLE `b_course_book` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) NOT NULL,
  `book_id` int(11) NOT NULL,
  `enable_date` varchar(10) DEFAULT NULL,
  `disable_date` varchar(10) DEFAULT NULL,
  `status` int(11) NOT NULL COMMENT '0停用 1启用 2未使用',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `FK_Reference_21` (`course_id`) USING BTREE,
  KEY `FK_Reference_22` (`book_id`) USING BTREE,
  CONSTRAINT `b_course_book_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`),
  CONSTRAINT `b_course_book_ibfk_2` FOREIGN KEY (`book_id`) REFERENCES `b_book` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=439 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `b_course_question_type`
-- ----------------------------
DROP TABLE IF EXISTS `b_course_question_type`;
CREATE TABLE `b_course_question_type` (
  `course_id` int(11) DEFAULT NULL,
  `question_type_id` int(11) DEFAULT NULL,
  `sort_no` int(11) DEFAULT NULL COMMENT '排序值',
  `guid` varchar(40) NOT NULL,
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `course_id` (`course_id`) USING BTREE,
  KEY `question_type_id` (`question_type_id`) USING BTREE,
  CONSTRAINT `b_course_question_type_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`),
  CONSTRAINT `b_course_question_type_ibfk_2` FOREIGN KEY (`question_type_id`) REFERENCES `b_question_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `b_question_type`
-- ----------------------------
DROP TABLE IF EXISTS `b_question_type`;
CREATE TABLE `b_question_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(6) DEFAULT NULL,
  `parent_code` varchar(6) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `correct_options_num` int(11) DEFAULT '0',
  `status_code` int(16) DEFAULT NULL COMMENT '0停用 1启用',
  `remark` varchar(256) DEFAULT NULL,
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `default_score` int(11) DEFAULT NULL COMMENT '默认分值',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  UNIQUE KEY `name` (`name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `b_skel_cfg`
-- ----------------------------
DROP TABLE IF EXISTS `b_skel_cfg`;
CREATE TABLE `b_skel_cfg` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) NOT NULL,
  `ability1_percent` double(10,2) NOT NULL,
  `ability2_percent` double(10,2) NOT NULL,
  `ability3_percent` double(10,2) NOT NULL,
  `ability4_percent` double(10,2) NOT NULL,
  `ability_offset` double(10,2) NOT NULL,
  `estimate_difficulty1_percent` double(10,2) NOT NULL,
  `estimate_difficulty2_percent` double(10,2) NOT NULL,
  `estimate_difficulty3_percent` double(10,2) NOT NULL,
  `estimate_difficulty4_percent` double(10,2) NOT NULL,
  `estimate_difficulty_offset` double(10,2) NOT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `b_skel_cfg_course_id` (`course_id`) USING BTREE,
  CONSTRAINT `b_skel_cfg_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=96 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `c_message`
-- ----------------------------
DROP TABLE IF EXISTS `c_message`;
CREATE TABLE `c_message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sender_id` int(11) NOT NULL COMMENT '发送人',
  `received_id` int(11) NOT NULL COMMENT '接收人',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `status` int(11) NOT NULL COMMENT '状态 1-未读 2-已读',
  `task_id` int(11) NOT NULL COMMENT '任务id',
  `guid` varchar(40) NOT NULL,
  `type` int(11) NOT NULL COMMENT '类型 1.任务',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8 COMMENT='消息表';

-- ----------------------------
--  Table structure for `qr_oper_log`
-- ----------------------------
DROP TABLE IF EXISTS `qr_oper_log`;
CREATE TABLE `qr_oper_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `obj_id` int(11) DEFAULT NULL COMMENT '对象主键ID',
  `obj_type` varchar(50) DEFAULT NULL COMMENT '对象类型，例如PagerConstruct',
  `oper_code` varchar(50) DEFAULT NULL COMMENT '对象类型',
  `remark` varchar(500) DEFAULT NULL COMMENT '操作备注',
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=16441 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_pager_construct`
-- ----------------------------
DROP TABLE IF EXISTS `qr_pager_construct`;
CREATE TABLE `qr_pager_construct` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `task_id` int(11) DEFAULT NULL COMMENT '试卷任务Id',
  `name` varchar(100) DEFAULT NULL,
  `skeleton_id` int(11) DEFAULT NULL,
  `pager_templet_id` int(11) DEFAULT NULL,
  `resourse` int(11) DEFAULT NULL COMMENT '1智能  2手工',
  `status` int(11) DEFAULT NULL COMMENT '0草稿  1待审批   2审批通过 3启用',
  `max_same_count` int(11) DEFAULT '0',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` int(11) DEFAULT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL COMMENT '最近更新时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '最近更新人',
  `max_old_count` int(11) DEFAULT '0',
  `head` varchar(50) DEFAULT NULL COMMENT '试卷的题头信息，例如：2010年10月湖北省高等教育自学考试',
  `last_paper_word` int(11) DEFAULT NULL COMMENT '最新的Word试卷',
  `last_answer_word` int(11) DEFAULT NULL COMMENT '最新的Word标准答案',
  `last_wangping_word` int(255) DEFAULT NULL COMMENT '最新的网评卷Word',
  `last_tika_word` int(255) DEFAULT NULL COMMENT '最新的题卡Word',
  `start_time` datetime DEFAULT NULL COMMENT '试卷启用时间',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `skeleton_id` (`skeleton_id`) USING BTREE,
  KEY `pager_templet_id` (`pager_templet_id`) USING BTREE,
  KEY `task_id` (`task_id`) USING BTREE,
  KEY `last_paper_word` (`last_paper_word`) USING BTREE,
  KEY `last_answer_word` (`last_answer_word`) USING BTREE,
  KEY `last_wangping_word` (`last_wangping_word`) USING BTREE,
  KEY `last_tika_word` (`last_tika_word`) USING BTREE,
  CONSTRAINT `qr_pager_construct_ibfk_1` FOREIGN KEY (`skeleton_id`) REFERENCES `qr_paper_skeleton2` (`id`),
  CONSTRAINT `qr_pager_construct_ibfk_2` FOREIGN KEY (`pager_templet_id`) REFERENCES `qr_pager_templet` (`ID`),
  CONSTRAINT `qr_pager_construct_ibfk_3` FOREIGN KEY (`task_id`) REFERENCES `tk_paper_task` (`id`),
  CONSTRAINT `qr_pager_construct_ibfk_4` FOREIGN KEY (`last_paper_word`) REFERENCES `b_attachment` (`id`),
  CONSTRAINT `qr_pager_construct_ibfk_5` FOREIGN KEY (`last_answer_word`) REFERENCES `b_attachment` (`id`),
  CONSTRAINT `qr_pager_construct_ibfk_6` FOREIGN KEY (`last_wangping_word`) REFERENCES `b_attachment` (`id`),
  CONSTRAINT `qr_pager_construct_ibfk_7` FOREIGN KEY (`last_tika_word`) REFERENCES `b_attachment` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_pager_construct_detail`
-- ----------------------------
DROP TABLE IF EXISTS `qr_pager_construct_detail`;
CREATE TABLE `qr_pager_construct_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pager_construct_id` int(11) DEFAULT NULL,
  `pager_qtype_id` int(11) DEFAULT NULL,
  `question_id` int(11) DEFAULT NULL,
  `sort_no` int(11) DEFAULT NULL,
  `question_score` double DEFAULT NULL,
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` int(11) DEFAULT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL COMMENT '最近更新时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '最近更新人',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `pager_qtype_id` (`pager_qtype_id`) USING BTREE,
  CONSTRAINT `qr_pager_construct_detail_ibfk_1` FOREIGN KEY (`pager_qtype_id`) REFERENCES `qr_pager_construct_qtype` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_pager_construct_qtype`
-- ----------------------------
DROP TABLE IF EXISTS `qr_pager_construct_qtype`;
CREATE TABLE `qr_pager_construct_qtype` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pager_construct_id` int(11) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `question_type_id` int(11) DEFAULT NULL,
  `sort_no` int(11) DEFAULT NULL,
  `question_sum` int(11) DEFAULT NULL,
  `question_scores` double DEFAULT NULL,
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` int(11) DEFAULT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL COMMENT '最近更新时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '最近更新人',
  `remark` varchar(256) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `pager_construct_id` (`pager_construct_id`) USING BTREE,
  CONSTRAINT `qr_pager_construct_qtype_ibfk_1` FOREIGN KEY (`pager_construct_id`) REFERENCES `qr_pager_construct` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_pager_templet`
-- ----------------------------
DROP TABLE IF EXISTS `qr_pager_templet`;
CREATE TABLE `qr_pager_templet` (
  `ID` int(11) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `path` varchar(200) DEFAULT NULL,
  `xml_content` longtext,
  `status` int(11) DEFAULT NULL COMMENT '0 停用  1启用',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_paper`
-- ----------------------------
DROP TABLE IF EXISTS `qr_paper`;
CREATE TABLE `qr_paper` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(30) NOT NULL COMMENT '试卷编号',
  `course_id` int(11) DEFAULT NULL COMMENT '课程id',
  `course_code` varchar(50) DEFAULT NULL,
  `course_name` varchar(50) DEFAULT NULL,
  `book_id` int(11) DEFAULT NULL COMMENT '教材id',
  `book_name` varchar(100) DEFAULT NULL COMMENT '教材名称',
  `book_author` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '教材编者',
  `book_press` varchar(100) DEFAULT NULL COMMENT '教材出版社',
  `book_press_year` varchar(10) DEFAULT NULL COMMENT '教材版次',
  `school` varchar(100) DEFAULT NULL COMMENT '试卷出题学校',
  `status` varchar(20) DEFAULT NULL COMMENT '状态',
  `is_special_answer_sheet` tinyint(1) DEFAULT NULL,
  `paper_path` varchar(200) DEFAULT NULL COMMENT '电子试卷地址',
  `standard_answer_path` varchar(200) DEFAULT NULL COMMENT '标答地址',
  `answer_sheet_path` varchar(100) DEFAULT NULL COMMENT '提卡地址',
  `attachments_path` varchar(500) DEFAULT NULL COMMENT '附件地址，多个附件逗号隔开',
  `pictures_path` varchar(500) DEFAULT NULL COMMENT '图片地址，多个图片逗号隔开',
  `remark` varchar(200) DEFAULT NULL,
  `reserved` varchar(100) DEFAULT NULL COMMENT '保留字段',
  `created_dt` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` int(11) DEFAULT NULL COMMENT '创建人',
  `updated_dt` datetime DEFAULT NULL COMMENT '更新时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '更新人',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `course_id` (`course_id`) USING BTREE,
  KEY `book_id` (`book_id`) USING BTREE,
  CONSTRAINT `qr_paper_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`),
  CONSTRAINT `qr_paper_ibfk_2` FOREIGN KEY (`book_id`) REFERENCES `b_book` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_paper_batch`
-- ----------------------------
DROP TABLE IF EXISTS `qr_paper_batch`;
CREATE TABLE `qr_paper_batch` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(30) DEFAULT NULL COMMENT '批次代码',
  `type` varchar(30) DEFAULT NULL COMMENT '批次类型：0:毛坯 1：清样 2：启用',
  `status` varchar(30) DEFAULT NULL COMMENT '批次状态：0：未启动 1：启动 2：完成 3：取消',
  `start_date` date DEFAULT NULL COMMENT '批次开始日期',
  `end_date` date DEFAULT NULL COMMENT '批次结束日期',
  `admin` varchar(100) DEFAULT NULL COMMENT '负责人',
  `created_by` int(11) DEFAULT NULL,
  `created_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_paper_dbf_paper_info`
-- ----------------------------
DROP TABLE IF EXISTS `qr_paper_dbf_paper_info`;
CREATE TABLE `qr_paper_dbf_paper_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `paper_batch_id` int(11) DEFAULT NULL,
  `course_code` varchar(11) DEFAULT NULL,
  `course_name` varchar(50) DEFAULT NULL,
  `book_name` varchar(100) DEFAULT NULL,
  `book_author` varchar(30) DEFAULT NULL,
  `book_press` varchar(100) DEFAULT NULL,
  `book_press_year` varchar(10) DEFAULT NULL,
  `related_paper_ids` varchar(100) DEFAULT NULL,
  `search_keyword` varchar(400) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_paper_paper_batch`
-- ----------------------------
DROP TABLE IF EXISTS `qr_paper_paper_batch`;
CREATE TABLE `qr_paper_paper_batch` (
  `paper_batch_id` int(11) NOT NULL COMMENT '批次id',
  `paper_id` int(11) DEFAULT NULL COMMENT '试卷id',
  `is_outbound_scanned` tinyint(1) DEFAULT NULL COMMENT '是否出库扫描',
  `is_storage_scanned` tinyint(1) DEFAULT NULL COMMENT '是否入库扫描',
  `is_paper_return` tinyint(1) DEFAULT NULL,
  `is_standard_answer_return` tinyint(1) DEFAULT NULL,
  `is_answer_sheet_return` tinyint(1) DEFAULT NULL,
  `book_id` int(11) DEFAULT NULL COMMENT '教材id',
  `book_name` varchar(100) DEFAULT NULL,
  `book_author` varchar(100) DEFAULT NULL,
  `book_press` varchar(100) DEFAULT NULL,
  `book_press_year` varchar(10) DEFAULT NULL,
  `school` varchar(100) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `paper_batch_id` (`paper_batch_id`) USING BTREE,
  KEY `paper_id` (`paper_id`) USING BTREE,
  CONSTRAINT `qr_paper_paper_batch_ibfk_1` FOREIGN KEY (`paper_batch_id`) REFERENCES `qr_paper_batch` (`id`),
  CONSTRAINT `qr_paper_paper_batch_ibfk_2` FOREIGN KEY (`paper_id`) REFERENCES `qr_paper` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_paper_rel_dbf_paper_info`
-- ----------------------------
DROP TABLE IF EXISTS `qr_paper_rel_dbf_paper_info`;
CREATE TABLE `qr_paper_rel_dbf_paper_info` (
  `dbf_paper_info_id` int(11) NOT NULL,
  `paper_id` int(11) NOT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`dbf_paper_info_id`,`paper_id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_paper_skeleton2`
-- ----------------------------
DROP TABLE IF EXISTS `qr_paper_skeleton2`;
CREATE TABLE `qr_paper_skeleton2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `task_id` int(11) DEFAULT NULL,
  `name` varchar(100) NOT NULL COMMENT '蓝图名称',
  `course_id` int(11) NOT NULL COMMENT '课程ID',
  `book_id` int(11) NOT NULL COMMENT '教材ID',
  `chapter_size` int(11) NOT NULL COMMENT '教材章数',
  `key_chapters` varchar(500) DEFAULT NULL COMMENT '重点章组成的字符串，用逗号“,”隔开，例如：2,3,7',
  `ques_type_scores` varchar(500) NOT NULL COMMENT '各题型分值组成的字符串，题型与分值用冒号“:”隔开，各个题型分值字符串再用逗号“,”隔开，例如：1:1,2:1,5:10',
  `status` int(11) NOT NULL COMMENT '状态：  0草稿  1待审批   2审批通过 3启用 4审批拒绝',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `created_by` int(11) NOT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL COMMENT '最近更新时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '最近更新人',
  `guid` varchar(40) NOT NULL,
  `key_template` int(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `course_id` (`course_id`) USING BTREE,
  KEY `task_id` (`task_id`) USING BTREE,
  CONSTRAINT `qr_paper_skeleton2_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`),
  CONSTRAINT `qr_paper_skeleton2_ibfk_2` FOREIGN KEY (`task_id`) REFERENCES `tk_paper_task` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qr_paper_skeleton2_detail`
-- ----------------------------
DROP TABLE IF EXISTS `qr_paper_skeleton2_detail`;
CREATE TABLE `qr_paper_skeleton2_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `skeleton_id` int(11) NOT NULL COMMENT '新版蓝图表的主键',
  `ques_type_no` int(11) NOT NULL COMMENT '题型编号，从1开始，对应蓝图里面的题型顺序值',
  `chapter_no` int(11) NOT NULL COMMENT '章序号值，从1开始',
  `ques_num` int(11) NOT NULL COMMENT '题量',
  `estimate_difficulty` int(11) NOT NULL COMMENT '预计难度：A.易；  B.中等偏易；  C.中等偏难；  D.难，对应数字：1,2,3,4，对应code表里面的：QUESTION_DIFFICULTY-10,20,30,40，这样处理是为了简化蓝图管理设计',
  `ability` int(11) NOT NULL COMMENT '认知层次，即能力要求：I.识记；  II.领会；  III.简单应用；  IV.综合应用，对应数字：1,2,3,4，对应code表里面的：ABILITY-A,B,C,D，这样处理是为了简化蓝图管理设计',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `skeleton_id` (`skeleton_id`) USING BTREE,
  CONSTRAINT `qr_paper_skeleton2_detail_ibfk_1` FOREIGN KEY (`skeleton_id`) REFERENCES `qr_paper_skeleton2` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `s_code`
-- ----------------------------
DROP TABLE IF EXISTS `s_code`;
CREATE TABLE `s_code` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `item_type` varchar(30) NOT NULL COMMENT '类型',
  `item_code` varchar(30) NOT NULL COMMENT 'Code',
  `item_value` varchar(45) NOT NULL COMMENT '显示值',
  `sequence` int(11) DEFAULT '0' COMMENT '序列号',
  `status` char(1) NOT NULL COMMENT '状态\\n0 删除\\n1 正常',
  `organization_id` int(11) DEFAULT '0' COMMENT '部门ID',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` varchar(20) DEFAULT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  `updated_by` varchar(20) DEFAULT NULL COMMENT '更新人',
  `reserve` varchar(45) DEFAULT NULL COMMENT '预留字段',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=141 DEFAULT CHARSET=utf8 COMMENT='静态参数表';

-- ----------------------------
--  Table structure for `s_menu`
-- ----------------------------
DROP TABLE IF EXISTS `s_menu`;
CREATE TABLE `s_menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `parent_no` varchar(11) NOT NULL COMMENT '父菜单号',
  `menu_no` varchar(11) NOT NULL COMMENT '菜单号',
  `type` char(1) NOT NULL COMMENT '菜单类型',
  `name` varchar(45) NOT NULL COMMENT '菜单名称',
  `disp_name` varchar(45) NOT NULL COMMENT '菜单显示名称',
  `url` varchar(200) DEFAULT '' COMMENT '菜单地址',
  `image` varchar(200) DEFAULT NULL COMMENT '菜单图片地址',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` varchar(20) NOT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  `updated_by` varchar(20) DEFAULT NULL COMMENT '更新人',
  `status` char(1) NOT NULL COMMENT '删除标记\\n1 删除\\n0 正常',
  `reserve` varchar(45) DEFAULT NULL COMMENT '备用',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`,`created_by`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='菜单表';

-- ----------------------------
--  Table structure for `s_role`
-- ----------------------------
DROP TABLE IF EXISTS `s_role`;
CREATE TABLE `s_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(20) DEFAULT NULL,
  `name` varchar(50) NOT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `is_enabled` int(1) DEFAULT NULL,
  `user_type` int(11) DEFAULT NULL,
  `role_type` int(11) DEFAULT NULL,
  `update_date` date DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `s_role_menu`
-- ----------------------------
DROP TABLE IF EXISTS `s_role_menu`;
CREATE TABLE `s_role_menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_id` int(11) NOT NULL COMMENT '角色ID',
  `menu_no` varchar(11) NOT NULL COMMENT '菜单NO',
  `type` int(11) DEFAULT NULL COMMENT '状态---1：增加（add）2：删除（del）3：查看（view）4：修改（edit）',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=513 DEFAULT CHARSET=utf8 COMMENT='角色菜单关系表';

-- ----------------------------
--  Table structure for `s_sys_param`
-- ----------------------------
DROP TABLE IF EXISTS `s_sys_param`;
CREATE TABLE `s_sys_param` (
  `PARAM_NAME` varchar(32) NOT NULL,
  `PARAM_VALUE` varchar(2000) DEFAULT NULL,
  `VALUE_TYPE` varchar(32) NOT NULL,
  `PARAM_DESC` varchar(500) DEFAULT NULL,
  `CREATED_TIME` datetime DEFAULT NULL,
  `UPDATE_TIME` datetime DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`PARAM_NAME`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `s_user`
-- ----------------------------
DROP TABLE IF EXISTS `s_user`;
CREATE TABLE `s_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `is_enabled` int(11) DEFAULT NULL,
  `last_login_date` datetime DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `password` varchar(200) NOT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `login_name` varchar(50) NOT NULL,
  `certino` varchar(18) DEFAULT NULL COMMENT '身份证号',
  `phone` varchar(50) DEFAULT NULL COMMENT '手机',
  `office_phone` varchar(50) DEFAULT NULL COMMENT '办公电话',
  `email` varchar(100) DEFAULT NULL,
  `position` varchar(50) DEFAULT NULL COMMENT '职称',
  `department` varchar(100) DEFAULT NULL COMMENT '院系',
  `institute_id` int(11) DEFAULT NULL,
  `user_type` int(11) DEFAULT '1',
  `school` varchar(100) DEFAULT NULL COMMENT '单位',
  `major` varchar(50) DEFAULT NULL COMMENT '专业',
  `gender` varchar(5) DEFAULT NULL COMMENT '性别',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=192 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `s_user_course`
-- ----------------------------
DROP TABLE IF EXISTS `s_user_course`;
CREATE TABLE `s_user_course` (
  `user_id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`user_id`,`course_id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `course_id` (`course_id`) USING BTREE,
  CONSTRAINT `s_user_course_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `s_user` (`id`),
  CONSTRAINT `s_user_course_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `s_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `s_user_role`;
CREATE TABLE `s_user_role` (
  `user_id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`user_id`,`role_id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  CONSTRAINT `s_user_role_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `s_user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_audit_ques_task`
-- ----------------------------
DROP TABLE IF EXISTS `tk_audit_ques_task`;
CREATE TABLE `tk_audit_ques_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `batch_id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL COMMENT '课程Id',
  `remark` varchar(500) DEFAULT NULL,
  `plan_start_time` datetime NOT NULL,
  `plan_end_time` datetime NOT NULL,
  `real_start_time` datetime DEFAULT NULL,
  `real_end_time` datetime DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_time` datetime NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `tk_audit_ques_task_ibfk_1` (`batch_id`) USING BTREE,
  KEY `tk_audit_ques_task_ibfk_2` (`course_id`) USING BTREE,
  CONSTRAINT `tk_audit_ques_task_ibfk_1` FOREIGN KEY (`batch_id`) REFERENCES `tk_batch` (`id`),
  CONSTRAINT `tk_audit_ques_task_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='审题任务表';

-- ----------------------------
--  Table structure for `tk_audit_ques_task_user_link`
-- ----------------------------
DROP TABLE IF EXISTS `tk_audit_ques_task_user_link`;
CREATE TABLE `tk_audit_ques_task_user_link` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `audit_ques_task_id` int(11) NOT NULL COMMENT '审题任务Id',
  `auditor_id` int(11) NOT NULL COMMENT '审核人员Id',
  PRIMARY KEY (`id`),
  KEY `tk_audit_ques_task_user_ibfk_1` (`audit_ques_task_id`) USING BTREE,
  KEY `tk_audit_ques_task_user_ibfk_2` (`auditor_id`) USING BTREE,
  CONSTRAINT `tk_audit_ques_task_user_link_ibfk_1` FOREIGN KEY (`audit_ques_task_id`) REFERENCES `tk_audit_ques_task` (`id`),
  CONSTRAINT `tk_audit_ques_task_user_link_ibfk_2` FOREIGN KEY (`auditor_id`) REFERENCES `s_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='审题任务课程关联用户表';

-- ----------------------------
--  Table structure for `tk_batch`
-- ----------------------------
DROP TABLE IF EXISTS `tk_batch`;
CREATE TABLE `tk_batch` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL COMMENT '批次名称',
  `plan_start_time` datetime NOT NULL COMMENT '计划开工时间',
  `plan_end_time` datetime NOT NULL COMMENT '计划结束时间',
  `created_by` int(11) NOT NULL COMMENT '创建人',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '最近修改人',
  `updated_time` datetime DEFAULT NULL COMMENT '最近修改时间',
  `batch_type` varchar(100) DEFAULT NULL COMMENT '批次类型',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8 COMMENT='任务批次表';

-- ----------------------------
--  Table structure for `tk_flow_log`
-- ----------------------------
DROP TABLE IF EXISTS `tk_flow_log`;
CREATE TABLE `tk_flow_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `task_id` int(11) NOT NULL COMMENT '任务主键ID',
  `task_type` varchar(50) NOT NULL COMMENT '任务类型',
  `oper_name` varchar(100) NOT NULL,
  `remark` varchar(1000) DEFAULT NULL COMMENT '备注',
  `atts` varchar(200) DEFAULT NULL COMMENT '附件ID数组',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `created_by` int(11) NOT NULL COMMENT '创建人',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=542 DEFAULT CHARSET=utf8 COMMENT='流程日志表';

-- ----------------------------
--  Table structure for `tk_input_ques_task`
-- ----------------------------
DROP TABLE IF EXISTS `tk_input_ques_task`;
CREATE TABLE `tk_input_ques_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `batch_id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL COMMENT '课程Id',
  `remark` varchar(500) DEFAULT NULL,
  `plan_start_time` datetime NOT NULL,
  `plan_end_time` datetime NOT NULL,
  `real_start_time` datetime DEFAULT NULL,
  `real_end_time` datetime DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_time` datetime NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `tk_input_ques_task_ibfk_1` (`batch_id`) USING BTREE,
  KEY `tk_input_ques_task_ibfk_2` (`course_id`) USING BTREE,
  CONSTRAINT `tk_input_ques_task_ibfk_1` FOREIGN KEY (`batch_id`) REFERENCES `tk_batch` (`id`),
  CONSTRAINT `tk_input_ques_task_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='录题任务表';

-- ----------------------------
--  Table structure for `tk_input_ques_task_user_link`
-- ----------------------------
DROP TABLE IF EXISTS `tk_input_ques_task_user_link`;
CREATE TABLE `tk_input_ques_task_user_link` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input_ques_task_id` int(11) NOT NULL COMMENT '录题任务Id',
  `inputer_id` int(11) NOT NULL COMMENT '录入员Id',
  PRIMARY KEY (`id`),
  KEY `tk_input_ques_task_user_link_ibfk_1` (`input_ques_task_id`) USING BTREE,
  KEY `tk_input_ques_task_user_link_ibfk_2` (`inputer_id`) USING BTREE,
  CONSTRAINT `tk_input_ques_task_user_link_ibfk_1` FOREIGN KEY (`input_ques_task_id`) REFERENCES `tk_input_ques_task` (`id`),
  CONSTRAINT `tk_input_ques_task_user_link_ibfk_2` FOREIGN KEY (`inputer_id`) REFERENCES `s_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='录题任务课程关联用户表';

-- ----------------------------
--  Table structure for `tk_learn_center`
-- ----------------------------
DROP TABLE IF EXISTS `tk_learn_center`;
CREATE TABLE `tk_learn_center` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_code` varchar(60) DEFAULT NULL,
  `category_name` varchar(90) DEFAULT NULL,
  `html_content` text,
  `attachment_id` varchar(300) DEFAULT NULL,
  `course_code` varchar(30) DEFAULT NULL,
  `keyword` varchar(300) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_paper_difficulty_estimate`
-- ----------------------------
DROP TABLE IF EXISTS `tk_paper_difficulty_estimate`;
CREATE TABLE `tk_paper_difficulty_estimate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `paper_id` int(11) DEFAULT NULL,
  `sort_no` int(11) DEFAULT NULL,
  `question_id` int(11) DEFAULT NULL,
  `question_type` varchar(100) DEFAULT NULL,
  `estimate_difficulty` int(11) DEFAULT NULL,
  `estimate_difficulty_value` float DEFAULT NULL,
  `question_score` float DEFAULT NULL,
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1508 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_paper_task`
-- ----------------------------
DROP TABLE IF EXISTS `tk_paper_task`;
CREATE TABLE `tk_paper_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `task_no` varchar(50) NOT NULL COMMENT '任务单编号',
  `title` varchar(100) NOT NULL COMMENT '标题',
  `paper_name` varchar(100) NOT NULL COMMENT '试卷名称',
  `batch_id` int(11) NOT NULL COMMENT '任务批次',
  `course_id` int(4) DEFAULT NULL,
  `book_id` int(4) DEFAULT NULL,
  `plan_start_time` datetime NOT NULL COMMENT '计划开工时间',
  `plan_end_time` datetime NOT NULL COMMENT '计划结束时间',
  `real_start_time` datetime DEFAULT NULL COMMENT '实际开工时间',
  `real_end_time` datetime DEFAULT NULL COMMENT '实际结束时间',
  `remark` varchar(1000) DEFAULT NULL COMMENT '备注',
  `proposition_teacher` int(4) DEFAULT NULL,
  `audit_teacher` int(11) DEFAULT NULL COMMENT '审题教师',
  `typesetter` int(11) DEFAULT NULL COMMENT '排版员',
  `primary_secretary` int(11) DEFAULT NULL COMMENT '主学科秘书',
  `assistant_secretary` int(4) DEFAULT NULL,
  `cur_dealer` int(11) DEFAULT NULL COMMENT '当前处理人',
  `status` varchar(50) DEFAULT NULL COMMENT '状态',
  `atts` varchar(200) DEFAULT NULL COMMENT '附件ID数组',
  `created_by` int(11) NOT NULL COMMENT '创建人',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '最近修改人',
  `updated_time` datetime DEFAULT NULL COMMENT '最近修改时间',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `batch_id` (`batch_id`) USING BTREE,
  CONSTRAINT `tk_paper_task_ibfk_1` FOREIGN KEY (`batch_id`) REFERENCES `tk_batch` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8 COMMENT='试卷任务表';

-- ----------------------------
--  Table structure for `tk_similar_paper`
-- ----------------------------
DROP TABLE IF EXISTS `tk_similar_paper`;
CREATE TABLE `tk_similar_paper` (
  `similarPaperNo` varchar(100) DEFAULT NULL,
  `similarPaperBody` text,
  `similarity` decimal(10,2) DEFAULT NULL,
  `guid` varchar(40) DEFAULT NULL,
  `courseName` varchar(50) DEFAULT NULL,
  `bookName` varchar(50) DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdByName` varchar(50) DEFAULT NULL,
  `taskId` varchar(50) DEFAULT NULL,
  `taskNo` varchar(100) DEFAULT NULL,
  `courseNo` varchar(50) DEFAULT NULL,
  `id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_similar_paper_question`
-- ----------------------------
DROP TABLE IF EXISTS `tk_similar_paper_question`;
CREATE TABLE `tk_similar_paper_question` (
  `similarQuestionId` varchar(100) DEFAULT NULL,
  `similarity` decimal(10,2) DEFAULT NULL,
  `guid` varchar(40) DEFAULT NULL,
  `similarPaperNo` varchar(100) DEFAULT NULL,
  `id` int(10) DEFAULT NULL,
  `similarPaperId` varchar(100) DEFAULT NULL,
  `similarQuestionNo` varchar(100) DEFAULT NULL,
  `whichQuestion` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_similar_question`
-- ----------------------------
DROP TABLE IF EXISTS `tk_similar_question`;
CREATE TABLE `tk_similar_question` (
  `similarQuestionNo` varchar(100) DEFAULT NULL,
  `similarQuestionName` varchar(200) DEFAULT NULL,
  `similarQuestionBody` text,
  `similarity` decimal(10,2) DEFAULT NULL,
  `guid` varchar(40) DEFAULT NULL,
  `courseName` varchar(50) DEFAULT NULL,
  `bookName` varchar(50) DEFAULT NULL,
  `typeName` varchar(50) DEFAULT NULL,
  `similarQuestionId` varchar(50) DEFAULT NULL,
  `courseId` int(11) DEFAULT NULL,
  `courseNo` varchar(50) DEFAULT NULL,
  `id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_teacher_assessment`
-- ----------------------------
DROP TABLE IF EXISTS `tk_teacher_assessment`;
CREATE TABLE `tk_teacher_assessment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `task_id` int(11) DEFAULT NULL,
  `teacher_id` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `remark` varchar(600) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_teacher_assessment_detail`
-- ----------------------------
DROP TABLE IF EXISTS `tk_teacher_assessment_detail`;
CREATE TABLE `tk_teacher_assessment_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `teacher_assessment_id` int(11) DEFAULT NULL,
  `assessment_sort_no` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `remark` varchar(600) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=235 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tk_word_history`
-- ----------------------------
DROP TABLE IF EXISTS `tk_word_history`;
CREATE TABLE `tk_word_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `paper_id` int(11) NOT NULL COMMENT '试卷ID',
  `att_id` int(11) NOT NULL COMMENT '附件ID',
  `att_type` varchar(50) NOT NULL COMMENT '附件类型，PAPER 试卷Word；ANSWER 答案Word',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `created_by` int(11) NOT NULL COMMENT '创建人',
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `paper_id` (`paper_id`) USING BTREE,
  KEY `att_id` (`att_id`) USING BTREE,
  CONSTRAINT `tk_word_history_ibfk_1` FOREIGN KEY (`paper_id`) REFERENCES `qr_pager_construct` (`ID`),
  CONSTRAINT `tk_word_history_ibfk_2` FOREIGN KEY (`att_id`) REFERENCES `b_attachment` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='试卷文档历史记录表（试卷Word、答案Word）';

-- ----------------------------
--  Table structure for `zk_import_question_history`
-- ----------------------------
DROP TABLE IF EXISTS `zk_import_question_history`;
CREATE TABLE `zk_import_question_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_name` varchar(200) DEFAULT NULL,
  `file_id` int(11) DEFAULT NULL COMMENT '关联附件表的id',
  `question_count` int(11) DEFAULT NULL,
  `remark` varchar(500) DEFAULT NULL,
  `import_time` datetime DEFAULT NULL,
  `import_by` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zk_question`
-- ----------------------------
DROP TABLE IF EXISTS `zk_question`;
CREATE TABLE `zk_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '试题id',
  `question_no` varchar(50) DEFAULT NULL COMMENT '试题编号',
  `course_id` int(11) NOT NULL COMMENT '课程id',
  `type_id` int(11) NOT NULL COMMENT '题型id',
  `book_id` int(11) DEFAULT NULL COMMENT '教材id',
  `batch_id` int(11) DEFAULT NULL COMMENT '批次id',
  `estimate_difficulty_value` double DEFAULT NULL COMMENT '预计难度值',
  `estimate_difficulty_code` varchar(16) DEFAULT NULL COMMENT '预测难度',
  `measured_difficulty_value` double DEFAULT NULL COMMENT '实测难度值',
  `measured_difficulty_code` varchar(16) DEFAULT NULL COMMENT '实测难度',
  `grade_code` varchar(16) DEFAULT NULL COMMENT '层次',
  `ability_code` varchar(16) DEFAULT NULL COMMENT '能力要求',
  `chapter` varchar(16) DEFAULT NULL COMMENT '知识点-章',
  `section` varchar(16) DEFAULT NULL COMMENT '知识点-节',
  `item` varchar(16) DEFAULT NULL COMMENT '知识点-目',
  `page` varchar(16) DEFAULT NULL COMMENT '知识点-页',
  `score` float DEFAULT NULL COMMENT '满分值',
  `body_word` mediumblob COMMENT '题干word',
  `body` longtext COMMENT '题干',
  `body_summary` mediumtext COMMENT '题干摘要',
  `answer_word` mediumblob,
  `answer` longtext COMMENT '答案',
  `answer_summary` mediumtext COMMENT '答案摘要',
  `answersheet` longtext,
  `status_code` varchar(30) DEFAULT '' COMMENT '状态编码',
  `enable_time` datetime DEFAULT NULL COMMENT '启用时间',
  `set_time` datetime DEFAULT NULL COMMENT '命题时间',
  `set_by` int(11) DEFAULT NULL COMMENT '命题教师id',
  `set_teacher_name` varchar(30) DEFAULT NULL COMMENT '命题教师姓名',
  `remark` varchar(256) DEFAULT NULL COMMENT '备注',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` int(11) DEFAULT NULL COMMENT '创建人',
  `updated_time` datetime DEFAULT NULL COMMENT '最近更新时间',
  `updated_by` int(11) DEFAULT NULL COMMENT '最近更新人',
  `version` varchar(20) DEFAULT NULL,
  `import_id` varchar(20) DEFAULT NULL,
  `assessment_demand` varchar(16) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `course_id` (`course_id`) USING BTREE,
  KEY `type_id` (`type_id`) USING BTREE,
  CONSTRAINT `zk_question_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`),
  CONSTRAINT `zk_question_ibfk_2` FOREIGN KEY (`type_id`) REFERENCES `b_question_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26668 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zk_question_attachment`
-- ----------------------------
DROP TABLE IF EXISTS `zk_question_attachment`;
CREATE TABLE `zk_question_attachment` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '附件id',
  `parent_id` int(11) DEFAULT NULL COMMENT '引用对象id',
  `parent_type` int(11) DEFAULT NULL COMMENT '引用对象类型: 1题干 2选项 3答案',
  `extension` varchar(2048) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '附件扩展名',
  `name` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '附件名',
  `size` int(11) DEFAULT NULL COMMENT '附件大小',
  `check_code` varchar(1024) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '校验码',
  `content` mediumblob COMMENT '附件内容',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` int(11) DEFAULT NULL COMMENT '创建人',
  `guid` varchar(40) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
--  Table structure for `zk_question_operation_log`
-- ----------------------------
DROP TABLE IF EXISTS `zk_question_operation_log`;
CREATE TABLE `zk_question_operation_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_id` int(11) DEFAULT NULL,
  `operation_code` varchar(30) DEFAULT NULL,
  `question_version_id` int(11) DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zk_question_option`
-- ----------------------------
DROP TABLE IF EXISTS `zk_question_option`;
CREATE TABLE `zk_question_option` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '选项id',
  `question_id` int(11) NOT NULL COMMENT '试题id',
  `option_no` int(11) NOT NULL COMMENT '选项顺序',
  `is_correct_option` tinyint(1) DEFAULT NULL COMMENT '是否为正确选项',
  `summary` mediumtext COLLATE utf8_unicode_ci COMMENT '选项内容',
  `content_word` mediumblob COMMENT '选项word',
  `content` longtext COLLATE utf8_unicode_ci COMMENT '选项摘要',
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `guid` varchar(40) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=181930 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
--  Table structure for `zk_question_option_version`
-- ----------------------------
DROP TABLE IF EXISTS `zk_question_option_version`;
CREATE TABLE `zk_question_option_version` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '选项id',
  `question_id` int(11) NOT NULL COMMENT '试题id',
  `question_version_id` int(11) NOT NULL COMMENT '试题版本id',
  `option_no` int(11) NOT NULL COMMENT '选项顺序',
  `is_correct_option` tinyint(1) DEFAULT NULL COMMENT '是否为正确选项',
  `content` longtext COLLATE utf8_unicode_ci COMMENT '选项内容',
  `content_word` mediumblob COMMENT '选项word',
  `summary` varchar(4096) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '选项摘要',
  `created_time` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_time` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `guid` varchar(40) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
--  Table structure for `zk_question_pager_times`
-- ----------------------------
DROP TABLE IF EXISTS `zk_question_pager_times`;
CREATE TABLE `zk_question_pager_times` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_id` int(11) DEFAULT NULL,
  `open_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zk_question_version`
-- ----------------------------
DROP TABLE IF EXISTS `zk_question_version`;
CREATE TABLE `zk_question_version` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '试题id',
  `question_id` int(11) NOT NULL,
  `question_no` varchar(128) DEFAULT NULL COMMENT '试题编号',
  `course_id` int(11) NOT NULL COMMENT '课程id',
  `type_id` int(11) NOT NULL COMMENT '题型id',
  `book_id` int(11) DEFAULT NULL COMMENT '教材id',
  `batch_id` int(11) DEFAULT NULL COMMENT '批次id',
  `estimate_difficulty_code` varchar(16) DEFAULT NULL COMMENT '预测难度',
  `measured_difficulty_code` varchar(16) DEFAULT NULL COMMENT '实测难度',
  `grade_code` varchar(16) DEFAULT NULL COMMENT '层次',
  `ability_code` varchar(16) DEFAULT NULL COMMENT '能力要求',
  `chapter` varchar(16) DEFAULT NULL COMMENT '知识点-章',
  `section` varchar(16) DEFAULT NULL COMMENT '知识点-节',
  `item` varchar(16) DEFAULT NULL COMMENT '知识点-目',
  `page` varchar(16) DEFAULT NULL COMMENT '知识点-页',
  `score` float DEFAULT NULL COMMENT '满分值',
  `body_word` mediumblob,
  `body` longtext COMMENT '题干',
  `body_summary` varchar(1024) DEFAULT NULL COMMENT '题干摘要',
  `answer_word` mediumblob,
  `answer` longtext COMMENT '答案',
  `answer_summary` varchar(1024) DEFAULT NULL COMMENT '答案摘要',
  `status_code` varchar(16) DEFAULT NULL COMMENT '状态编码',
  `enable_time` datetime DEFAULT NULL COMMENT '启用时间',
  `set_time` datetime DEFAULT NULL COMMENT '命题时间',
  `set_by` int(11) DEFAULT NULL COMMENT '命题教师id',
  `set_teacher_name` varchar(30) DEFAULT NULL COMMENT '命题教师姓名',
  `remark` varchar(256) DEFAULT NULL COMMENT '备注',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` int(11) DEFAULT NULL COMMENT '创建人',
  `version` int(11) NOT NULL,
  `guid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`) USING BTREE,
  KEY `course_id` (`course_id`) USING BTREE,
  KEY `type_id` (`type_id`) USING BTREE,
  CONSTRAINT `zk_question_version_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `b_course` (`id`),
  CONSTRAINT `zk_question_version_ibfk_2` FOREIGN KEY (`type_id`) REFERENCES `b_question_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  View structure for `v_question_3year`
-- ----------------------------
DROP VIEW IF EXISTS `v_question_3year`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_question_3year` AS select `quest`.`id` AS `id`,`quest`.`question_no` AS `question_no`,`quest`.`course_id` AS `course_id`,`quest`.`type_id` AS `type_id`,`quest`.`book_id` AS `book_id`,`quest`.`batch_id` AS `batch_id`,`quest`.`estimate_difficulty_value` AS `estimate_difficulty_value`,`quest`.`estimate_difficulty_code` AS `estimate_difficulty_code`,`quest`.`measured_difficulty_value` AS `measured_difficulty_value`,`quest`.`measured_difficulty_code` AS `measured_difficulty_code`,`quest`.`grade_code` AS `grade_code`,`quest`.`ability_code` AS `ability_code`,`quest`.`chapter` AS `chapter`,`quest`.`section` AS `section`,`quest`.`item` AS `item`,`quest`.`page` AS `page`,`quest`.`score` AS `score`,`quest`.`status_code` AS `status_code`,`quest`.`enable_time` AS `enable_time`,`quest`.`set_time` AS `set_time`,`quest`.`set_by` AS `set_by`,`quest`.`set_teacher_name` AS `set_teacher_name`,`quest`.`remark` AS `remark`,`quest`.`created_time` AS `created_time`,`quest`.`created_by` AS `created_by`,`quest`.`updated_time` AS `updated_time`,`quest`.`updated_by` AS `updated_by`,`quest`.`version` AS `version`,`quest`.`import_id` AS `import_id`,`quest`.`assessment_demand` AS `assessment_demand` from `zk_question` `quest` where `quest`.`id` in (select `detail`.`question_id` AS `question_id` from (`qr_pager_construct_detail` `detail` left join `qr_pager_construct` `pager` on(((`detail`.`pager_construct_id` = `pager`.`ID`) and (`pager`.`status` = 3) and (`pager`.`start_time` >= (curdate() + interval (-(3) * 365) day))))));

-- ----------------------------
--  View structure for `v_question_all`
-- ----------------------------
DROP VIEW IF EXISTS `v_question_all`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_question_all` AS select `quest`.`id` AS `id`,`quest`.`question_no` AS `question_no`,`quest`.`course_id` AS `course_id`,`quest`.`type_id` AS `type_id`,`quest`.`book_id` AS `book_id`,`quest`.`batch_id` AS `batch_id`,`quest`.`estimate_difficulty_value` AS `estimate_difficulty_value`,`quest`.`estimate_difficulty_code` AS `estimate_difficulty_code`,`quest`.`measured_difficulty_value` AS `measured_difficulty_value`,`quest`.`measured_difficulty_code` AS `measured_difficulty_code`,`quest`.`grade_code` AS `grade_code`,`quest`.`ability_code` AS `ability_code`,`quest`.`chapter` AS `chapter`,`quest`.`section` AS `section`,`quest`.`item` AS `item`,`quest`.`page` AS `page`,`quest`.`score` AS `score`,`quest`.`status_code` AS `status_code`,`quest`.`enable_time` AS `enable_time`,`quest`.`set_time` AS `set_time`,`quest`.`set_by` AS `set_by`,`quest`.`set_teacher_name` AS `set_teacher_name`,`quest`.`remark` AS `remark`,`quest`.`created_time` AS `created_time`,`quest`.`created_by` AS `created_by`,`quest`.`updated_time` AS `updated_time`,`quest`.`updated_by` AS `updated_by`,`quest`.`version` AS `version`,`quest`.`import_id` AS `import_id`,`quest`.`assessment_demand` AS `assessment_demand` from `zk_question` `quest` where ((not((`quest`.`status_code` like '%REJECTED%'))) and (not(exists(select `detail`.`id`,`detail`.`question_id` from (`qr_pager_construct_detail` `detail` left join `qr_pager_construct` `pager` on((`detail`.`pager_construct_id` = `pager`.`ID`))) where ((`quest`.`id` = `detail`.`question_id`) and ((`pager`.`status` <> 3) or (`pager`.`start_time` <= (curdate() + interval (-(3) * 365) day))))))));

-- ----------------------------
--  Triggers structure for table zk_question
-- ----------------------------
DROP TRIGGER IF EXISTS `insert_question_opentime`;
delimiter ;;
CREATE TRIGGER `insert_question_opentime` AFTER INSERT ON `zk_question` FOR EACH ROW begin  
	if  new.enable_time is not null   then  
             insert into zk_question_pager_times(question_id,open_time)values(new.id,new.enable_time);
	end if;  
end
 ;;
delimiter ;
DROP TRIGGER IF EXISTS `up_question_opentime`;
delimiter ;;
CREATE TRIGGER `up_question_opentime` AFTER UPDATE ON `zk_question` FOR EACH ROW begin  
	if  new.enable_time is not null and  (new.enable_time<>old.enable_time or old.enable_time is  null)   then  
             insert into zk_question_pager_times(question_id,open_time)values(new.id,new.enable_time);
	end if;  
end
 ;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;
