<?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.ExamPaperQuestionMapper">
|
|
<resultMap id="ExamPaperQuestionMap" type="com.ycl.jxkg.domain.entity.ExamPaperQuestion">
|
<id column="id" property="id"/>
|
<result column="name" property="name"/>
|
<result column="subject_id" property="subjectId"/>
|
<result column="paper_type" property="paperType"/>
|
<result column="score" property="score"/>
|
<result column="suggest_time" property="suggestTime"/>
|
<collection property="questions" ofType="com.ycl.jxkg.domain.question.QuestionDTO">
|
<id column="questionId" property="id"/>
|
<result column="questionScore" property="score"/>
|
<result column="question_type" property="questionType"/>
|
<result column="difficult" property="difficult"/>
|
<result column="correct" property="correct"/>
|
<result column="content" property="content"/>
|
</collection>
|
</resultMap>
|
|
<select id="selectById" resultMap="ExamPaperQuestionMap">
|
select tep.id,tep.name,tep.subject_id,tep.paper_type,tep.score,tep.suggest_time,
|
tepq.score as questionScore,tq.id as questionId,tq.question_type,tq.difficult,tq.correct,tq.content
|
from t_exam_paper tep
|
left join t_exam_paper_question tepq on tep.id =tepq.exam_paper_id
|
left join t_question tq on tepq.question_id = tq.id
|
where tep.id = #{id} and tq.status = 1 and tq.deleted = 0
|
</select>
|
|
</mapper>
|