12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?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.TCFinalScoreMapper">
- <select id="finalScoreList" resultType="com.qmth.distributed.print.business.entity.TCFinalScore">
- select * from t_c_final_score t
- <where>
- <if test="examId != null and examId != ''">
- and t.exam_id = #{examId}
- </if>
- <if test="courseCode != null and courseCode != ''">
- and t.course_code = #{courseCode}
- </if>
- <if test="paperNumber != null and paperNumber != ''">
- and t.paper_number = #{paperNumber}
- </if>
- </where>
- </select>
- <select id="finalScoreScoreOverView" resultType="com.qmth.distributed.print.business.bean.dto.FinalScoreDto">
- select count(1) as studentCount,
- max(case when tcfs.score is not null then tcfs.score else null end) finalScoreMaxScore,
- min(case when tcfs.score is not null then tcfs.score else null end) finalScoreMinScore,
- avg(case when tcfs.score is not null then tcfs.score else null end) finalScoreAvgScore
- from t_c_final_score tcfs
- join t_c_usual_score tcus on tcfs.exam_id = tcus.exam_id and tcfs.course_code = tcus.course_code and tcfs.paper_number and tcus.paper_number and tcfs.student_code = tcus.student_code
- <where>
- <if test="examId != null and examId != ''">
- and tcfs.exam_id = #{examId}
- </if>
- <if test="courseCode != null and courseCode != ''">
- and tcfs.course_code = #{courseCode}
- </if>
- <if test="paperNumber != null and paperNumber != ''">
- and tcfs.paper_number = #{paperNumber}
- </if>
- </where>
- </select>
- <select id="getCountByScoreRange" resultType="int">
- SELECT count(1) FROM t_c_final_score tcfs
- <where>
- <if test="examId != null and examId != ''">
- and tcfs.exam_id = #{examId}
- </if>
- <if test="courseCode != null and courseCode != ''">
- and tcfs.course_code = #{courseCode}
- </if>
- <if test="paperNumber != null and paperNumber != ''">
- and tcfs.paper_number = #{paperNumber}
- </if>
- and tcfs.score >= #{start} and tcfs.score <= #{end}
- </where>
- </select>
- <select id="examStudentOverview" resultType="com.qmth.distributed.print.business.bean.result.FinalScoreResult">
- select
- tcfs.name,
- tcfs.student_code as studentCode,
- tcfs.score as finalScore,
- tcfs.score_detail as finalScoreDetail,
- tcus.score as usualScore,
- es.clazz_name as administrativeClass
- from t_c_final_score tcfs
- join t_c_usual_score tcus on tcfs.exam_id = tcus.exam_id and tcfs.course_code = tcus.course_code and tcfs.paper_number and tcus.paper_number and tcfs.student_code = tcus.student_code
- join exam_student es on es.exam_id = tcfs.exam_id and es.paper_number = tcfs.paper_number and es.student_code = tcfs.student_code
- <where>
- <if test="examId != null and examId != ''">
- and tcfs.exam_id = #{examId}
- </if>
- <if test="courseCode != null and courseCode != ''">
- and tcfs.course_code = #{courseCode}
- </if>
- <if test="paperNumber != null and paperNumber != ''">
- and tcfs.paper_number = #{paperNumber}
- </if>
- </where>
- </select>
- </mapper>
|