|
@@ -27,21 +27,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<result property="examName" column="exam_name"/>
|
|
|
<result property="wrongQuestionNum" column="wrong_question_num"/>
|
|
|
+ <result property="type" column="type"/>
|
|
|
+ <result property="num" column="num"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="com.zhongzheng.modules.bank.vo.QuestionVo" id="QuestionResultVo">
|
|
|
+ <result property="questionId" column="question_id"/>
|
|
|
+ <result property="content" column="content"/>
|
|
|
+ <result property="type" column="type"/>
|
|
|
+ <result property="answerQuestion" column="answer_question"/>
|
|
|
+ <result property="status" column="status"/>
|
|
|
+ <result property="analysisContent" column="analysis_content"/>
|
|
|
+ <result property="imgUrl" column="img_url"/>
|
|
|
+ <result property="jsonStr" column="json_str"/>
|
|
|
+ <result property="prefixName" column="prefix_name"/>
|
|
|
+ <result property="knowledgeIds" column="knowledge_ids"/>
|
|
|
+ <result property="publishStatus" column="publish_status"/>
|
|
|
+ <result property="code" column="code"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectList" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="UserExamWrongRecordVoResult">
|
|
|
SELECT
|
|
|
e.exam_name,
|
|
|
- COUNT( DISTINCT uew.question_id ) AS question_num
|
|
|
+ e.exam_id,
|
|
|
+ COUNT( DISTINCT uew.question_id ) AS wrong_question_num
|
|
|
FROM
|
|
|
user_exam_wrong_record uew
|
|
|
LEFT JOIN exam e ON uew.exam_id = e.exam_id
|
|
|
- LEFT JOIN question q ON q.question_id = uew.question_id
|
|
|
WHERE
|
|
|
uew.user_id = #{userId}
|
|
|
- <if test="type != null and type != ''">
|
|
|
- AND q.type = #{type}
|
|
|
- </if>
|
|
|
<if test="goodsId != null and goodsId != ''">
|
|
|
AND uew.goods_id = #{goodsId}
|
|
|
</if>
|
|
@@ -49,8 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
e.exam_id
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectQuestionList" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="UserExamWrongRecordVoResult">
|
|
|
- SELECT
|
|
|
+ <select id="selectQuestionList" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="QuestionResultVo">
|
|
|
+ SELECT DISTINCT
|
|
|
q.*
|
|
|
FROM
|
|
|
user_exam_wrong_record uew
|
|
@@ -66,7 +80,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="examId != null and examId != ''">
|
|
|
AND uew.exam_id = #{examId}
|
|
|
</if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTypeNum" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="UserExamWrongRecordVoResult">
|
|
|
+ SELECT
|
|
|
+ q.type,
|
|
|
+ count( q.question_id ) AS num
|
|
|
+ FROM
|
|
|
+ ( SELECT * FROM user_exam_wrong_record WHERE user_id = #{userId} ) uew
|
|
|
+ LEFT JOIN question q ON uew.question_id = q.question_id
|
|
|
GROUP BY
|
|
|
- q.question_id
|
|
|
+ q.type
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTypeQuestionList" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="QuestionResultVo">
|
|
|
+ SELECT DISTINCT
|
|
|
+ q.*
|
|
|
+ FROM
|
|
|
+ user_exam_wrong_record uew
|
|
|
+ LEFT JOIN question q ON uew.question_id = q.question_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND uew.user_id = #{userId}
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ AND q.type = #{type}
|
|
|
+ </if>
|
|
|
+
|
|
|
</select>
|
|
|
</mapper>
|