deason 6 years ago
parent
commit
f8bc6525cf

+ 2 - 2
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/QuestionStatistic.java → examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/ExamQuestionStructure.java

@@ -10,9 +10,9 @@ package cn.com.qmth.examcloud.core.print.entity;
 import java.io.Serializable;
 
 /**
- * 试题统计信息
+ * 试题结构信息
  */
-public class QuestionStatistic implements Serializable {
+public class ExamQuestionStructure implements Serializable {
     private static final long serialVersionUID = 1L;
     /**
      * 试题类型

+ 1 - 1
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/ExamStructure.java

@@ -47,7 +47,7 @@ public class ExamStructure extends IdEntity {
     @Column(length = 50)
     private String examType;
     /**
-     * @See QuestionStatistic.java
+     * @See ExamQuestionStructure.java
      * <p>
      * 试题结构内容(JSON格式):
      * [{"questionType":"abc","total":20},{"questionType":"xyz","total":10}]

+ 3 - 16
examcloud-core-print-dao/src/main/resources/db-schema.sql

@@ -47,9 +47,9 @@ CREATE TABLE ec_prt_exam_structure (
   exam_type     varchar(50)         DEFAULT NULL,
   org_id        bigint(20)          DEFAULT NULL,
   org_name      varchar(50)         DEFAULT NULL,
+  struct        varchar(500)        DEFAULT NULL,
   PRIMARY KEY (id),
-  KEY INDEX_PRT_EXAM_STRUCTURE_01 (org_id),
-  KEY INDEX_PRT_EXAM_STRUCTURE_02 (exam_id)
+  UNIQUE KEY INDEX_PRT_EXAM_STRUCTURE_01 (org_id, exam_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 
@@ -132,19 +132,6 @@ CREATE TABLE ec_prt_project_other_setting (
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 
-DROP TABLE IF EXISTS ec_prt_question_statistic;
-CREATE TABLE ec_prt_question_statistic (
-  id                bigint(20) NOT NULL AUTO_INCREMENT,
-  creation_time     datetime            DEFAULT NULL,
-  update_time       datetime            DEFAULT NULL,
-  exam_structure_id bigint(20)          DEFAULT NULL,
-  question_total    int(11)             DEFAULT NULL,
-  question_type     varchar(50)         DEFAULT NULL,
-  PRIMARY KEY (id),
-  KEY INDEX_PRT_QUESTION_STATISTIC_01 (exam_structure_id)
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
-
-
 DROP TABLE IF EXISTS ec_prt_subjective_question_structure;
 CREATE TABLE ec_prt_subjective_question_structure (
   id            bigint(20) NOT NULL AUTO_INCREMENT,
@@ -183,4 +170,4 @@ CREATE TABLE ec_prt_template (
   PRIMARY KEY (id),
   KEY INDEX_PRT_TEMPLATE_01 (org_id),
   KEY INDEX_PRT_TEMPLATE_02 (exam_id)
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB DEFAULT CHARSET = utf8;