he2802 1 éve
szülő
commit
579338d7c2

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/ExamStudyRecordVo.java

@@ -124,4 +124,7 @@ public class ExamStudyRecordVo {
     private String idCard;
     @ApiModelProperty("状态")
     private Integer goodsStatus;
+
+    @ApiModelProperty("准确率")
+    private BigDecimal rightRate;
 }

+ 7 - 4
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -132,6 +132,7 @@
         <result property="realname" column="realname"/>
         <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
         <result property="goodsStatus" column="goods_status"/>
+        <result property="rightRate" column="right_rate"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.ExamSonStudyRecordVo" id="ExamSonStudyRecordVoResult">
@@ -762,12 +763,14 @@
         JOIN question_module_chapter a on e.major_id = a.module_exam_id LEFT JOIN question_chapter_exam h on
         a.chapter_exam_id = h.chapter_exam_id where e.goods_id = g.goods_id and e.type=1) FROM goods_attached a where
         a.goods_id=g.goods_id and a.type = 3) as exam_num,
-        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        (SELECT create_time FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
         create_time ASC LIMIT 1) as start_time,
-        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        (SELECT create_time FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
         create_time DESC LIMIT 1) as end_time,
-        (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
-        as stu_all_num
+        (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
+        as stu_all_num,
+        (SELECT MAX(right_rate) FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
+        as right_rate
         FROM
         goods g
         LEFT JOIN order_goods s ON g.goods_id = s.goods_id AND s.pay_status in (2,3,4)