|
@@ -389,6 +389,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
-- ORDER by ue.record_id DESC
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="selectSpecialGroup" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultType="com.zhongzheng.modules.user.vo.UserExamRecordVo">
|
|
|
+ SELECT * FROM (
|
|
|
+ SELECT
|
|
|
+ ue.record_id ,ue.user_id ,ue.exam_id ,1 AS courseType,null as type,ue.`status`,ue.goods_id
|
|
|
+ ,ue.report_status,ue.performance,ue.history_exam_json,
|
|
|
+ ue.update_time,ue.total_question_num,ue.right_question_num,ue.do_question_num,ue.module_exam_id as moduleExamId,
|
|
|
+ ue.chapter_exam_id as chapterExamId,NULL as courseId,NULL as moduleId,NULL as chapterId,NULL as sectionId,NULL
|
|
|
+ as gradeId,
|
|
|
+ ue.do_time,ue.exam_time,ue.total_score,ue.do_question_ids,ue.right_question_ids,ue.score,ue.all_question_num,ue.order_goods_id,
|
|
|
+ ue.less_question_num,ue.create_time,e.exam_name,ep.paper_name,4 AS do_mode
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ue.goods_id,
|
|
|
+ ue.exam_id,
|
|
|
+ ue.module_exam_id,
|
|
|
+ ue.chapter_exam_id,
|
|
|
+ MAX( UE.record_id ) record_id
|
|
|
+ FROM
|
|
|
+ user_exam_record ue
|
|
|
+ LEFT JOIN exam e ON ue.exam_id = e.exam_id
|
|
|
+ LEFT JOIN exam_paper ep ON e.exam_paper_id = ep.paper_id
|
|
|
+ WHERE
|
|
|
+ ue.user_id = #{userId}
|
|
|
+ GROUP BY
|
|
|
+ ue.goods_id,
|
|
|
+ ue.exam_id,
|
|
|
+ ue.module_exam_id,
|
|
|
+ ue.chapter_exam_id
|
|
|
+ ) t
|
|
|
+ LEFT JOIN user_exam_record ue ON t.record_id = ue.record_id
|
|
|
+ LEFT JOIN exam e ON ue.exam_id = e.exam_id
|
|
|
+ LEFT JOIN exam_paper ep ON e.exam_paper_id = ep.paper_id
|
|
|
+ LEFT JOIN goods g ON g.goods_id = ue.goods_id
|
|
|
+ WHERE
|
|
|
+ ue.user_id = #{userId}
|
|
|
+ AND ue.do_mode = #{doMode}
|
|
|
+ <if test="paperId != null and paperId != ''">
|
|
|
+ AND ep.paper_id = #{paperId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null and goodsId != ''">
|
|
|
+ AND ue.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null and examId != ''">
|
|
|
+ AND ue.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="moduleExamId != null and moduleExamId != ''">
|
|
|
+ AND ue.module_exam_id = #{moduleExamId}
|
|
|
+ </if>
|
|
|
+ <if test="orderGoodsId != null and orderGoodsId != ''">
|
|
|
+ AND ue.order_goods_id = #{orderGoodsId}
|
|
|
+ </if>
|
|
|
+ <if test="chapterExamId != null and chapterExamId != ''">
|
|
|
+ AND ue.chapter_exam_id = #{chapterExamId}</if>
|
|
|
+ ) a ORDER by a.create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- <select id="selectGroupList" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultMap="UserExamRecordVoResult">-->
|
|
|
<!-- SELECT-->
|
|
|
<!-- ue.*,-->
|