| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ycl.jxkg.mapper.QuestionAnswerRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ycl.jxkg.domain.entity.QuestionAnswerRecord"> |
| | | <id property="id" column="id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="examId" column="exam_id" /> |
| | | <result property="paperId" column="paper_id" /> |
| | | <result property="questionId" column="question_id" /> |
| | | <result property="doRight" column="do_right" /> |
| | | <result property="userAnswer" column="user_answer" /> |
| | | <result property="score" column="score" /> |
| | | <result property="questionType" column="question_type" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="WrongResultMap" type="com.ycl.jxkg.domain.vo.student.wrong.WrongResponseVO"> |
| | | <result property="examId" column="exam_id" /> |
| | | <result property="questionId" column="question_id" /> |
| | | <result property="title" column="title" /> |
| | | <result property="questionType" column="question_type" /> |
| | | <result property="difficult" column="difficult" /> |
| | | <result property="score" column="score" /> |
| | | <result property="examName" column="exam_name" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectWrongQuestion" resultMap="WrongResultMap"> |
| | | SELECT |
| | | e.id AS exam_id, |
| | | q.id AS question_id, |
| | | q.title, |
| | | q.question_type, |
| | | q.difficult, |
| | | qar.score, |
| | | e.exam_name |
| | | FROM t_question_answer_record qar |
| | | LEFT JOIN t_question q ON q.id = qar.question_id |
| | | LEFT JOIN t_exam e ON e.id = qar.exam_id |
| | | <where> |
| | | qar.user_id = #{wrongRequestVo.userId} |
| | | and do_right = 0 |
| | | <if test="wrongRequestVo.title != null and wrongRequestVo.title != ''"> |
| | | and q.title like concat('%',#{wrongRequestVo.title},'%') |
| | | </if> |
| | | <if test="wrongRequestVo.questionType != null"> |
| | | and q.question_type = #{wrongRequestVo.questionType} |
| | | </if> |
| | | <if test="wrongRequestVo.examName != null and wrongRequestVo.examName != ''"> |
| | | and e.exam_name like concat('%',#{wrongRequestVo.examName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |