|
@@ -4,7 +4,7 @@
|
|
namespace="com.qmth.themis.business.dao.TOeExamRecordMapper">
|
|
namespace="com.qmth.themis.business.dao.TOeExamRecordMapper">
|
|
|
|
|
|
<sql id="invigilatePageHead">
|
|
<sql id="invigilatePageHead">
|
|
- select distinct t.exam_id examId,
|
|
|
|
|
|
+ select t.exam_id examId,
|
|
tee.name as examName,
|
|
tee.name as examName,
|
|
t.exam_activity_id examActivityId,
|
|
t.exam_activity_id examActivityId,
|
|
teea.code as examActivityCode,
|
|
teea.code as examActivityCode,
|
|
@@ -30,15 +30,14 @@
|
|
|
|
|
|
<sql id="invigilatePageMiddle">
|
|
<sql id="invigilatePageMiddle">
|
|
from t_oe_exam_record t
|
|
from t_oe_exam_record t
|
|
- left join t_e_exam_student s on t.exam_student_id = s.id
|
|
|
|
|
|
+ left join t_e_exam_student s on t.id = s.current_record_id or s.already_exam_count > 0
|
|
left join t_e_exam tee on tee.id = t.exam_id
|
|
left join t_e_exam tee on tee.id = t.exam_id
|
|
left join t_e_exam_activity teea on teea.id = t.exam_activity_id
|
|
left join t_e_exam_activity teea on teea.id = t.exam_activity_id
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.admin.InvigilateListVideoBean">
|
|
<select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.admin.InvigilateListVideoBean">
|
|
select (@i := @i + 1) as seq,t.* from(
|
|
select (@i := @i + 1) as seq,t.* from(
|
|
- select
|
|
|
|
- distinct s.exam_id as examId,
|
|
|
|
|
|
+ select s.exam_id as examId,
|
|
tee.name as examName,
|
|
tee.name as examName,
|
|
s.exam_activity_id as examActivityId,
|
|
s.exam_activity_id as examActivityId,
|
|
teea.code as examActivityCode,
|
|
teea.code as examActivityCode,
|
|
@@ -72,7 +71,7 @@
|
|
<if test="userId != null and userId != ''">
|
|
<if test="userId != null and userId != ''">
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
|
|
</if>
|
|
</if>
|
|
- left join t_oe_exam_record toer on toer.exam_student_id = s.id
|
|
|
|
|
|
+ left join t_oe_exam_record toer on toer.id = s.current_record_id or s.already_exam_count > 0
|
|
WHERE 1 = 1
|
|
WHERE 1 = 1
|
|
<if test="examId != null and examId != ''">
|
|
<if test="examId != null and examId != ''">
|
|
and s.exam_id = #{examId}
|
|
and s.exam_id = #{examId}
|
|
@@ -141,9 +140,9 @@
|
|
<if test="mobileSecondMonitorStatus != null and mobileSecondMonitorStatus != ''">
|
|
<if test="mobileSecondMonitorStatus != null and mobileSecondMonitorStatus != ''">
|
|
and toer.mobile_second_monitor_status = upper(#{mobileSecondMonitorStatus})
|
|
and toer.mobile_second_monitor_status = upper(#{mobileSecondMonitorStatus})
|
|
</if>
|
|
</if>
|
|
|
|
+ order by s.identity desc
|
|
) t,
|
|
) t,
|
|
(SELECT @i := 0) as i
|
|
(SELECT @i := 0) as i
|
|
- order by t.identity desc
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="invigilatePageListVideoRandom" resultType="com.qmth.themis.business.bean.admin.InvigilateListVideoBean">
|
|
<select id="invigilatePageListVideoRandom" resultType="com.qmth.themis.business.bean.admin.InvigilateListVideoBean">
|
|
@@ -158,7 +157,7 @@
|
|
<if test="orgId != null and orgId != ''">
|
|
<if test="orgId != null and orgId != ''">
|
|
and tee.org_id = #{orgId}
|
|
and tee.org_id = #{orgId}
|
|
</if>
|
|
</if>
|
|
- and ((toer.status = 'FIRST_PREPARE' and toer.client_websocket_status = 'ON_LINE') or toer.status in ('ANSWERING', 'BREAK_OFF', 'RESUME_PREPARE'))
|
|
|
|
|
|
+ and ((t.status = 'FIRST_PREPARE' and t.client_websocket_status = 'ON_LINE') or t.status in ('ANSWERING', 'BREAK_OFF', 'RESUME_PREPARE'))
|
|
</where>
|
|
</where>
|
|
ORDER BY RAND() LIMIT #{randomNum}
|
|
ORDER BY RAND() LIMIT #{randomNum}
|
|
</select>
|
|
</select>
|
|
@@ -273,8 +272,7 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="invigilatePageWarningList" resultType="com.qmth.themis.business.bean.admin.InvigilateListWarningBean">
|
|
<select id="invigilatePageWarningList" resultType="com.qmth.themis.business.bean.admin.InvigilateListWarningBean">
|
|
- select (@i := @i + 1) as seq,t.* from(select
|
|
|
|
- distinct
|
|
|
|
|
|
+ select (@i := @i + 1) as seq,t.* from(select distinct
|
|
tee.id as examId,
|
|
tee.id as examId,
|
|
tee.name as examName,
|
|
tee.name as examName,
|
|
teea.id as examActivityId,
|
|
teea.id as examActivityId,
|
|
@@ -294,11 +292,11 @@
|
|
tiiwi.approve_status as approveStatus,
|
|
tiiwi.approve_status as approveStatus,
|
|
IFNULL(toer.exception_count,0) as exceptionCount,
|
|
IFNULL(toer.exception_count,0) as exceptionCount,
|
|
IFNULL(toer.warning_multiple_face_count,0) as multipleFaceCount
|
|
IFNULL(toer.warning_multiple_face_count,0) as multipleFaceCount
|
|
- from t_ie_invigilate_warn_info tiiwi
|
|
|
|
|
|
+ from t_e_exam_student tees
|
|
|
|
+ left join t_ie_invigilate_warn_info tiiwi on tees.id = tiiwi.exam_student_id
|
|
left join t_e_exam tee on tee.id = tiiwi.exam_id
|
|
left join t_e_exam tee on tee.id = tiiwi.exam_id
|
|
left join t_e_exam_activity teea on teea.id = tiiwi.exam_activity_id
|
|
left join t_e_exam_activity teea on teea.id = tiiwi.exam_activity_id
|
|
- left join t_oe_exam_record toer on toer.id = tiiwi.exam_record_id
|
|
|
|
- left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
|
|
|
|
|
|
+ left join t_oe_exam_record toer on toer.id = tiiwi.exam_record_id and (toer.id = tees.current_record_id or tees.already_exam_count > 0)
|
|
<if test="userId != null and userId != ''">
|
|
<if test="userId != null and userId != ''">
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
|
|
</if>
|
|
</if>
|
|
@@ -496,7 +494,7 @@
|
|
|
|
|
|
<select id="invigilatePageProgressListExport"
|
|
<select id="invigilatePageProgressListExport"
|
|
resultType="com.qmth.themis.business.bean.admin.InvigilateListProgressExcelBean">
|
|
resultType="com.qmth.themis.business.bean.admin.InvigilateListProgressExcelBean">
|
|
- select distinct tee.id as examId,
|
|
|
|
|
|
+ select tee.id as examId,
|
|
tee.name as examName,
|
|
tee.name as examName,
|
|
teea.id as examActivityId,
|
|
teea.id as examActivityId,
|
|
teea.code as examActivityCode,
|
|
teea.code as examActivityCode,
|
|
@@ -519,7 +517,7 @@
|
|
left join t_e_exam_activity teea on
|
|
left join t_e_exam_activity teea on
|
|
teea.id = tees.exam_activity_id
|
|
teea.id = tees.exam_activity_id
|
|
left join t_e_student tes on tees.student_id = tes.id
|
|
left join t_e_student tes on tees.student_id = tes.id
|
|
- left join t_oe_exam_record t on t.exam_id = tees.exam_id and t.exam_activity_id = tees.exam_activity_id and
|
|
|
|
|
|
+ left join t_oe_exam_record t on t.id = tees.current_record_id or tees.already_exam_count > 0
|
|
t.exam_student_id = tees.id
|
|
t.exam_student_id = tees.id
|
|
<if test="userId != null and userId != ''">
|
|
<if test="userId != null and userId != ''">
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
|
|
@@ -579,8 +577,7 @@
|
|
|
|
|
|
<sql id="invigilatePageListHistorySql">
|
|
<sql id="invigilatePageListHistorySql">
|
|
select (@i := @i + 1) as seq,t.* from(
|
|
select (@i := @i + 1) as seq,t.* from(
|
|
- select
|
|
|
|
- distinct s.exam_id as examId,
|
|
|
|
|
|
+ select s.exam_id as examId,
|
|
tee.name as examName,
|
|
tee.name as examName,
|
|
s.exam_activity_id as examActivityId,
|
|
s.exam_activity_id as examActivityId,
|
|
teea.code as examActivityCode,
|
|
teea.code as examActivityCode,
|
|
@@ -615,7 +612,7 @@
|
|
teea.id = s.exam_activity_id
|
|
teea.id = s.exam_activity_id
|
|
left join t_e_student tes on
|
|
left join t_e_student tes on
|
|
s.student_id = tes.id
|
|
s.student_id = tes.id
|
|
- left join t_oe_exam_record toer on toer.exam_student_id = s.id
|
|
|
|
|
|
+ left join t_oe_exam_record toer on toer.id = s.current_record_id or s.already_exam_count > 0
|
|
<if test="userId != null and userId != ''">
|
|
<if test="userId != null and userId != ''">
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
|
|
left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
|
|
</if>
|
|
</if>
|