he2802 3 år sedan
förälder
incheckning
cadb91428c

+ 9 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsAttachedMapper.xml

@@ -130,6 +130,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				WHEN ga.type = 3 THEN
 				(select do_question_num from user_exam_record uer where uer.exam_id = ga.major_id and uer.user_id = #{userId} and uer.order_goods_id = #{orderGoodsId} and uer.chapter_exam_id = 0 and uer.module_exam_id = 0 ORDER BY uer.record_id desc limit 1)
 				END do_question_num
+				,
+				CASE
+				WHEN ga.type = 1 THEN
+				-1
+				WHEN ga.type = 2 THEN
+				-1
+				WHEN ga.type = 3 THEN
+				(select right_question_num from user_exam_record uer where uer.exam_id = ga.major_id and uer.user_id = #{userId} and uer.order_goods_id = #{orderGoodsId} and uer.chapter_exam_id = 0 and uer.module_exam_id = 0 ORDER BY uer.record_id desc limit 1)
+				END right_question_num
 			</if>
 		FROM
 			goods_attached ga