Эх сурвалжийг харах

完成知识点诊断数据库设计

Feick 3 жил өмнө
parent
commit
9bfac7d9d4

+ 142 - 0
src/main/java/com/yaoxiang/diagnosis/entity/Issue.java

@@ -0,0 +1,142 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+@Entity
+@ApiModel("问题")
+public class Issue {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @Lob
+    @Column(nullable = false)
+    @ApiModelProperty("题目内容")
+    private String content;
+
+    @ApiModelProperty("模块1专用")
+    @Column
+    private Long chapterId;
+
+    @Column
+    private String grade;
+
+    @Column
+    @ApiModelProperty("知识点标签 以,隔开")
+    private String tag;
+
+    @Column(nullable = false, columnDefinition = " int default 1")
+    @ApiModelProperty("题目所属模块 1 2 3")
+    private int section;
+
+    private String answer;
+
+    @CreationTimestamp
+    @Column(nullable = false)
+    private Date createtime;
+
+    @UpdateTimestamp
+    @Column(nullable = false)
+    private Date updatetime;
+
+    @Transient
+    private List<IssueOption> options;
+
+    @Transient
+    private List<IssueMind> minds;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Long getChapterId() {
+        return chapterId;
+    }
+
+    public void setChapterId(Long chapterId) {
+        this.chapterId = chapterId;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+
+    public int getSection() {
+        return section;
+    }
+
+    public void setSection(int section) {
+        this.section = section;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+
+    public Date getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(Date updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public List<IssueOption> getOptions() {
+        return options;
+    }
+
+    public void setOptions(List<IssueOption> options) {
+        this.options = options;
+    }
+
+    public List<IssueMind> getMinds() {
+        return minds;
+    }
+
+    public void setMinds(List<IssueMind> minds) {
+        this.minds = minds;
+    }
+}

+ 88 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssueChapter.java

@@ -0,0 +1,88 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.persistence.*;
+
+@ApiModel("章节")
+@Entity
+public class IssueChapter {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @ApiModelProperty("章节名称 乘法与除法")
+    private String name;
+
+    @ApiModelProperty("章节序号 第一章")
+    private String chapter;
+
+    @ApiModelProperty("出版商")
+    private String publisher;
+
+    @Column(nullable = false)
+    @ApiModelProperty("章节编号 1 2")
+    private String code;
+
+    private String grade;
+
+    private Long subjectId;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getChapter() {
+        return chapter;
+    }
+
+    public void setChapter(String chapter) {
+        this.chapter = chapter;
+    }
+
+    public String getPublisher() {
+        return publisher;
+    }
+
+    public void setPublisher(String publisher) {
+        this.publisher = publisher;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
+}

+ 81 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssueMind.java

@@ -0,0 +1,81 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+@Entity
+@ApiModel("模块二小题")
+public class IssueMind {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    private String answer;
+
+    private Long issueId;
+
+    @CreationTimestamp
+    @Column(nullable = false)
+    private Date createtime;
+    @UpdateTimestamp
+    @Column(nullable = false)
+    private Date updatetime;
+
+    @Transient
+    private List<IssueOption> options;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public Long getIssueId() {
+        return issueId;
+    }
+
+    public void setIssueId(Long issueId) {
+        this.issueId = issueId;
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+
+    public Date getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(Date updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public List<IssueOption> getOptions() {
+        return options;
+    }
+
+    public void setOptions(List<IssueOption> options) {
+        this.options = options;
+    }
+}

+ 110 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssueOption.java

@@ -0,0 +1,110 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@ApiModel("题目选项")
+public class IssueOption {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    private Long issueId;
+
+    private int section;
+
+    @Lob
+    @Column(nullable = false)
+    @ApiModelProperty("选项内容")
+    private String content;
+
+    /**
+     * option index(1:A  2:B 3:C ...)
+     */
+    @Column(nullable = false)
+    @ApiModelProperty("选项编号 1:A 2:B 3:C")
+    private Integer oindex;
+
+    @CreationTimestamp
+    @Column(nullable = false)
+    private Date createtime;
+
+    @UpdateTimestamp
+    @Column(nullable = false)
+    private Date updatetime;
+
+    @Column(nullable = false)
+    @ApiModelProperty("是否正确")
+    private Boolean correct;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getIssueId() {
+        return issueId;
+    }
+
+    public void setIssueId(Long issueId) {
+        this.issueId = issueId;
+    }
+
+    public int getSection() {
+        return section;
+    }
+
+    public void setSection(int section) {
+        this.section = section;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Integer getOindex() {
+        return oindex;
+    }
+
+    public void setOindex(Integer oindex) {
+        this.oindex = oindex;
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+
+    public Date getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(Date updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public Boolean getCorrect() {
+        return correct;
+    }
+
+    public void setCorrect(Boolean correct) {
+        this.correct = correct;
+    }
+}

+ 106 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssuePaper.java

@@ -0,0 +1,106 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+@Entity
+@ApiModel("组合卷")
+public class IssuePaper {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    private String name;
+
+    @Column(nullable = false, columnDefinition = "  varchar(255) default '2'")
+    @ApiModelProperty("科目类别Id")
+    private Long subjectId;
+
+    @CreationTimestamp
+    @Column(nullable = false)
+    private Date createtime;
+
+    @UpdateTimestamp
+    @Column(nullable = false)
+    private Date updatetime;
+
+    @Transient
+    private List<IssuePaperMapper> mappers;
+
+    @Transient
+    private List<Issue> issues;
+
+    @Transient
+    private List<IssuePaperInfo> info;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+
+    public Date getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(Date updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public List<IssuePaperMapper> getMappers() {
+        return mappers;
+    }
+
+    public void setMappers(List<IssuePaperMapper> mappers) {
+        this.mappers = mappers;
+    }
+
+    public List<Issue> getIssues() {
+        return issues;
+    }
+
+    public void setIssues(List<Issue> issues) {
+        this.issues = issues;
+    }
+
+    public List<IssuePaperInfo> getInfo() {
+        return info;
+    }
+
+    public void setInfo(List<IssuePaperInfo> info) {
+        this.info = info;
+    }
+}

+ 136 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssuePaperCommit.java

@@ -0,0 +1,136 @@
+package com.yaoxiang.diagnosis.entity;
+
+import com.yaoxiang.diagnosis.model.Answer;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.annotations.CreationTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+@Entity
+@ApiModel("组卷提交")
+public class IssuePaperCommit {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    private Long pid;
+
+    private Long uid;
+
+    @Column
+    @ApiModelProperty("用户姓名")
+    private String name;
+
+    /**
+     * [{
+     *     "useTime":1,
+     *     "qid":1,
+     *     "number":1,
+     *     "answer":"AB"
+     * }]
+     */
+    @Lob
+    @Column(nullable = false)
+    @ApiModelProperty("答案json化")
+    private String jsonAnswer;
+
+    @Column
+    private Date beginTime;
+    @Column
+    private Date endTime;
+
+    @Column(nullable = false)
+    @ApiModelProperty("用时,单位秒")
+    private int useTime;
+
+    @CreationTimestamp
+    @Column(nullable = false)
+    private Date createtime;
+
+    @Transient
+    private List<Answer> answers;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getPid() {
+        return pid;
+    }
+
+    public void setPid(Long pid) {
+        this.pid = pid;
+    }
+
+    public Long getUid() {
+        return uid;
+    }
+
+    public void setUid(Long uid) {
+        this.uid = uid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getJsonAnswer() {
+        return jsonAnswer;
+    }
+
+    public void setJsonAnswer(String jsonAnswer) {
+        this.jsonAnswer = jsonAnswer;
+    }
+
+    public Date getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(Date beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public int getUseTime() {
+        return useTime;
+    }
+
+    public void setUseTime(int useTime) {
+        this.useTime = useTime;
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+
+    public List<Answer> getAnswers() {
+        return answers;
+    }
+
+    public void setAnswers(List<Answer> answers) {
+        this.answers = answers;
+    }
+}

+ 69 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssuePaperInfo.java

@@ -0,0 +1,69 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Entity
+@ApiModel("组题模块及章节选择")
+public class IssuePaperInfo {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    private Long pid;
+
+    @ApiModelProperty("选择的年级,模块二、三使用")
+    private String selectedGrade;
+
+    @ApiModelProperty("选择的章节Id,模块一使用,以 , 隔开")
+    private String selectedChapters;
+
+    @ApiModelProperty("选择的模块")
+    private int section;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getPid() {
+        return pid;
+    }
+
+    public void setPid(Long pid) {
+        this.pid = pid;
+    }
+
+    public String getSelectedGrade() {
+        return selectedGrade;
+    }
+
+    public void setSelectedGrade(String selectedGrade) {
+        this.selectedGrade = selectedGrade;
+    }
+
+    public String getSelectedChapters() {
+        return selectedChapters;
+    }
+
+    public void setSelectedChapters(String selectedChapters) {
+        this.selectedChapters = selectedChapters;
+    }
+
+    public int getSection() {
+        return section;
+    }
+
+    public void setSection(int section) {
+        this.section = section;
+    }
+}

+ 69 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssuePaperMapper.java

@@ -0,0 +1,69 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.persistence.*;
+
+@Entity
+@ApiModel("组卷题目与选项")
+@Table(indexes = @Index(name = "issuePaperIndex",columnList = "pid,issueId",unique = true))
+public class IssuePaperMapper {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @ApiModelProperty("所属试题Id,与IssuePaper关联")
+    private Long pid;
+
+    @Column(nullable = false, columnDefinition = " int default 1")
+    @ApiModelProperty("针对整套试题的题目编号")
+    private int number;//题目显式编号1,2,3
+
+    @ApiModelProperty("题目Id,与Issue关联")
+    private Long issueId;
+
+    @ApiModelProperty("所属模块")
+    private int section;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getPid() {
+        return pid;
+    }
+
+    public void setPid(Long pid) {
+        this.pid = pid;
+    }
+
+    public int getNumber() {
+        return number;
+    }
+
+    public void setNumber(int number) {
+        this.number = number;
+    }
+
+    public Long getIssueId() {
+        return issueId;
+    }
+
+    public void setIssueId(Long issueId) {
+        this.issueId = issueId;
+    }
+
+    public int getSection() {
+        return section;
+    }
+
+    public void setSection(int section) {
+        this.section = section;
+    }
+}

+ 97 - 0
src/main/java/com/yaoxiang/diagnosis/entity/IssueWord.java

@@ -0,0 +1,97 @@
+package com.yaoxiang.diagnosis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Entity
+@ApiModel("知识点")
+public class IssueWord {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    private Long subjectId;
+
+    private String content;
+
+    private String code;
+
+    private String chapterCode;
+
+    private Long chapterId;
+
+    @ApiModelProperty("是否核心词汇")
+    private Boolean central = false;
+
+    private String type;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getChapterCode() {
+        return chapterCode;
+    }
+
+    public void setChapterCode(String chapterCode) {
+        this.chapterCode = chapterCode;
+    }
+
+    public Long getChapterId() {
+        return chapterId;
+    }
+
+    public void setChapterId(Long chapterId) {
+        this.chapterId = chapterId;
+    }
+
+    public Boolean getCentral() {
+        return central;
+    }
+
+    public void setCentral(Boolean central) {
+        this.central = central;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+}