|
@@ -108,6 +108,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER by ue.record_id DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectGroupList" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultMap="UserExamRecordVoResult">
|
|
|
+ SELECT
|
|
|
+ ue.*,
|
|
|
+ e.exam_name,
|
|
|
+ ep.paper_name
|
|
|
+ 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 = 53
|
|
|
+ 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
|
|
|
+ WHERE
|
|
|
+ ue.user_id = #{userId}
|
|
|
+ <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>
|
|
|
+ ORDER by ue.record_id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectDoNum" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultType="Long">
|
|
|
SELECT
|
|
|
IFNULL( COUNT(*), 0 ) num
|