|
@@ -236,6 +236,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
q.type
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ q.type,
|
|
|
+ count(DISTINCT q.question_id ) AS num,
|
|
|
+ 3 as do_mode
|
|
|
+ FROM
|
|
|
+ ( SELECT ue.* FROM user_exam_wrong_record ue
|
|
|
+ LEFT JOIN exam e ON ue.exam_id = e.exam_id
|
|
|
+ LEFT JOIN exam_paper ep ON ep.paper_id = e.exam_paper_id
|
|
|
+ WHERE ue.user_id = #{userId}
|
|
|
+ AND ue.do_mode = 3
|
|
|
+ <if test="paperId != null and paperId != ''">
|
|
|
+ AND e.exam_paper_id = #{paperId}
|
|
|
+ </if>) uew
|
|
|
+ LEFT JOIN question q ON uew.question_id = q.question_id
|
|
|
+ LEFT JOIN goods g ON g.goods_id = uew.goods_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ <if test="goodsId != null and goodsId != ''">
|
|
|
+ AND uew.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ <if test="orderGoodsId != null and orderGoodsId != ''">
|
|
|
+ AND uew.order_goods_id = #{orderGoodsId}
|
|
|
+ </if>
|
|
|
+ <if test="educationTypeId != null and educationTypeId != ''">
|
|
|
+ AND g.education_type_id = #{educationTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ q.type
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTypeQuestionList" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="UserExamWrongRecordVoResult">
|
|
@@ -283,6 +315,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="courseType != null and courseType != ''">
|
|
|
AND course_type = #{courseType}
|
|
|
</if>
|
|
|
+ <if test="doModes != null and doModes.size()!=0 ">
|
|
|
+ AND do_mode in
|
|
|
+ <foreach collection="doModes" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
GROUP BY
|
|
|
exam_id
|
|
|
) uewr
|