|
@@ -4,199 +4,194 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.qmth.teachcloud.mark.entity.MarkStudent">
|
|
|
- <id column="id" property="id" />
|
|
|
- <result column="exam_id" property="examId" />
|
|
|
- <result column="course_code" property="courseCode" />
|
|
|
- <result column="course_name" property="courseName" />
|
|
|
- <result column="paper_number" property="paperNumber" />
|
|
|
- <result column="course_paper_id" property="coursePaperId" />
|
|
|
- <result column="secret_number" property="secretNumber" />
|
|
|
- <result column="student_code" property="studentCode" />
|
|
|
- <result column="student_name" property="studentName" />
|
|
|
- <result column="package_code" property="packageCode" />
|
|
|
- <result column="exam_place" property="examPlace" />
|
|
|
- <result column="exam_room" property="examRoom" />
|
|
|
- <result column="remark" property="remark" />
|
|
|
- <result column="batch_code" property="batchCode" />
|
|
|
- <result column="sheet_count" property="sheetCount" />
|
|
|
- <result column="answers" property="answers" />
|
|
|
- <result column="is_upload" property="upload" />
|
|
|
- <result column="is_absent" property="absent" />
|
|
|
- <result column="is_manual_absent" property="manualAbsent" />
|
|
|
- <result column="is_breach" property="breach" />
|
|
|
- <result column="upload_time" property="uploadTime" />
|
|
|
- <result column="check_time" property="checkTime" />
|
|
|
- <result column="check_user_id" property="checkUserId" />
|
|
|
- <result column="objective_score" property="objectiveScore" />
|
|
|
- <result column="objective_score_list" property="objectiveScoreList" />
|
|
|
- <result column="subjective_status" property="subjectiveStatus" />
|
|
|
- <result column="subjective_score" property="subjectiveScore" />
|
|
|
- <result column="subjective_score_list" property="subjectiveScoreList" />
|
|
|
- <result column="college" property="college" />
|
|
|
- <result column="class_name" property="className" />
|
|
|
- <result column="teacher" property="teacher" />
|
|
|
- <result column="scan_status" property="scanStatus" />
|
|
|
- <result column="omr_absent_checked" property="omrAbsentChecked" />
|
|
|
- <result column="question_filled" property="questionFilled" />
|
|
|
- <result column="assigned" property="assigned" />
|
|
|
- <result column="absent_suspect" property="absentSuspect" />
|
|
|
- <result column="incomplete" property="incomplete" />
|
|
|
- <result column="breach_code" property="breachCode" />
|
|
|
- <result column="card_number" property="cardNumber" />
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="exam_id" property="examId"/>
|
|
|
+ <result column="course_code" property="courseCode"/>
|
|
|
+ <result column="course_name" property="courseName"/>
|
|
|
+ <result column="paper_number" property="paperNumber"/>
|
|
|
+ <result column="course_paper_id" property="coursePaperId"/>
|
|
|
+ <result column="secret_number" property="secretNumber"/>
|
|
|
+ <result column="student_code" property="studentCode"/>
|
|
|
+ <result column="student_name" property="studentName"/>
|
|
|
+ <result column="package_code" property="packageCode"/>
|
|
|
+ <result column="exam_place" property="examPlace"/>
|
|
|
+ <result column="exam_room" property="examRoom"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
+ <result column="batch_code" property="batchCode"/>
|
|
|
+ <result column="sheet_count" property="sheetCount"/>
|
|
|
+ <result column="answers" property="answers"/>
|
|
|
+ <result column="is_upload" property="upload"/>
|
|
|
+ <result column="is_absent" property="absent"/>
|
|
|
+ <result column="is_manual_absent" property="manualAbsent"/>
|
|
|
+ <result column="is_breach" property="breach"/>
|
|
|
+ <result column="upload_time" property="uploadTime"/>
|
|
|
+ <result column="check_time" property="checkTime"/>
|
|
|
+ <result column="check_user_id" property="checkUserId"/>
|
|
|
+ <result column="objective_score" property="objectiveScore"/>
|
|
|
+ <result column="objective_score_list" property="objectiveScoreList"/>
|
|
|
+ <result column="subjective_status" property="subjectiveStatus"/>
|
|
|
+ <result column="subjective_score" property="subjectiveScore"/>
|
|
|
+ <result column="subjective_score_list" property="subjectiveScoreList"/>
|
|
|
+ <result column="college" property="college"/>
|
|
|
+ <result column="class_name" property="className"/>
|
|
|
+ <result column="teacher" property="teacher"/>
|
|
|
+ <result column="scan_status" property="scanStatus"/>
|
|
|
+ <result column="omr_absent_checked" property="omrAbsentChecked"/>
|
|
|
+ <result column="question_filled" property="questionFilled"/>
|
|
|
+ <result column="assigned" property="assigned"/>
|
|
|
+ <result column="absent_suspect" property="absentSuspect"/>
|
|
|
+ <result column="incomplete" property="incomplete"/>
|
|
|
+ <result column="breach_code" property="breachCode"/>
|
|
|
+ <result column="card_number" property="cardNumber"/>
|
|
|
</resultMap>
|
|
|
<select id="pageStudentScore" resultType="com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto">
|
|
|
SELECT
|
|
|
- ms.id studentId,
|
|
|
- ms.exam_id examId,
|
|
|
- ms.course_code courseCode,
|
|
|
- ms.course_name courseName,
|
|
|
- ms.paper_number paperNumber,
|
|
|
- ms.student_name studentName,
|
|
|
- ms.student_code studentCode,
|
|
|
- ms.secret_number secretNumber,
|
|
|
- ms.college,
|
|
|
- ms.major_name majorName,
|
|
|
- ms.class_name className,
|
|
|
- ms.objective_score objectiveScore,
|
|
|
- ms.subjective_score subjectiveScore,
|
|
|
- ifnull(ms.objective_score, 0) + ifnull(ms.subjective_score, 0) totalScore,
|
|
|
- ms.objective_score_list objectiveScoreList,
|
|
|
- ms.subjective_score_list subjectiveScoreList,
|
|
|
- ms.check_user_id checkUserId,
|
|
|
- su.login_name checkUserLoginName,
|
|
|
- su.real_name checkUserName,
|
|
|
- ms.check_time checkTime,
|
|
|
- ms.sheet_path sheetPath,
|
|
|
- ms.exam_start_time examStartTime,
|
|
|
- ms.exam_end_time examEndTime,
|
|
|
- ms.scan_status scanStatus,
|
|
|
- ms.subjective_status subjectiveStatus,
|
|
|
- ms.is_absent absent,
|
|
|
- ms.omr_absent omrAbsent,
|
|
|
- ms.is_upload upload
|
|
|
+ ms.id studentId,
|
|
|
+ ms.exam_id examId,
|
|
|
+ ms.course_code courseCode,
|
|
|
+ ms.course_name courseName,
|
|
|
+ ms.paper_number paperNumber,
|
|
|
+ ms.student_name studentName,
|
|
|
+ ms.student_code studentCode,
|
|
|
+ ms.secret_number secretNumber,
|
|
|
+ ms.college,
|
|
|
+ ms.major_name majorName,
|
|
|
+ ms.class_name className,
|
|
|
+ ms.objective_score objectiveScore,
|
|
|
+ ms.subjective_score subjectiveScore,
|
|
|
+ ifnull(ms.objective_score, 0) + ifnull(ms.subjective_score, 0) totalScore,
|
|
|
+ ms.objective_score_list objectiveScoreList,
|
|
|
+ ms.subjective_score_list subjectiveScoreList,
|
|
|
+ ms.check_user_id checkUserId,
|
|
|
+ su.login_name checkUserLoginName,
|
|
|
+ su.real_name checkUserName,
|
|
|
+ ms.check_time checkTime,
|
|
|
+ ms.sheet_path sheetPath,
|
|
|
+ ms.exam_start_time examStartTime,
|
|
|
+ ms.exam_end_time examEndTime,
|
|
|
+ ms.scan_status scanStatus,
|
|
|
+ ms.subjective_status subjectiveStatus,
|
|
|
+ ms.is_absent absent,
|
|
|
+ ms.omr_absent omrAbsent,
|
|
|
+ ms.is_upload upload
|
|
|
FROM
|
|
|
- mark_student ms
|
|
|
- left join sys_user su on ms.check_user_id = su.id
|
|
|
+ mark_student ms
|
|
|
+ left join sys_user su on ms.check_user_id = su.id
|
|
|
where ms.exam_id = #{examId}
|
|
|
- AND ms.paper_number = #{paperNumber}
|
|
|
- <if test="college != null and college != ''">
|
|
|
- AND ms.college like concat(#{college}, '%')
|
|
|
- </if>
|
|
|
- <if test="majorName != null and majorName != ''">
|
|
|
- AND ms.major_name like concat(#{majorName}, '%')
|
|
|
- </if>
|
|
|
- <if test="className != null and className != ''">
|
|
|
- AND ms.class_name like concat(#{className}, '%')
|
|
|
- </if>
|
|
|
- <if test="teacher != null and teacher != ''">
|
|
|
- AND ms.teacher = #{teacher}
|
|
|
- </if>
|
|
|
- <if test="filter != null">
|
|
|
- <choose>
|
|
|
- <when test="filter == 1">
|
|
|
- AND ms.objective_score = 0
|
|
|
- </when>
|
|
|
- <when test="filter == 2">
|
|
|
- AND ms.objective_score = 0 AND ms.subjective_score > 0
|
|
|
- </when>
|
|
|
- <when test="filter == 3">
|
|
|
- AND ms.objective_score > 0 AND ms.subjective_score = 0
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- <choose>
|
|
|
- <when test="status == 'ABSENT'">
|
|
|
- AND (ms.is_absent = 1 OR ms.omr_absent = 1 OR ms.scan_status = 'MANUAL_ABSENT')
|
|
|
- </when>
|
|
|
- <when test="status == 'NORMAL'">
|
|
|
- AND (ms.is_absent = 0 and ms.omr_absent = 0 and ms.scan_status = 'SCANNED' AND ms.is_upload = 1)
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- AND (ms.scan_status = 'UNEXIST')
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="breach != null">
|
|
|
- AND ms.is_breach = #{breach}
|
|
|
- </if>
|
|
|
- <if test="startScore != null">
|
|
|
- <choose>
|
|
|
- <when test="startScore == 0">
|
|
|
- AND (ms.is_absent = 1 OR ms.is_breach = 1 OR ((ifnull(ms.subjective_score, 0) + ifnull(ms.objective_score, 0)) >= #{startScore} AND (ifnull(ms.subjective_score,0) + ifnull(ms.objective_score,0)) <= #{endScore}))
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- AND (ms.is_absent = 0 AND ms.is_breach = 0 AND ((ifnull(ms.subjective_score,0) + ifnull(ms.objective_score,0)) >= #{startScore} AND (ifnull(ms.subjective_score,0) + ifnull(ms.objective_score,0)) <= #{endScore}))
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="subScore != null">
|
|
|
- AND exists (SELECT 1 FROM mark_subjective_score mss WHERE ms.id = mss.student_id AND mss.score = #{subScore})
|
|
|
- </if>
|
|
|
- <if test="objectiveScoreLt != null">
|
|
|
- AND ms.objective_score < #{objectiveScoreLt}
|
|
|
- </if>
|
|
|
- <if test="studentName != null and studentName != ''">
|
|
|
- AND ms.student_name like concat(#{studentName}, '%')
|
|
|
- </if>
|
|
|
- <if test="studentCode != null and studentCode != ''">
|
|
|
- AND ms.student_code = #{studentCode}
|
|
|
- </if>
|
|
|
- <if test="orderType != null and orderType != '' and orderField != null and orderField != ''">
|
|
|
- <choose>
|
|
|
- <when test="orderField == 'totalScore'">
|
|
|
- <if test="orderType == 'ASC'">
|
|
|
- order by (ifnull(ms.objective_score, 0) + ifnull(ms.subjective_score, 0)) ASC
|
|
|
- </if>
|
|
|
- <if test="orderType == 'DESC'">
|
|
|
- order by (ifnull(ms.objective_score, 0) + ifnull(ms.subjective_score, 0)) DESC
|
|
|
- </if>
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- order by #{orderField} #{orderType}
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="orderType == null or orderType == '' or orderField == null or orderField == ''">
|
|
|
- order by ms.student_code
|
|
|
- </if>
|
|
|
+ AND ms.paper_number = #{paperNumber}
|
|
|
+ <if test="college != null and college != ''">
|
|
|
+ AND ms.college like concat(#{college}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="majorName != null and majorName != ''">
|
|
|
+ AND ms.major_name like concat(#{majorName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="className != null and className != ''">
|
|
|
+ AND ms.class_name like concat(#{className}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="teacher != null and teacher != ''">
|
|
|
+ AND ms.teacher = #{teacher}
|
|
|
+ </if>
|
|
|
+ <if test="filter != null">
|
|
|
+ <choose>
|
|
|
+ <when test="filter == 1">
|
|
|
+ AND ms.objective_score = 0
|
|
|
+ </when>
|
|
|
+ <when test="filter == 2">
|
|
|
+ AND ms.objective_score = 0 AND ms.subjective_score > 0
|
|
|
+ </when>
|
|
|
+ <when test="filter == 3">
|
|
|
+ AND ms.objective_score > 0 AND ms.subjective_score = 0
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ <choose>
|
|
|
+ <when test="status == 'ABSENT'">
|
|
|
+ AND (ms.is_absent = 1 OR ms.omr_absent = 1 OR ms.scan_status = 'MANUAL_ABSENT')
|
|
|
+ </when>
|
|
|
+ <when test="status == 'NORMAL'">
|
|
|
+ AND (ms.is_absent = 0 and ms.omr_absent = 0 and ms.scan_status = 'SCANNED' AND ms.is_upload = 1)
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND (ms.scan_status = 'UNEXIST')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="breach != null">
|
|
|
+ AND ms.is_breach = #{breach}
|
|
|
+ </if>
|
|
|
+ <if test="startScore != null">
|
|
|
+ <choose>
|
|
|
+ <when test="startScore == 0">
|
|
|
+ AND (ms.is_absent = 1 OR ms.is_breach = 1 OR ((ifnull(ms.subjective_score, 0) +
|
|
|
+ ifnull(ms.objective_score, 0)) >= #{startScore} AND (ifnull(ms.subjective_score,0) +
|
|
|
+ ifnull(ms.objective_score,0)) <= #{endScore}))
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND (ms.is_absent = 0 AND ms.is_breach = 0 AND ((ifnull(ms.subjective_score,0) +
|
|
|
+ ifnull(ms.objective_score,0)) >= #{startScore} AND (ifnull(ms.subjective_score,0) +
|
|
|
+ ifnull(ms.objective_score,0)) <= #{endScore}))
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="subScore != null">
|
|
|
+ AND exists (SELECT 1 FROM mark_subjective_score mss WHERE ms.id = mss.student_id AND mss.score =
|
|
|
+ #{subScore})
|
|
|
+ </if>
|
|
|
+ <if test="objectiveScoreLt != null">
|
|
|
+ AND ms.objective_score < #{objectiveScoreLt}
|
|
|
+ </if>
|
|
|
+ <if test="studentName != null and studentName != ''">
|
|
|
+ AND ms.student_name like concat(#{studentName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="studentCode != null and studentCode != ''">
|
|
|
+ AND ms.student_code = #{studentCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null and orderType != '' and orderField != null and orderField != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="orderField == 'totalScore'">
|
|
|
+ <if test="orderType == 'ASC'">
|
|
|
+ order by (ifnull(ms.objective_score, 0) + ifnull(ms.subjective_score, 0)) ASC
|
|
|
+ </if>
|
|
|
+ <if test="orderType == 'DESC'">
|
|
|
+ order by (ifnull(ms.objective_score, 0) + ifnull(ms.subjective_score, 0)) DESC
|
|
|
+ </if>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ order by #{orderField} #{orderType}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="orderType == null or orderType == '' or orderField == null or orderField == ''">
|
|
|
+ order by ms.student_code
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="listAbsentOrBreachMarkTaskStudent" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM
|
|
|
- mark_student ms
|
|
|
- WHERE
|
|
|
- ms.exam_id = #{examId} AND ms.paper_number = #{paperNumber}
|
|
|
+ SELECT *
|
|
|
+ FROM mark_student ms
|
|
|
+ WHERE ms.exam_id = #{examId}
|
|
|
+ AND ms.paper_number = #{paperNumber}
|
|
|
AND ms.is_upload = TRUE
|
|
|
AND (is_absent = TRUE OR is_breach = TRUE OR omr_absent = TRUE)
|
|
|
- AND EXISTS( SELECT
|
|
|
- 1
|
|
|
- FROM
|
|
|
- mark_task mt
|
|
|
- WHERE
|
|
|
- ms.id = mt.student_id)
|
|
|
+ AND EXISTS(SELECT 1
|
|
|
+ FROM mark_task mt
|
|
|
+ WHERE ms.id = mt.student_id)
|
|
|
</select>
|
|
|
<select id="listUnMarkTaskStudent" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM
|
|
|
- mark_student ms
|
|
|
- WHERE
|
|
|
- ms.exam_id = #{examId} AND ms.paper_number = #{paperNumber}
|
|
|
+ SELECT *
|
|
|
+ FROM mark_student ms
|
|
|
+ WHERE ms.exam_id = #{examId}
|
|
|
+ AND ms.paper_number = #{paperNumber}
|
|
|
AND ms.is_upload = TRUE
|
|
|
AND is_absent = FALSE
|
|
|
AND is_breach = FALSE
|
|
|
AND omr_absent = FALSE
|
|
|
- AND NOT EXISTS( SELECT
|
|
|
- 1
|
|
|
- FROM
|
|
|
- mark_task mt
|
|
|
- WHERE
|
|
|
- ms.id = mt.student_id
|
|
|
- AND mt.group_number = #{groupNumber})
|
|
|
+ AND NOT EXISTS(SELECT 1
|
|
|
+ FROM mark_task mt
|
|
|
+ WHERE ms.id = mt.student_id
|
|
|
+ AND mt.group_number = #{groupNumber})
|
|
|
</select>
|
|
|
- <sql id="queryWhereAndOrder">
|
|
|
+ <sql id="queryWhereAndOrder">
|
|
|
where t.exam_id=#{query.examId}
|
|
|
<if test="query.studentId != null and query.studentId !=''">
|
|
|
and t.id=#{query.studentId}
|
|
@@ -229,10 +224,10 @@
|
|
|
<if test="query.examPlace != null and query.examPlace !=''">
|
|
|
and t.exam_place=#{query.examPlace}
|
|
|
</if>
|
|
|
- <if test="query.examRoom != null and query.examRoom !=''">
|
|
|
+ <if test="query.examRoom != null and query.examRoom !=''">
|
|
|
and t.exam_room=#{query.examRoom}
|
|
|
</if>
|
|
|
-
|
|
|
+
|
|
|
<if test="query.absentSuspect != null">
|
|
|
and t.absent_suspect=#{query.absentSuspect}
|
|
|
</if>
|
|
@@ -248,6 +243,9 @@
|
|
|
<if test="query.assignConfirmed != null">
|
|
|
and t.assign_confirmed=#{query.assignConfirmed}
|
|
|
</if>
|
|
|
+ <if test="query.invalid != null">
|
|
|
+ and t.invalid=#{query.invalid}
|
|
|
+ </if>
|
|
|
<if test="query.incomplete != null">
|
|
|
and t.incomplete=#{query.incomplete}
|
|
|
</if>
|
|
@@ -289,7 +287,10 @@
|
|
|
order by t.id
|
|
|
</select>
|
|
|
<select id="findIdByExamIdAndPaperNumber" resultType="java.lang.Long">
|
|
|
- select id from mark_student where exam_id = #{examId} and paper_number = #{paperNumber}
|
|
|
+ select id
|
|
|
+ from mark_student
|
|
|
+ where exam_id = #{examId}
|
|
|
+ and paper_number = #{paperNumber}
|
|
|
</select>
|
|
|
<select id="studentList"
|
|
|
resultType="com.qmth.teachcloud.mark.bean.archivescore.ArchiveStudentVo">
|
|
@@ -327,10 +328,10 @@
|
|
|
<choose>
|
|
|
<when test="req.orderField == 'totalScore'">
|
|
|
<if test="req.orderType == 'ASC'">
|
|
|
- order by (ifnull(t.objective_score, 0) + ifnull(t.subjective_score, 0)) ASC
|
|
|
+ order by (ifnull(t.objective_score, 0) + ifnull(t.subjective_score, 0)) ASC
|
|
|
</if>
|
|
|
<if test="req.orderType == 'DESC'">
|
|
|
- order by (ifnull(t.objective_score, 0) + ifnull(t.subjective_score, 0)) DESC
|
|
|
+ order by (ifnull(t.objective_score, 0) + ifnull(t.subjective_score, 0)) DESC
|
|
|
</if>
|
|
|
</when>
|
|
|
<otherwise>
|
|
@@ -343,89 +344,106 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="overview" resultType="com.qmth.teachcloud.mark.bean.archivescore.OverViewVo">
|
|
|
- SELECT
|
|
|
- count(*) studentCount,
|
|
|
- sum(case when s.is_absent =0 and s.omr_absent =0 and s.is_breach = 0 and s.is_upload = 1 then 1 else 0 end) actualCount,
|
|
|
- sum(case when s.is_absent =1 or s.omr_absent =1 then 1 else 0 end) absentCount,
|
|
|
- sum(case when s.is_breach =1 then 1 else 0 end) breachCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
|
|
|
+ SELECT count(*) studentCount,
|
|
|
+ sum(case
|
|
|
+ when s.is_absent = 0 and s.omr_absent = 0 and s.is_breach = 0 and s.is_upload = 1 then 1
|
|
|
+ else 0 end) actualCount,
|
|
|
+ sum(case when s.is_absent = 1 or s.omr_absent = 1 then 1 else 0 end) absentCount,
|
|
|
+ sum(case when s.is_breach = 1 then 1 else 0 end) breachCount,
|
|
|
+ avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ else 0 end) passCount,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
- left join mark_paper t on s.exam_id = t.exam_id
|
|
|
- and s.paper_number = t.paper_number
|
|
|
- and s.paper_type = t.paper_type
|
|
|
- WHERE
|
|
|
- s.exam_id = #{examId} and s.paper_number = #{paperNumber}
|
|
|
+ left join mark_paper t on s.exam_id = t.exam_id
|
|
|
+ and s.paper_number = t.paper_number
|
|
|
+ and s.paper_type = t.paper_type
|
|
|
+ WHERE s.exam_id = #{examId}
|
|
|
+ and s.paper_number = #{paperNumber}
|
|
|
</select>
|
|
|
<select id="getCountByScoreRange" resultType="int">
|
|
|
- SELECT
|
|
|
- count(*)
|
|
|
- FROM mark_student s
|
|
|
- WHERE
|
|
|
- s.exam_id = #{examId} and s.paper_number = #{paperNumber}
|
|
|
- and s.is_absent !=1 and s.objective_score+s.subjective_score>=#{start}
|
|
|
- and s.objective_score+s.subjective_score<=#{end}
|
|
|
+ SELECT count(*)
|
|
|
+ FROM mark_student s
|
|
|
+ WHERE s.exam_id = #{examId}
|
|
|
+ and s.paper_number = #{paperNumber}
|
|
|
+ and s.is_absent !=1 and s.objective_score+s.subjective_score>=#{start}
|
|
|
+ and s.objective_score+s.subjective_score<=#{end}
|
|
|
</select>
|
|
|
<select id="college" resultType="com.qmth.teachcloud.mark.bean.archivescore.CollegeVo">
|
|
|
- SELECT
|
|
|
- s.college,
|
|
|
- count(*) studentCount,
|
|
|
- sum(case when s.is_absent =1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
|
|
|
+ SELECT s.college,
|
|
|
+ count(*) studentCount,
|
|
|
+ sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
+ avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ else 0 end) passCount,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
|
and s.paper_number = t.paper_number
|
|
|
and s.paper_type = t.paper_type
|
|
|
- WHERE
|
|
|
- s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.college is not null
|
|
|
+ WHERE s.exam_id = #{examId}
|
|
|
+ and s.paper_number = #{paperNumber}
|
|
|
+ and s.college is not null
|
|
|
group by s.college
|
|
|
</select>
|
|
|
<select id="classData" resultType="com.qmth.teachcloud.mark.bean.archivescore.ClassVo">
|
|
|
- SELECT
|
|
|
- s.class_name,
|
|
|
- count(*) studentCount,
|
|
|
- sum(case when s.is_absent =1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
|
|
|
+ SELECT s.class_name,
|
|
|
+ count(*) studentCount,
|
|
|
+ sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
+ avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ else 0 end) passCount,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
|
and s.paper_number = t.paper_number
|
|
|
and s.paper_type = t.paper_type
|
|
|
- WHERE
|
|
|
- s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.class_name is not null
|
|
|
+ WHERE s.exam_id = #{examId}
|
|
|
+ and s.paper_number = #{paperNumber}
|
|
|
+ and s.class_name is not null
|
|
|
group by s.class_name
|
|
|
</select>
|
|
|
<select id="teacher" resultType="com.qmth.teachcloud.mark.bean.archivescore.TeacherVo">
|
|
|
- SELECT
|
|
|
- s.teacher,
|
|
|
- count(*) studentCount,
|
|
|
- sum(case when s.is_absent =1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
|
|
|
+ SELECT s.teacher,
|
|
|
+ count(*) studentCount,
|
|
|
+ sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
+ avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ else 0 end) passCount,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
|
and s.paper_number = t.paper_number
|
|
|
and s.paper_type = t.paper_type
|
|
|
- WHERE
|
|
|
- s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.teacher is not null
|
|
|
+ WHERE s.exam_id = #{examId}
|
|
|
+ and s.paper_number = #{paperNumber}
|
|
|
+ and s.teacher is not null
|
|
|
group by s.teacher
|
|
|
</select>
|
|
|
<select id="findOne" resultType="com.qmth.teachcloud.mark.bean.student.StudentVo"
|
|
|
parameterType="com.qmth.teachcloud.mark.bean.student.StudentQuery">
|
|
|
- select * from mark_student
|
|
|
+ select *
|
|
|
+ from mark_student
|
|
|
where exam_id = #{query.examId}
|
|
|
and course_paper_id = #{query.coursePaperId}
|
|
|
and student_code = #{query.studentCode}
|
|
@@ -433,55 +451,60 @@
|
|
|
<select id="listUnexistStudentByExamIdAndCoursePaperId"
|
|
|
resultType="com.qmth.teachcloud.mark.dto.UnexistStudentDto">
|
|
|
SELECT
|
|
|
- t.course_code courseCode,
|
|
|
- t.course_name courseName,
|
|
|
- t.paper_number paperNumber,
|
|
|
- t.student_code studentCode,
|
|
|
- t.student_name studentName
|
|
|
+ t.course_code courseCode,
|
|
|
+ t.course_name courseName,
|
|
|
+ t.paper_number paperNumber,
|
|
|
+ t.student_code studentCode,
|
|
|
+ t.student_name studentName
|
|
|
FROM
|
|
|
- mark_student t left join sys_user su on t.create_id = su.id
|
|
|
+ mark_student t left join sys_user su on t.create_id = su.id
|
|
|
WHERE
|
|
|
- t.exam_id = #{examId}
|
|
|
- AND t.scan_status = 'UNEXIST'
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and t.course_code = #{courseCode}
|
|
|
- </if>
|
|
|
- <if test="coursePaperId != null and coursePaperId != ''">
|
|
|
- and t.course_paper_id = #{coursePaperId}
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- and exists(select 1 from mark_paper mp where t.exam_id = mp.exam_id and t.course_paper_id = mp.course_paper_id and t.paper_type = mp.paper_type and mp.status = #{status})
|
|
|
+ t.exam_id = #{examId}
|
|
|
+ AND t.scan_status = 'UNEXIST'
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and t.course_code = #{courseCode}
|
|
|
+ </if>
|
|
|
+ <if test="coursePaperId != null and coursePaperId != ''">
|
|
|
+ and t.course_paper_id = #{coursePaperId}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ and exists(select 1 from mark_paper mp where t.exam_id = mp.exam_id and t.course_paper_id =
|
|
|
+ mp.course_paper_id and t.paper_type = mp.paper_type and mp.status = #{status})
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND t.create_id = #{dpr.requestUserId}
|
|
|
</if>
|
|
|
- <if test="dpr != null">
|
|
|
- <if test="dpr.requestUserId != null">
|
|
|
- AND t.create_id = #{dpr.requestUserId}
|
|
|
- </if>
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
- AND su.org_id IN
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND su.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
+ </if>
|
|
|
order by t.student_code
|
|
|
</select>
|
|
|
<select id="teacherClass" resultType="com.qmth.teachcloud.mark.bean.archivescore.TeacherClassVo">
|
|
|
- SELECT
|
|
|
- s.teacher,
|
|
|
- s.class_name,
|
|
|
- count(*) studentCount,
|
|
|
- sum(case when s.is_absent =1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
|
|
|
- sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
|
|
|
+ SELECT s.teacher,
|
|
|
+ s.class_name,
|
|
|
+ count(*) studentCount,
|
|
|
+ sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
+ avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ else 0 end) passCount,
|
|
|
+ sum(case
|
|
|
+ when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
|
and s.paper_number = t.paper_number
|
|
|
and s.paper_type = t.paper_type
|
|
|
- WHERE
|
|
|
- s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.class_name is not null
|
|
|
+ WHERE s.exam_id = #{examId}
|
|
|
+ and s.paper_number = #{paperNumber}
|
|
|
+ and s.class_name is not null
|
|
|
group by s.teacher, s.class_name
|
|
|
</select>
|
|
|
<select id="selectCountByQuery" resultType="java.lang.Integer">
|
|
@@ -524,7 +547,8 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="markStudent.markPaperStatus != null">
|
|
|
- AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number = mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{markStudent.markPaperStatus})
|
|
|
+ AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number =
|
|
|
+ mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{markStudent.markPaperStatus})
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
@@ -532,8 +556,8 @@
|
|
|
SELECT
|
|
|
count(1)
|
|
|
FROM
|
|
|
- mark_student ms
|
|
|
- LEFT JOIN sys_user su ON ms.create_id = su.id
|
|
|
+ mark_student ms
|
|
|
+ LEFT JOIN sys_user su ON ms.create_id = su.id
|
|
|
<where>
|
|
|
ms.exam_id = #{markStudent.examId}
|
|
|
<if test="markStudent.courseCode != null">
|
|
@@ -560,7 +584,8 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="markStudent.markPaperStatus != null">
|
|
|
- AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number = mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{markStudent.markPaperStatus})
|
|
|
+ AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number =
|
|
|
+ mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{markStudent.markPaperStatus})
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
@@ -591,7 +616,8 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
- AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number = mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{status})
|
|
|
+ AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number =
|
|
|
+ mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{status})
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|