<?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.qmth.distributed.print.business.mapper.GradePaperMapper">

    <select id="findBySchoolIdAndPaperNumberAndPaperType"
            resultType="com.qmth.distributed.print.business.bean.dto.open.PaperConfig">
        SELECT id,
               paper_type  paperType,
               start_time  startTime,
               end_time    endTime,
               coefficient coefficient,
               total_score totalScore,
               pass_score  passScore,
               score_type  scoreType
        FROM grade_paper
        where school_id = #{schoolId}
          and paper_number = #{paperNumber}
          and paper_type = #{paperType}
         <if test="examId != null">
             AND exam_id = #{examId}
         </if>
    </select>
</mapper>
