|
@@ -383,46 +383,29 @@
|
|
|
|
|
|
<sql id="markResultCommon">
|
|
|
select
|
|
|
- t.examActivityCode,
|
|
|
- t.name,
|
|
|
- t.identity,
|
|
|
- t.courseCode,
|
|
|
- t.courseName,
|
|
|
- t.roomCode,
|
|
|
- t.roomName,
|
|
|
- t.grade,
|
|
|
- t.classNo,
|
|
|
- if(t.examCount <![CDATA[ <= ]]> 0,'是','否') as examAbsent,
|
|
|
- t.examCount,
|
|
|
- t.examName,
|
|
|
- if(t.breachCount is null,0,t.breachCount) as breachCount,
|
|
|
- ifnull(t.objectiveScore,0) as objectiveScore,
|
|
|
- t.examId,
|
|
|
- t.examActivityId,
|
|
|
- t.subjectiveScore,
|
|
|
- (t.objectiveScore + t.subjectiveScore) as sumScore,
|
|
|
- t.examStudentId
|
|
|
- from
|
|
|
- (
|
|
|
- select tees.id as examStudentId,tee.id as examId,tee.name as examName,teea.id as examActivityId, teea.code as examActivityCode, tes.name, tes.`identity`, tees.course_code as courseCode, tees.course_name as courseName, tees.room_code as roomCode, tees.room_name as roomName, tees.grade, tees.class_no as classNo, (
|
|
|
- select
|
|
|
- count(1)
|
|
|
- from
|
|
|
- t_oe_exam_record toer
|
|
|
- where
|
|
|
- toer.exam_student_id = tees.id and toer.first_start_time is not null) as examCount,
|
|
|
- (select count(toer.id) from t_oe_exam_record toer
|
|
|
- where toer.exam_student_id = tees.id and toer.breach_status = 0) as breachCount,
|
|
|
- 0 as objectiveScore,
|
|
|
- 0 as subjectiveScore
|
|
|
+ tees.id as examStudentId,
|
|
|
+ tee.id as examId,
|
|
|
+ tee.name as examName,
|
|
|
+ teea.id as examActivityId,
|
|
|
+ teea.code as examActivityCode,
|
|
|
+ tes.name,
|
|
|
+ tes.`identity`,
|
|
|
+ tees.course_code as courseCode,
|
|
|
+ tees.course_name as courseName,
|
|
|
+ tees.room_code as roomCode,
|
|
|
+ tees.room_name as roomName,
|
|
|
+ tees.grade,
|
|
|
+ tees.class_no as classNo,
|
|
|
+ count(toer1.id) as examCount,
|
|
|
+ count(toer2.id) as breachCount,
|
|
|
+ if(count(toer1.id) <![CDATA[ <= ]]> 0,'是','否') as examAbsent
|
|
|
from
|
|
|
t_e_student tes
|
|
|
- left join t_e_exam_student tees on
|
|
|
- tees.student_id = tes.id
|
|
|
- left join t_e_exam tee on
|
|
|
- tee.id = tees.exam_id
|
|
|
- left join t_e_exam_activity teea on
|
|
|
- teea.id = tees.exam_activity_id
|
|
|
+ left join t_e_exam_student tees on tees.student_id = tes.id
|
|
|
+ left join t_e_exam tee on tee.id = tees.exam_id
|
|
|
+ left join t_e_exam_activity teea on teea.id = tees.exam_activity_id
|
|
|
+ left join t_oe_exam_record toer1 on toer1.exam_student_id = tees.id and toer1.first_start_time is not null
|
|
|
+ left join t_oe_exam_record toer2 on toer2.exam_student_id = tees.id and toer2.breach_status = 0
|
|
|
<where>
|
|
|
<if test="examId != null and examId != ''">
|
|
|
and tee.id = #{examId}
|
|
@@ -439,7 +422,22 @@
|
|
|
<if test="courseCode != null and courseCode != ''">
|
|
|
and tees.course_code = #{courseCode}
|
|
|
</if>
|
|
|
- </where> ) t order by t.examStudentId
|
|
|
+ </where>
|
|
|
+ group by
|
|
|
+ tees.id,
|
|
|
+ tee.id,
|
|
|
+ tee.name,
|
|
|
+ teea.id,
|
|
|
+ teea.code,
|
|
|
+ tes.name,
|
|
|
+ tes.`identity`,
|
|
|
+ tees.course_code,
|
|
|
+ tees.course_name,
|
|
|
+ tees.room_code,
|
|
|
+ tees.room_name,
|
|
|
+ tees.grade,
|
|
|
+ tees.class_no
|
|
|
+ order by tees.id
|
|
|
</sql>
|
|
|
|
|
|
<select id="markResultQuery" resultType="com.qmth.themis.business.dto.response.MarkResultDto">
|