<?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.teachcloud.report.business.mapper.TAExamCourseTeacherCollegeDifficultMapper">

    <select id="findValidAnswerDetail" resultType="com.qmth.teachcloud.report.business.bean.result.CellResult">
        SELECT
            tik.paper_type AS paperType,
            tik.`scope`,
            tik.count,
            tik.interpret,
            round(tik.col_avg_score_rate * 100,2) as colAvgScoreRate,
            round(tik.tea_col_avg_score_rate * 100,2) as teaAvgScoreRate
        from t_a_exam_course_teacher_college_difficult tik
        <where>
            <if test="teacherId != null and teacherId > 0">
                and tik.teacher_id = #{teacherId}
            </if>
            <if test="inspectCollegeId != null and inspectCollegeId > 0">
                and tik.inspect_college_id = #{inspectCollegeId}
            </if>
            <if test="examId != null and examId > 0">
                and tik.exam_id = #{examId}
            </if>
            <if test="courseCode != null and courseCode != ''">
                and tik.course_code = #{courseCode}
            </if>
        </where>
    </select>
</mapper>
