Przeglądaj źródła

管理员统计修改

wangliang 1 rok temu
rodzic
commit
bf4064f05a

+ 4 - 4
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -97,17 +97,17 @@
         t.exam_activity_id examActivityId,
         t.room_code roomCode,
         t.room_name roomName,
-        count(1) examTotal,
+        count(distinct t.id) examTotal,
         teea.code as examActivityCode,
         tee.monitor_status as monitorStatus,
-        count(toer.exam_student_id) as actualExamTotal,
-        if(teea.finish_time <![CDATA[ <= ]]> (unix_timestamp(current_timestamp()) * 1000),count(1)- count(distinct toer.exam_student_id),0) as deficiencyExamTotal,
+        count(distinct toer.exam_student_id) as actualExamTotal,
+        if(teea.finish_time <![CDATA[ <= ]]> (unix_timestamp(current_timestamp()) * 1000),count(distinct t.id) - count(distinct toer.exam_student_id),0) as deficiencyExamTotal,
         CONCAT(t.room_name,'(',t.room_code,')') as roomNameCode
         from t_e_exam_student t
         left join t_e_student h on t.student_id = h.id
         left join t_e_exam_activity teea on teea.id = t.exam_activity_id
         join t_e_exam tee on tee.id = t.exam_id
-        left join t_oe_exam_record toer on toer.exam_student_id = t.id and toer.exam_id = tee.id and toer.exam_activity_id = teea.id and toer.first_start_time is not null
+        left join t_oe_exam_record toer on toer.exam_student_id = t.id and toer.first_start_time is not null
         where t.exam_id = #{examId}
         <if test="orgId != null">
             and h.org_id=#{orgId}