<?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.hotwj.platform.config.examPaperQuestion.mapper.HotExamPaperQuestionMapper">
    <select id="selectPaperQuestionDetailList"
            resultType="com.hotwj.platform.config.examPaperQuestion.domain.vo.ExamPaperQuestionDetailVo">
        SELECT epq.id                    AS relationId,
               epq.paper_id              AS paperId,
               epq.question_id           AS questionId,
               epq.question_type         AS questionType,
               epq.sort_order            AS sortOrder,
               epq.score                 AS score,
               qb.difficulty             AS difficulty,
               qb.company_id             AS questionCompanyId,
               qb.question_type          AS questionTypeNum,
               qb.training_type_code     AS trainingTypeCode,
               qb.training_subtype_codes AS trainingSubtypeCodes,
               qb.question_desc          AS questionDesc,
               qb.image_url              AS imageUrl,
               qb.option_a               AS optionA,
               qb.option_b               AS optionB,
               qb.option_c               AS optionC,
               qb.option_d               AS optionD,
               qb.option_e               AS optionE,
               qb.option_f               AS optionF,
               qb.correct_answers        AS correctAnswers,
               qb.score                  AS questionScore,
               qb.is_deleted             AS questionIsDeleted
        FROM hot_exam_paper_question epq
                 LEFT JOIN hot_question_bank qb ON qb.id = epq.question_id
        WHERE epq.paper_id = #{paperId}
        ORDER BY epq.question_type ASC, epq.sort_order ASC, epq.id ASC
    </select>
</mapper>
