浏览代码

fix 题库模块

he2802 4 年之前
父节点
当前提交
aee9db4d59

+ 11 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamQuestionVo.java

@@ -2,13 +2,15 @@ package com.zhongzheng.modules.bank.vo;
 
 import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.exam.domain.ExamKnowledge;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -109,4 +111,12 @@ public class ExamQuestionVo {
 	@Excel(name = "编码")
 	@ApiModelProperty("编码")
 	private String code;
+
+	/** 业务层级列表 */
+	@ApiModelProperty("业务层级列表")
+	private List<QuestionBusiness> businessList;
+
+	/** 知识点列表 */
+	@ApiModelProperty("知识点列表")
+	private List<ExamKnowledge> knowledgeList;
 }

+ 39 - 1
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamQuestionMapper.xml

@@ -31,6 +31,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="knowledgeIds" column="knowledge_ids"/>
         <result property="publishStatus" column="publish_status"/>
         <result property="code" column="code"/>
+        <collection property="businessList" javaType="java.util.List" resultMap="QuestionBusiness"/>
+        <collection property="knowledgeList" javaType="java.util.List" resultMap="ExamKnowledge"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.bank.domain.QuestionBusiness" id="QuestionBusiness">
+        <result property="id" column="id"/>
+        <result property="subjectId" column="subject_id"/>
+        <result property="educationTypeId" column="education_type_id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="projectId" column="project_id"/>
+
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+        <result property="subjectName" column="subject_name"/>
+        <result property="type" column="business_type"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.exam.domain.ExamKnowledge" id="ExamKnowledge">
+        <result property="knowledgeId" column="knowledge_id"/>
+        <result property="knowledgeName" column="knowledge_name"/>
     </resultMap>
 
     <select id="getList" parameterType="com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo" resultMap="ExamQuestionResultVo">
@@ -38,10 +59,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         q.*,
         eq.part_score,
         eq.score,
-        eq.sort
+        eq.sort,
+        qb.education_type_id,
+        qb.business_id,
+        qb.project_id,
+        qb.subject_id,
+        qb.type as business_type,
+        cet.education_name,
+        cpt.project_name,
+        cb.business_name,
+        cs.subject_name,
+        ek.knowledge_name,
+        ek.knowledge_id
         FROM
         exam_question eq
         LEFT JOIN question q ON eq.question_id = q.question_id
+        LEFT JOIN question_business qb ON q.question_id = qb.major_id and qb.type = 1
+        LEFT JOIN course_education_type cet ON qb.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON qb.project_id = cpt.id
+        LEFT JOIN course_business cb ON qb.business_id = cb.id
+        LEFT JOIN course_subject cs ON cs.id = qb.subject_id
+        LEFT JOIN exam_knowledge ek ON FIND_IN_SET( ek.knowledge_id, q.knowledge_ids )
         WHERE
               eq.exam_id =#{examId}