瀏覽代碼

fix 题库

he2802 3 年之前
父節點
當前提交
0283c1e6d0

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionChapterExamMapper.xml

@@ -47,9 +47,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                3 as type
         <if test="userId != null ">
                 ,
-            ifnull( (select `status` from user_exam_record uer where uer.exam_id = e.exam_id and uer.user_id = #{userId} and uer.goods_id = #{goodsId} ORDER BY uer.record_id desc limit 1),-1) record_status
+            ifnull( (select `status` from user_exam_record uer where uer.exam_id = e.exam_id and uer.user_id = #{userId} and uer.goods_id = #{goodsId} and uer.chapter_exam_id = qce.chapter_exam_id and uer.module_exam_id = #{moduleExamId} ORDER BY uer.record_id desc limit 1),-1) record_status
             ,
-            ifnull( (select record_id from user_exam_record uer where uer.exam_id = e.exam_id and uer.user_id = #{userId} and uer.goods_id = #{goodsId} ORDER BY uer.record_id desc limit 1),-1) record_id
+            ifnull( (select record_id from user_exam_record uer where uer.exam_id = e.exam_id and uer.user_id = #{userId} and uer.goods_id = #{goodsId} and uer.chapter_exam_id = qce.chapter_exam_id and uer.module_exam_id = #{moduleExamId} ORDER BY uer.record_id desc limit 1),-1) record_id
         </if>
         FROM
             question_chapter_exam qce