Bläddra i källkod

数据库字段调整

deason 6 år sedan
förälder
incheckning
6f81a9d151

+ 17 - 53
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/PrintingTemplate.java

@@ -8,9 +8,11 @@
 package cn.com.qmth.examcloud.core.print.entity;
 
 import cn.com.qmth.examcloud.core.print.common.IdEntity;
-import cn.com.qmth.examcloud.core.print.enums.TemplateType;
 
-import javax.persistence.*;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Index;
+import javax.persistence.Table;
 
 /**
  * 印刷模板信息
@@ -29,35 +31,20 @@ public class PrintingTemplate extends IdEntity {
      */
     private Long examId;
     /**
-     * 学校机构名称
-     */
-    @Column(length = 50)
-    private String orgName;
-    /**
-     * 考试名称
-     */
-    @Column(length = 50)
-    private String examName;
-    /**
+     * @See TemplateType.java
      * 模板类型
      */
-    @Enumerated(EnumType.STRING)
-    @Column(length = 50)
-    private TemplateType templateType;
-    /**
-     * 文件地址
-     */
-    @Column(length = 200)
-    private String templateUrl;
+    private Integer templateType;
     /**
-     * 文件名
+     * 模板文件名
      */
     @Column(length = 50)
     private String fileName;
     /**
-     * 序号
+     * 模板文件地址
      */
-    private Integer orderNum;
+    @Column(length = 200)
+    private String fileUrl;
 
     public Long getOrgId() {
         return orgId;
@@ -75,38 +62,14 @@ public class PrintingTemplate extends IdEntity {
         this.examId = examId;
     }
 
-    public String getOrgName() {
-        return orgName;
-    }
-
-    public void setOrgName(String orgName) {
-        this.orgName = orgName;
-    }
-
-    public String getExamName() {
-        return examName;
-    }
-
-    public void setExamName(String examName) {
-        this.examName = examName;
-    }
-
-    public TemplateType getTemplateType() {
+    public Integer getTemplateType() {
         return templateType;
     }
 
-    public void setTemplateType(TemplateType templateType) {
+    public void setTemplateType(Integer templateType) {
         this.templateType = templateType;
     }
 
-    public String getTemplateUrl() {
-        return templateUrl;
-    }
-
-    public void setTemplateUrl(String templateUrl) {
-        this.templateUrl = templateUrl;
-    }
-
     public String getFileName() {
         return fileName;
     }
@@ -115,11 +78,12 @@ public class PrintingTemplate extends IdEntity {
         this.fileName = fileName;
     }
 
-    public Integer getOrderNum() {
-        return orderNum;
+    public String getFileUrl() {
+        return fileUrl;
     }
 
-    public void setOrderNum(Integer orderNum) {
-        this.orderNum = orderNum;
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
     }
+
 }

+ 2 - 13
examcloud-core-print-dao/src/main/resources/db-schema.sql

@@ -18,7 +18,6 @@ CREATE TABLE ec_prt_course_paper (
   KEY INDEX_PRT_COURSE_PAPER_02 (exam_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
-
 DROP TABLE IF EXISTS ec_prt_course_statistic;
 CREATE TABLE ec_prt_course_statistic (
   id              bigint(20) NOT NULL AUTO_INCREMENT,
@@ -36,7 +35,6 @@ CREATE TABLE ec_prt_course_statistic (
   KEY INDEX_PRT_COURSE_STATISTIC_02 (exam_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
-
 DROP TABLE IF EXISTS ec_prt_exam_structure;
 CREATE TABLE ec_prt_exam_structure (
   id            bigint(20) NOT NULL AUTO_INCREMENT,
@@ -52,7 +50,6 @@ CREATE TABLE ec_prt_exam_structure (
   UNIQUE KEY INDEX_PRT_EXAM_STRUCTURE_01 (org_id, exam_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
-
 DROP TABLE IF EXISTS ec_prt_objective_question_structure;
 CREATE TABLE ec_prt_objective_question_structure (
   id            bigint(20) NOT NULL AUTO_INCREMENT,
@@ -75,7 +72,6 @@ CREATE TABLE ec_prt_objective_question_structure (
   KEY INDEX_PRT_OBJECTIVE_QUESTION_02 (paper_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
-
 DROP TABLE IF EXISTS ec_prt_project;
 CREATE TABLE ec_prt_project (
   id                 bigint(20) NOT NULL AUTO_INCREMENT,
@@ -100,7 +96,6 @@ CREATE TABLE ec_prt_project (
   UNIQUE KEY INDEX_PRT_PROJECT_01 (org_id, exam_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
-
 DROP TABLE IF EXISTS ec_prt_project_backup_setting;
 CREATE TABLE ec_prt_project_backup_setting (
   id                 bigint(20) NOT NULL AUTO_INCREMENT,
@@ -118,7 +113,6 @@ CREATE TABLE ec_prt_project_backup_setting (
   UNIQUE KEY INDEX_PRT_PROJECT_BACKUP_01 (project_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
-
 DROP TABLE IF EXISTS ec_prt_project_other_setting;
 CREATE TABLE ec_prt_project_other_setting (
   id            bigint(20) NOT NULL AUTO_INCREMENT,
@@ -130,7 +124,6 @@ CREATE TABLE ec_prt_project_other_setting (
   KEY INDEX_PRT_PROJECT_OTHER_01 (project_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,
@@ -152,20 +145,16 @@ CREATE TABLE ec_prt_subjective_question_structure (
   KEY INDEX_PRT_SUBJECTIVE_QUESTION_02 (paper_id)
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
-
 DROP TABLE IF EXISTS ec_prt_template;
 CREATE TABLE ec_prt_template (
   id            bigint(20) NOT NULL AUTO_INCREMENT,
   creation_time datetime            DEFAULT NULL,
   update_time   datetime            DEFAULT NULL,
   exam_id       bigint(20)          DEFAULT NULL,
-  exam_name     varchar(50)         DEFAULT NULL,
   file_name     varchar(50)         DEFAULT NULL,
-  order_num     int(11)             DEFAULT NULL,
+  file_url      varchar(200)        DEFAULT NULL,
   org_id        bigint(20)          DEFAULT NULL,
-  org_name      varchar(50)         DEFAULT NULL,
-  template_type varchar(50)         DEFAULT NULL,
-  template_url  varchar(200)        DEFAULT NULL,
+  template_type int(11)             DEFAULT NULL,
   PRIMARY KEY (id),
   KEY INDEX_PRT_TEMPLATE_01 (org_id),
   KEY INDEX_PRT_TEMPLATE_02 (exam_id)