<?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.ynfy.buss.exam.exam.mapper.ExamPapersMapper">

    <select id="getExamIdExamPaper" resultType="com.ynfy.buss.exam.exam.entity.ExamPapers">
                        select ep.*,p.title from
                                      exam e
                                          LEFT JOIN exam_papers ep on e.id=ep.exam_id
                                          left join paper p on ep.paper_id=p.id
                                   where e.id=#{examId}
                                    order by ep.paper_order
    </select>
    <select id="ExamIdExamPapers" resultType="com.ynfy.buss.exam.exam.entity.ExamPapers">
        select ep.*,p.title,p.join_type,p.question_count from 	exam_papers ep,	paper p
        where ep.paper_id=p.id
        and ep.exam_id=#{examId}
    </select>
</mapper>