ソースを参照

fix 资料商品

he2802 3 年 前
コミット
0b24e4c1f5

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionVo.java

@@ -96,4 +96,7 @@ public class QuestionVo {
 	@ApiModelProperty("知识点列表")
 	private List<ExamKnowledge> knowledgeList;
 
+	@ApiModelProperty("试卷列表")
+	private List<ExamVo> examList;
+
 }

+ 17 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -36,8 +36,25 @@
         <result property="code" column="code"/>
         <collection property="businessList" column="question_id" select="findBusinessList" />
         <collection property="knowledgeList" column="knowledge_ids" select="findKnowledge"/>
+        <collection property="examList" column="question_id" select="findExamList" />
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.bank.vo.ExamVo" id="ExamVoResult">
+        <result property="examId" column="exam_id"/>
+        <result property="examName" column="exam_name"/>
+    </resultMap>
+
+    <select id="findExamList" resultMap="ExamVoResult">
+        SELECT
+            e.exam_id,
+            e.exam_name
+        FROM
+            exam_question eq
+                LEFT JOIN exam e ON eq.exam_id = e.exam_id
+        WHERE
+            eq.question_id = #{question_id} AND e.status !=-1
+    </select>
+
     <select id="findKnowledge" resultMap="ExamKnowledge">
         SELECT
             ek.knowledge_name,