|
@@ -1,401 +1,446 @@
|
|
|
<?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.themis.business.dao.TOeExamRecordMapper">
|
|
|
+ namespace="com.qmth.themis.business.dao.TOeExamRecordMapper">
|
|
|
|
|
|
- <select id="getUnFinishExam"
|
|
|
- resultType="com.qmth.themis.business.dto.response.TEExamUnFinishDto">
|
|
|
- select
|
|
|
- tee.id,
|
|
|
- teea.id as examActivityId,
|
|
|
- toer.id as recordId,
|
|
|
- tees.id as
|
|
|
- examStudentId,
|
|
|
- tee.name,
|
|
|
- tee.mode,
|
|
|
- tee.pre_notice as preNotice,
|
|
|
- tee.pre_notice_stay_seconds as preNoticeStaySeconds,
|
|
|
- tee.post_notice as
|
|
|
- postNotice,
|
|
|
- tee.code as examCode,
|
|
|
- teea.code as examActivityCode,
|
|
|
- tee.start_time as examStartTime,
|
|
|
- tee.end_time as examEndTime,
|
|
|
- teea.start_time as examActivityStartTime,
|
|
|
- teea.finish_time as
|
|
|
- examActivityFinishTime,
|
|
|
- tees.course_code as courseCode,
|
|
|
- teec.course_name as courseName,
|
|
|
- tee.prepare_seconds as prepareSeconds,
|
|
|
- tee.min_duration_seconds as minDurationSeconds,
|
|
|
- tee.max_duration_seconds as maxDurationSeconds,
|
|
|
- tee.exam_count as
|
|
|
- examCount,
|
|
|
- tee.force_finish as fouceFinish,
|
|
|
- tee.entry_authentication_policy as entryAuthenticationPolicy,
|
|
|
- tee.in_process_face_verify as inProcessFaceVerify,
|
|
|
- tee.in_process_face_stranger_ignore as inProcessFaceStrangerIgnore,
|
|
|
- tee.in_process_liveness_verify as inProcessLivenessVerify,
|
|
|
- tee.in_process_liveness_fixed_range as inProcessLivenessFixedRange,
|
|
|
- tee.in_process_liveness_judge_policy as inProcessLivenessJudgePolicy,
|
|
|
- tee.camera_photo_upload as cameraPhotoUpload,
|
|
|
- tee.mobile_photo_upload
|
|
|
- as mobilePhotoUpload,
|
|
|
- tee.break_expire_seconds as breakExpireSeconds,
|
|
|
- tee.break_resume_count as breakResumeCount,
|
|
|
- toer.duration_seconds as
|
|
|
- durationSeconds,
|
|
|
- toer.client_last_sync_time as clientLastSyncTime
|
|
|
- from
|
|
|
- t_oe_exam_record toer
|
|
|
- left join t_e_exam_student tees on
|
|
|
- tees.id =
|
|
|
- toer.exam_student_id
|
|
|
- left join t_e_exam_course teec on
|
|
|
- teec.course_code
|
|
|
- = tees.course_code
|
|
|
- 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
|
|
|
- <where>
|
|
|
- <if test="studentId != null and studentId != ''">
|
|
|
- and tees.student_id = #{studentId}
|
|
|
- </if>
|
|
|
- and tee.enable = 1
|
|
|
- and teea.enable = 1
|
|
|
- and tees.enable = 1
|
|
|
- <if test="orgId != null and orgId != ''">
|
|
|
- and tee.org_id = #{orgId}
|
|
|
- </if>
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and tee.id = #{examId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
+ <select id="getUnFinishExam"
|
|
|
+ resultType="com.qmth.themis.business.dto.response.TEExamUnFinishDto">
|
|
|
+ select
|
|
|
+ tee.id,
|
|
|
+ teea.id as examActivityId,
|
|
|
+ toer.id as recordId,
|
|
|
+ tees.id as
|
|
|
+ examStudentId,
|
|
|
+ tee.name,
|
|
|
+ tee.mode,
|
|
|
+ tee.pre_notice as preNotice,
|
|
|
+ tee.pre_notice_stay_seconds as preNoticeStaySeconds,
|
|
|
+ tee.post_notice as
|
|
|
+ postNotice,
|
|
|
+ tee.code as examCode,
|
|
|
+ teea.code as examActivityCode,
|
|
|
+ tee.start_time as examStartTime,
|
|
|
+ tee.end_time as examEndTime,
|
|
|
+ teea.start_time as examActivityStartTime,
|
|
|
+ teea.finish_time as
|
|
|
+ examActivityFinishTime,
|
|
|
+ tees.course_code as courseCode,
|
|
|
+ teec.course_name as courseName,
|
|
|
+ tee.prepare_seconds as prepareSeconds,
|
|
|
+ tee.min_duration_seconds as minDurationSeconds,
|
|
|
+ tee.max_duration_seconds as maxDurationSeconds,
|
|
|
+ tee.exam_count as
|
|
|
+ examCount,
|
|
|
+ tee.force_finish as fouceFinish,
|
|
|
+ tee.entry_authentication_policy as entryAuthenticationPolicy,
|
|
|
+ tee.in_process_face_verify as inProcessFaceVerify,
|
|
|
+ tee.in_process_face_stranger_ignore as inProcessFaceStrangerIgnore,
|
|
|
+ tee.in_process_liveness_verify as inProcessLivenessVerify,
|
|
|
+ tee.in_process_liveness_fixed_range as inProcessLivenessFixedRange,
|
|
|
+ tee.in_process_liveness_judge_policy as inProcessLivenessJudgePolicy,
|
|
|
+ tee.camera_photo_upload as cameraPhotoUpload,
|
|
|
+ tee.mobile_photo_upload
|
|
|
+ as mobilePhotoUpload,
|
|
|
+ tee.break_expire_seconds as breakExpireSeconds,
|
|
|
+ tee.break_resume_count as breakResumeCount,
|
|
|
+ toer.duration_seconds as
|
|
|
+ durationSeconds,
|
|
|
+ toer.client_last_sync_time as clientLastSyncTime
|
|
|
+ from
|
|
|
+ t_oe_exam_record toer
|
|
|
+ left join t_e_exam_student tees on
|
|
|
+ tees.id =
|
|
|
+ toer.exam_student_id
|
|
|
+ left join t_e_exam_course teec on
|
|
|
+ teec.course_code
|
|
|
+ = tees.course_code
|
|
|
+ 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
|
|
|
+ <where>
|
|
|
+ <if test="studentId != null and studentId != ''">
|
|
|
+ and tees.student_id = #{studentId}
|
|
|
+ </if>
|
|
|
+ and tee.enable = 1
|
|
|
+ and teea.enable = 1
|
|
|
+ and tees.enable = 1
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
+ and tee.org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null and examId != ''">
|
|
|
+ and tee.id = #{examId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
- <update id="dataUpdate">
|
|
|
+ <update id="dataUpdate">
|
|
|
update t_oe_exam_record t set
|
|
|
t.${colName}=#{colValue} where t.id=#{recordId}
|
|
|
</update>
|
|
|
|
|
|
- <sql id="invigilatePageHead">
|
|
|
- select
|
|
|
- t.exam_id examId,
|
|
|
- tee.name as examName,
|
|
|
- t.exam_activity_id examActivityId,
|
|
|
- teea.code as examActivityCode,
|
|
|
- t.exam_student_id examStudentId,
|
|
|
- t.id examRecordId,
|
|
|
- s.identity identity,
|
|
|
- s.room_code roomCode,
|
|
|
- s.room_name roomName,
|
|
|
- s.name name,
|
|
|
- s.course_name courseName,
|
|
|
- s.course_code courseCode,
|
|
|
- IFNULL(t.paper_download,1) paperDownload,
|
|
|
- t.status statusCode,
|
|
|
- t.answer_progress progress,
|
|
|
- IFNULL(t.client_current_ip,'无') clientCurrentIp,
|
|
|
- IFNULL(t.warning_count,0) as warningCount,
|
|
|
- IFNULL(t.breach_status,1) as breachStatus,
|
|
|
- IFNULL(t.client_websocket_status,'OFF_LINE') as clientWebsocketStatus,
|
|
|
- IFNULL(t.monitor_status_source,'STOP') as monitorStatusSource,
|
|
|
- t.client_last_sync_time as updateTime
|
|
|
- </sql>
|
|
|
+ <sql id="invigilatePageHead">
|
|
|
+ select
|
|
|
+ t.exam_id examId,
|
|
|
+ tee.name as examName,
|
|
|
+ t.exam_activity_id examActivityId,
|
|
|
+ teea.code as examActivityCode,
|
|
|
+ t.exam_student_id examStudentId,
|
|
|
+ t.id examRecordId,
|
|
|
+ s.identity identity,
|
|
|
+ s.room_code roomCode,
|
|
|
+ s.room_name roomName,
|
|
|
+ s.name name,
|
|
|
+ s.course_name courseName,
|
|
|
+ s.course_code courseCode,
|
|
|
+ IFNULL(t.paper_download,1) paperDownload,
|
|
|
+ t.status statusCode,
|
|
|
+ t.answer_progress progress,
|
|
|
+ IFNULL(t.client_current_ip,'无') clientCurrentIp,
|
|
|
+ IFNULL(t.warning_count,0) as warningCount,
|
|
|
+ IFNULL(t.breach_status,1) as breachStatus,
|
|
|
+ IFNULL(t.client_websocket_status,'OFF_LINE') as clientWebsocketStatus,
|
|
|
+ IFNULL(t.monitor_status_source,'STOP') as monitorStatusSource,
|
|
|
+ t.client_last_sync_time as updateTime
|
|
|
+ </sql>
|
|
|
|
|
|
- <sql id="invigilatePageMiddle">
|
|
|
- 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 tee on tee.id = t.exam_id
|
|
|
- left join t_e_exam_activity teea on teea.id = t.exam_activity_id
|
|
|
- inner join (select toer.id from t_oe_exam_record toer where EXISTS(select tees.id from t_e_exam_student tees where EXISTS (select distinct tbeiu.room_code from t_b_exam_invigilate_user tbeiu
|
|
|
- where
|
|
|
- <if test="userId != null and userId != ''">
|
|
|
- tbeiu.user_id = #{userId} and
|
|
|
- </if>
|
|
|
- tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id))) t1 on t1.id = t.id
|
|
|
- </sql>
|
|
|
+ <sql id="invigilatePageMiddle">
|
|
|
+ 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 tee on tee.id = t.exam_id
|
|
|
+ left join t_e_exam_activity teea on teea.id = t.exam_activity_id
|
|
|
+ inner join (select toer.id from t_oe_exam_record toer where EXISTS(select
|
|
|
+ tees.id from t_e_exam_student tees where EXISTS (select distinct
|
|
|
+ tbeiu.room_code from t_b_exam_invigilate_user tbeiu
|
|
|
+ where
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ tbeiu.user_id = #{userId} and
|
|
|
+ </if>
|
|
|
+ tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id)))
|
|
|
+ t1 on t1.id = t.id
|
|
|
+ </sql>
|
|
|
|
|
|
- <sql id="invigilatePageFoot">
|
|
|
- <where>
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and t.exam_id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="examActivityId != null and examActivityId != ''">
|
|
|
- and t.exam_activity_id = #{examActivityId}
|
|
|
- </if>
|
|
|
- <if test="roomCode != null and roomCode != ''">
|
|
|
- and s.room_code = #{roomCode}
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- <choose>
|
|
|
- <when test="status == EXAMING">
|
|
|
- and (t.status = 'ANSWERING' or t.status = 'RESUME_PREPARE')
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- and t.status = #{status}
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and s.name like CONCAT('%', #{name},'%')
|
|
|
- </if>
|
|
|
- <if test="identity != null and identity !=''">
|
|
|
- and s.identity like CONCAT('%', #{identity},'%')
|
|
|
- </if>
|
|
|
- <if test="maxWarningCount != null and maxWarningCount != ''">
|
|
|
- and t.warning_count <= #{maxWarningCount}
|
|
|
- </if>
|
|
|
- <if test="minWarningCount != null and minWarningCount != ''">
|
|
|
- and t.warning_count >= #{minWarningCount}
|
|
|
- </if>
|
|
|
- <if test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
|
|
|
- and t.client_websocket_status = #{clientWebsocketStatus}
|
|
|
- </if>
|
|
|
- <if test="monitorStatusSource != null and monitorStatusSource != ''">
|
|
|
- and t.monitor_status_source = #{monitorStatusSource}
|
|
|
- </if>
|
|
|
- and s.enable = 1
|
|
|
- and tee.enable = 1
|
|
|
- and teea.enable = 1
|
|
|
- and teea.finish_time > now()
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
+ <sql id="invigilatePageFoot">
|
|
|
+ <where>
|
|
|
+ <if test="examId != null and examId != ''">
|
|
|
+ and t.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="examActivityId != null and examActivityId != ''">
|
|
|
+ and t.exam_activity_id = #{examActivityId}
|
|
|
+ </if>
|
|
|
+ <if test="roomCode != null and roomCode != ''">
|
|
|
+ and s.room_code = #{roomCode}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="status == EXAMING">
|
|
|
+ and (t.status = 'ANSWERING' or t.status = 'RESUME_PREPARE')
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and t.status = #{status}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and s.name like CONCAT('%', #{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="identity != null and identity !=''">
|
|
|
+ and s.identity like CONCAT('%', #{identity},'%')
|
|
|
+ </if>
|
|
|
+ <if test="maxWarningCount != null and maxWarningCount != ''">
|
|
|
+ and t.warning_count <= #{maxWarningCount}
|
|
|
+ </if>
|
|
|
+ <if test="minWarningCount != null and minWarningCount != ''">
|
|
|
+ and t.warning_count >= #{minWarningCount}
|
|
|
+ </if>
|
|
|
+ <if
|
|
|
+ test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
|
|
|
+ and t.client_websocket_status = #{clientWebsocketStatus}
|
|
|
+ </if>
|
|
|
+ <if
|
|
|
+ test="monitorStatusSource != null and monitorStatusSource != ''">
|
|
|
+ and t.monitor_status_source = #{monitorStatusSource}
|
|
|
+ </if>
|
|
|
+ and s.enable = 1
|
|
|
+ and tee.enable = 1
|
|
|
+ and teea.enable = 1
|
|
|
+ and teea.finish_time > now()
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
|
|
|
- <select id="invigilatePageList" resultType="com.qmth.themis.business.bean.backend.InvigilateListBean">
|
|
|
- <include refid="invigilatePageHead" />
|
|
|
- ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.approve_status = 0) as warningNew
|
|
|
- ,date_format(date_sub(date_add(teea.start_time, interval IFNULL(teea.max_duration_seconds, tee.max_duration_seconds) second), interval teea.max_duration_seconds / 60 - t.duration_seconds minute),'%H:%i:%s') as remainTime
|
|
|
- <include refid="invigilatePageMiddle" />
|
|
|
- <include refid="invigilatePageFoot" />
|
|
|
- <if test="paperDownload != null and paperDownload != ''">
|
|
|
- and t.paper_download = #{paperDownload}
|
|
|
- </if>
|
|
|
- order by s.room_code
|
|
|
- </select>
|
|
|
+ <select id="invigilatePageList"
|
|
|
+ resultType="com.qmth.themis.business.bean.backend.InvigilateListBean">
|
|
|
+ <include refid="invigilatePageHead" />
|
|
|
+ ,(select count(1) from t_ie_invigilate_warn_info tiiwi where
|
|
|
+ tiiwi.exam_record_id = t.id and tiiwi.approve_status = 0) as
|
|
|
+ warningNew
|
|
|
+ ,date_format(date_sub(date_add(teea.start_time, interval IFNULL(teea.max_duration_seconds, tee.max_duration_seconds)
|
|
|
+ second), interval teea.max_duration_seconds / 60 - t.duration_seconds
|
|
|
+ minute),'%H:%i:%s') as remainTime
|
|
|
+ <include refid="invigilatePageMiddle" />
|
|
|
+ <include refid="invigilatePageFoot" />
|
|
|
+ <if test="paperDownload != null and paperDownload != ''">
|
|
|
+ and t.paper_download = #{paperDownload}
|
|
|
+ </if>
|
|
|
+ order by s.room_code
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.backend.InvigilateListVideoBean">
|
|
|
- <include refid="invigilatePageHead" />
|
|
|
- ,t.monitor_live_url as monitorLiveUrl
|
|
|
- <include refid="invigilatePageMiddle" />
|
|
|
- <include refid="invigilatePageFoot" />
|
|
|
- <if test="paperDownload != null and paperDownload != ''">
|
|
|
- and t.paper_download = #{paperDownload}
|
|
|
- </if>
|
|
|
- order by s.room_code
|
|
|
- </select>
|
|
|
+ <select id="invigilatePageListVideo"
|
|
|
+ resultType="com.qmth.themis.business.bean.backend.InvigilateListVideoBean">
|
|
|
+ <include refid="invigilatePageHead" />
|
|
|
+ ,t.monitor_live_url as monitorLiveUrl
|
|
|
+ <include refid="invigilatePageMiddle" />
|
|
|
+ <include refid="invigilatePageFoot" />
|
|
|
+ <if test="paperDownload != null and paperDownload != ''">
|
|
|
+ and t.paper_download = #{paperDownload}
|
|
|
+ </if>
|
|
|
+ order by s.room_code
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="invigilatePagePatrolList" resultType="com.qmth.themis.business.bean.backend.InvigilateListPatrolBean">
|
|
|
- select * from(<include refid="invigilatePageHead"/>
|
|
|
- ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = t.id) as exceptionCount
|
|
|
- ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.`type` =
|
|
|
- 'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
|
|
|
- <include refid="invigilatePageMiddle"/>
|
|
|
- <include refid="invigilatePageFoot" />
|
|
|
- ) t
|
|
|
- <where>
|
|
|
- <if test="minMultipleFaceCount != null and minMultipleFaceCount != ''">
|
|
|
- and t.multipleFaceCount <= #{minMultipleFaceCount}
|
|
|
- </if>
|
|
|
- <if test="maxMultipleFaceCount != null and maxMultipleFaceCount != ''">
|
|
|
- and t.multipleFaceCount >= #{maxMultipleFaceCount}
|
|
|
- </if>
|
|
|
- <if test="minExceptionCount != null and minExceptionCount != ''">
|
|
|
- and t.exceptionCount <= #{minExceptionCount}
|
|
|
- </if>
|
|
|
- <if test="maxExceptionCount != null and maxExceptionCount != ''">
|
|
|
- and t.exceptionCount >= #{maxExceptionCount}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- order by t.roomCode
|
|
|
- </select>
|
|
|
+ <select id="invigilatePagePatrolList"
|
|
|
+ resultType="com.qmth.themis.business.bean.backend.InvigilateListPatrolBean">
|
|
|
+ select * from(
|
|
|
+ <include refid="invigilatePageHead" />
|
|
|
+ ,(select count(1) from t_ie_invigilate_exception_info tiiei where
|
|
|
+ tiiei.exam_record_id = t.id) as exceptionCount
|
|
|
+ ,(select count(1) from t_ie_invigilate_warn_info tiiwi where
|
|
|
+ tiiwi.exam_record_id = t.id and tiiwi.`type` =
|
|
|
+ 'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
|
|
|
+ <include refid="invigilatePageMiddle" />
|
|
|
+ <include refid="invigilatePageFoot" />
|
|
|
+ ) t
|
|
|
+ <where>
|
|
|
+ <if
|
|
|
+ test="minMultipleFaceCount != null and minMultipleFaceCount != ''">
|
|
|
+ and t.multipleFaceCount <= #{minMultipleFaceCount}
|
|
|
+ </if>
|
|
|
+ <if
|
|
|
+ test="maxMultipleFaceCount != null and maxMultipleFaceCount != ''">
|
|
|
+ and t.multipleFaceCount >= #{maxMultipleFaceCount}
|
|
|
+ </if>
|
|
|
+ <if test="minExceptionCount != null and minExceptionCount != ''">
|
|
|
+ and t.exceptionCount <= #{minExceptionCount}
|
|
|
+ </if>
|
|
|
+ <if test="maxExceptionCount != null and maxExceptionCount != ''">
|
|
|
+ and t.exceptionCount >= #{maxExceptionCount}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by t.roomCode
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="invigilatePageWarningList" resultType="com.qmth.themis.business.bean.backend.InvigilateListWarningBean">
|
|
|
- select * from(select
|
|
|
- tee.id as examId,
|
|
|
- tee.name as examName,
|
|
|
- teea.id as examActivityId,
|
|
|
- tees.id as examStudentId,
|
|
|
- teea.code as examActivityCode,
|
|
|
- tees.room_code as roomCode,
|
|
|
- tees.room_name as roomName,
|
|
|
- toer.id as examRecordId,
|
|
|
- tees.`identity`,
|
|
|
- tees.name,
|
|
|
- tees.course_code as courseCode,
|
|
|
- tees.course_name as courseName,
|
|
|
- toer.status as statusCode,
|
|
|
- IFNULL(toer.warning_count,0) as warningCount,
|
|
|
- IFNULL(toer.breach_status,1) as breachStatus,
|
|
|
- toer.client_last_sync_time as updateTime,
|
|
|
- tiiwi.approve_status as approveStatus
|
|
|
- ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = toer.id and tiiwi.`type` =
|
|
|
- 'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
|
|
|
- ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = toer.id) as exceptionCount
|
|
|
- from t_ie_invigilate_warn_info tiiwi
|
|
|
- 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
|
|
|
- inner join (select toer.id from t_oe_exam_record toer where EXISTS(select tees.id from t_e_exam_student tees where EXISTS (select distinct tbeiu.room_code from t_b_exam_invigilate_user tbeiu
|
|
|
- where
|
|
|
- <if test="userId != null and userId != ''">
|
|
|
- tbeiu.user_id = #{userId} and
|
|
|
- </if>
|
|
|
- tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id))) t on t.id = tiiwi.exam_record_id
|
|
|
- left join t_oe_exam_record toer on toer.id = t.id
|
|
|
- left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
|
|
|
- <where>
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and tiiwi.exam_id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="examActivityId != null and examActivityId != ''">
|
|
|
- and tiiwi.exam_activity_id = #{examActivityId}
|
|
|
- </if>
|
|
|
- <if test="roomCode != null and roomCode != ''">
|
|
|
- and tees.room_code = #{roomCode}
|
|
|
- </if>
|
|
|
- <if test="approveStatus != null and approveStatus != ''">
|
|
|
- and tiiwi.approve_status = #{approveStatus}
|
|
|
- </if>
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and tees.name like CONCAT('%', #{name},'%')
|
|
|
- </if>
|
|
|
- <if test="identity != null and identity !=''">
|
|
|
- and tees.identity like CONCAT('%', #{identity},'%')
|
|
|
- </if>
|
|
|
- <if test="maxWarningCount != null and maxWarningCount != ''">
|
|
|
- and toer.warning_count <= #{maxWarningCount}
|
|
|
- </if>
|
|
|
- <if test="minWarningCount != null and minWarningCount != ''">
|
|
|
- and toer.warning_count >= #{minWarningCount}
|
|
|
- </if>
|
|
|
- <if test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
|
|
|
- and toer.client_websocket_status = #{clientWebsocketStatus}
|
|
|
- </if>
|
|
|
- <if test="monitorStatusSource != null and monitorStatusSource != ''">
|
|
|
- and toer.monitor_status_source = #{monitorStatusSource}
|
|
|
- </if>
|
|
|
- and tee.enable = 1
|
|
|
- and teea.enable = 1
|
|
|
- and tees.enable = 1
|
|
|
- </where>
|
|
|
- ) t
|
|
|
- <where>
|
|
|
- <if test="minMultipleFaceCount != null and minMultipleFaceCount != ''">
|
|
|
- and t.multipleFaceCount <= #{minMultipleFaceCount}
|
|
|
- </if>
|
|
|
- <if test="maxMultipleFaceCount != null and maxMultipleFaceCount != ''">
|
|
|
- and t.multipleFaceCount >= #{maxMultipleFaceCount}
|
|
|
- </if>
|
|
|
- <if test="minExceptionCount != null and minExceptionCount != ''">
|
|
|
- and t.exceptionCount <= #{minExceptionCount}
|
|
|
- </if>
|
|
|
- <if test="maxExceptionCount != null and maxExceptionCount != ''">
|
|
|
- and t.exceptionCount >= #{maxExceptionCount}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- order by t.roomCode
|
|
|
- </select>
|
|
|
+ <select id="invigilatePageWarningList"
|
|
|
+ resultType="com.qmth.themis.business.bean.backend.InvigilateListWarningBean">
|
|
|
+ select * from(select
|
|
|
+ tee.id as examId,
|
|
|
+ tee.name as examName,
|
|
|
+ teea.id as examActivityId,
|
|
|
+ tees.id as examStudentId,
|
|
|
+ teea.code as examActivityCode,
|
|
|
+ tees.room_code as roomCode,
|
|
|
+ tees.room_name as roomName,
|
|
|
+ toer.id as examRecordId,
|
|
|
+ tees.`identity`,
|
|
|
+ tees.name,
|
|
|
+ tees.course_code as courseCode,
|
|
|
+ tees.course_name as courseName,
|
|
|
+ toer.status as statusCode,
|
|
|
+ IFNULL(toer.warning_count,0) as warningCount,
|
|
|
+ IFNULL(toer.breach_status,1) as breachStatus,
|
|
|
+ toer.client_last_sync_time as updateTime,
|
|
|
+ tiiwi.approve_status as approveStatus
|
|
|
+ ,(select count(1) from t_ie_invigilate_warn_info tiiwi where
|
|
|
+ tiiwi.exam_record_id = toer.id and tiiwi.`type` =
|
|
|
+ 'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
|
|
|
+ ,(select count(1) from t_ie_invigilate_exception_info tiiei where
|
|
|
+ tiiei.exam_record_id = toer.id) as exceptionCount
|
|
|
+ from t_ie_invigilate_warn_info tiiwi
|
|
|
+ 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
|
|
|
+ inner join (select toer.id from t_oe_exam_record toer where EXISTS(select
|
|
|
+ tees.id from t_e_exam_student tees where EXISTS (select distinct
|
|
|
+ tbeiu.room_code from t_b_exam_invigilate_user tbeiu
|
|
|
+ where
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ tbeiu.user_id = #{userId} and
|
|
|
+ </if>
|
|
|
+ tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id)))
|
|
|
+ t on t.id = tiiwi.exam_record_id
|
|
|
+ left join t_oe_exam_record toer on toer.id = t.id
|
|
|
+ left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
|
|
|
+ <where>
|
|
|
+ <if test="examId != null and examId != ''">
|
|
|
+ and tiiwi.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="examActivityId != null and examActivityId != ''">
|
|
|
+ and tiiwi.exam_activity_id = #{examActivityId}
|
|
|
+ </if>
|
|
|
+ <if test="roomCode != null and roomCode != ''">
|
|
|
+ and tees.room_code = #{roomCode}
|
|
|
+ </if>
|
|
|
+ <if test="approveStatus != null and approveStatus != ''">
|
|
|
+ and tiiwi.approve_status = #{approveStatus}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and tees.name like CONCAT('%', #{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="identity != null and identity !=''">
|
|
|
+ and tees.identity like CONCAT('%', #{identity},'%')
|
|
|
+ </if>
|
|
|
+ <if test="maxWarningCount != null and maxWarningCount != ''">
|
|
|
+ and toer.warning_count <= #{maxWarningCount}
|
|
|
+ </if>
|
|
|
+ <if test="minWarningCount != null and minWarningCount != ''">
|
|
|
+ and toer.warning_count >= #{minWarningCount}
|
|
|
+ </if>
|
|
|
+ <if
|
|
|
+ test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
|
|
|
+ and toer.client_websocket_status = #{clientWebsocketStatus}
|
|
|
+ </if>
|
|
|
+ <if
|
|
|
+ test="monitorStatusSource != null and monitorStatusSource != ''">
|
|
|
+ and toer.monitor_status_source = #{monitorStatusSource}
|
|
|
+ </if>
|
|
|
+ and tee.enable = 1
|
|
|
+ and teea.enable = 1
|
|
|
+ and tees.enable = 1
|
|
|
+ </where>
|
|
|
+ ) t
|
|
|
+ <where>
|
|
|
+ <if
|
|
|
+ test="minMultipleFaceCount != null and minMultipleFaceCount != ''">
|
|
|
+ and t.multipleFaceCount <= #{minMultipleFaceCount}
|
|
|
+ </if>
|
|
|
+ <if
|
|
|
+ test="maxMultipleFaceCount != null and maxMultipleFaceCount != ''">
|
|
|
+ and t.multipleFaceCount >= #{maxMultipleFaceCount}
|
|
|
+ </if>
|
|
|
+ <if test="minExceptionCount != null and minExceptionCount != ''">
|
|
|
+ and t.exceptionCount <= #{minExceptionCount}
|
|
|
+ </if>
|
|
|
+ <if test="maxExceptionCount != null and maxExceptionCount != ''">
|
|
|
+ and t.exceptionCount >= #{maxExceptionCount}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by t.roomCode
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="invigilatePageProgressList" resultType="com.qmth.themis.business.bean.backend.InvigilateListProgressBean">
|
|
|
- select
|
|
|
- distinct tee.id as examId,
|
|
|
- tee.name as examName,
|
|
|
- teea.id as examActivityId,
|
|
|
- teea.code as examActivityCode,
|
|
|
- tees.room_code as roomCode,
|
|
|
- tees.room_name as roomName,
|
|
|
- tees.`identity`,
|
|
|
- tees.name,
|
|
|
- tees.course_code as courseCode,
|
|
|
- tees.course_name as courseName,
|
|
|
- tees.left_exam_count as leftExamCount,
|
|
|
- if((select count(1) from t_oe_exam_record toer where toer.exam_student_id = tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') > 0),'已完成','未完成') as status
|
|
|
- from
|
|
|
- t_e_exam_student tees
|
|
|
- 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
|
|
|
- inner join (select distinct tbeiu.room_code from t_b_exam_invigilate_user tbeiu
|
|
|
- <if test="userId != null and userId != ''">
|
|
|
- where tbeiu.user_id = #{userId}
|
|
|
- </if>
|
|
|
- ) t on t.room_code = tees.room_code
|
|
|
- <where>
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and tees.exam_id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="examActivityId != null and examActivityId != ''">
|
|
|
- and tees.exam_activity_id = #{examActivityId}
|
|
|
- </if>
|
|
|
- <if test="roomCode != null and roomCode != ''">
|
|
|
- and tees.room_code = #{roomCode}
|
|
|
- </if>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and tees.course_code like CONCAT('%', #{courseCode},'%')
|
|
|
- </if>
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and tees.name like CONCAT('%', #{name},'%')
|
|
|
- </if>
|
|
|
- <if test="identity != null and identity !=''">
|
|
|
- and tees.identity like CONCAT('%', #{identity},'%')
|
|
|
- </if>
|
|
|
- and tee.enable = 1
|
|
|
- and teea.enable = 1
|
|
|
- and tees.enable = 1
|
|
|
- </where>
|
|
|
- order by tees.room_code
|
|
|
- </select>
|
|
|
+ <select id="invigilatePageProgressList"
|
|
|
+ resultType="com.qmth.themis.business.bean.backend.InvigilateListProgressBean">
|
|
|
+ select
|
|
|
+ distinct tee.id as examId,
|
|
|
+ tee.name as examName,
|
|
|
+ teea.id as examActivityId,
|
|
|
+ teea.code as examActivityCode,
|
|
|
+ tees.room_code as roomCode,
|
|
|
+ tees.room_name as roomName,
|
|
|
+ tees.`identity`,
|
|
|
+ tees.name,
|
|
|
+ tees.course_code as courseCode,
|
|
|
+ tees.course_name as courseName,
|
|
|
+ tees.left_exam_count as leftExamCount,
|
|
|
+ if((select count(1) from t_oe_exam_record toer where toer.exam_student_id =
|
|
|
+ tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') >
|
|
|
+ 0),'已完成','未完成') as status
|
|
|
+ from
|
|
|
+ t_e_exam_student tees
|
|
|
+ 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
|
|
|
+ inner join (select distinct tbeiu.room_code from t_b_exam_invigilate_user
|
|
|
+ tbeiu
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ where tbeiu.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ ) t on t.room_code = tees.room_code
|
|
|
+ <where>
|
|
|
+ <if test="examId != null and examId != ''">
|
|
|
+ and tees.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="examActivityId != null and examActivityId != ''">
|
|
|
+ and tees.exam_activity_id = #{examActivityId}
|
|
|
+ </if>
|
|
|
+ <if test="roomCode != null and roomCode != ''">
|
|
|
+ and tees.room_code = #{roomCode}
|
|
|
+ </if>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and tees.course_code like CONCAT('%', #{courseCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and tees.name like CONCAT('%', #{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="identity != null and identity !=''">
|
|
|
+ and tees.identity like CONCAT('%', #{identity},'%')
|
|
|
+ </if>
|
|
|
+ and tee.enable = 1
|
|
|
+ and teea.enable = 1
|
|
|
+ and tees.enable = 1
|
|
|
+ </where>
|
|
|
+ order by tees.room_code
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="invigilatePageListHistory" resultType="com.qmth.themis.business.bean.backend.InvigilateListHistoryBean">
|
|
|
- <include refid="invigilatePageHead" />
|
|
|
- <include refid="invigilatePageMiddle" />
|
|
|
- <include refid="invigilatePageFoot" />
|
|
|
- <if test="breachStatus != null and breachStatus != '' or breachStatus == 0">
|
|
|
- and t.breach_status = #{breachStatus}
|
|
|
- </if>
|
|
|
- <if test="finishType != null and finishType != ''">
|
|
|
- and t.finish_type = #{finishType}
|
|
|
- </if>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and tees.course_code like CONCAT('%', #{courseCode},'%')
|
|
|
- </if>
|
|
|
- order by s.room_code
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getDoneCount" resultType="java.util.Map">
|
|
|
- select f.exam_activity_id activityId,count(distinct(f.exam_student_id)) cc from t_oe_exam_record f
|
|
|
- left join t_e_exam_student t on f.exam_student_id=t.id
|
|
|
- where f.exam_id = #{examId}
|
|
|
- <if test="activityId != null and activityId != ''">
|
|
|
- and f.exam_activity_id = #{activityId}
|
|
|
- </if>
|
|
|
- <if test="roomCode != null and roomCode != ''">
|
|
|
- and t.room_code =#{roomCode}
|
|
|
- </if>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and t.course_code = #{courseCode}
|
|
|
- </if>
|
|
|
- group by f.exam_activity_id
|
|
|
- </select>
|
|
|
- <select id="getDoneCountByDay" resultType="java.util.Map">
|
|
|
- select DATE_FORMAT(f.first_prepare_time, '%Y-%m-%d') AS day,
|
|
|
+ <select id="invigilatePageListHistory"
|
|
|
+ resultType="com.qmth.themis.business.bean.backend.InvigilateListHistoryBean">
|
|
|
+ <include refid="invigilatePageHead" />
|
|
|
+ <include refid="invigilatePageMiddle" />
|
|
|
+ <include refid="invigilatePageFoot" />
|
|
|
+ <if
|
|
|
+ test="breachStatus != null and breachStatus != '' or breachStatus == 0">
|
|
|
+ and t.breach_status = #{breachStatus}
|
|
|
+ </if>
|
|
|
+ <if test="finishType != null and finishType != ''">
|
|
|
+ and t.finish_type = #{finishType}
|
|
|
+ </if>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and tees.course_code like CONCAT('%', #{courseCode},'%')
|
|
|
+ </if>
|
|
|
+ order by s.room_code
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getDoneCount" resultType="java.util.Map">
|
|
|
+ select f.exam_activity_id
|
|
|
+ activityId,count(distinct(f.exam_student_id)) cc from t_oe_exam_record
|
|
|
+ f
|
|
|
+ left join t_e_exam_student t on f.exam_student_id=t.id
|
|
|
+ where f.exam_id = #{examId}
|
|
|
+ <if test="activityId != null and activityId != ''">
|
|
|
+ and f.exam_activity_id = #{activityId}
|
|
|
+ </if>
|
|
|
+ <if test="roomCode != null and roomCode != ''">
|
|
|
+ and t.room_code =#{roomCode}
|
|
|
+ </if>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and t.course_code = #{courseCode}
|
|
|
+ </if>
|
|
|
+ group by f.exam_activity_id
|
|
|
+ </select>
|
|
|
+ <select id="getDoneCountByDay" resultType="java.util.Map">
|
|
|
+ select DATE_FORMAT(f.first_prepare_time, '%Y-%m-%d') AS day,
|
|
|
count(DISTINCT(f.exam_student_id)) count from t_oe_exam_record f
|
|
|
- left join t_e_exam_student t on f.exam_student_id=t.id
|
|
|
- where f.exam_id = #{examId}
|
|
|
- <if test="activityId != null and activityId != ''">
|
|
|
- and f.exam_activity_id = #{activityId}
|
|
|
- </if>
|
|
|
- <if test="roomCode != null and roomCode != ''">
|
|
|
- and t.room_code =#{roomCode}
|
|
|
- </if>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and t.course_code = #{courseCode}
|
|
|
- </if>
|
|
|
- group by day
|
|
|
- ORDER BY day
|
|
|
- </select>
|
|
|
-
|
|
|
+ left join t_e_exam_student t on f.exam_student_id=t.id
|
|
|
+ where f.exam_id = #{examId}
|
|
|
+ <if test="activityId != null and activityId != ''">
|
|
|
+ and f.exam_activity_id = #{activityId}
|
|
|
+ </if>
|
|
|
+ <if test="roomCode != null and roomCode != ''">
|
|
|
+ and t.room_code =#{roomCode}
|
|
|
+ </if>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and t.course_code = #{courseCode}
|
|
|
+ </if>
|
|
|
+ group by day
|
|
|
+ ORDER BY day
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCountByExamId" resultType="java.lang.Long">
|
|
|
+ select count(1) from t_oe_exam_record f
|
|
|
+ where f.exam_id = #{examId}
|
|
|
+ </select>
|
|
|
+ <select id="getListByExamIdAndStartId" resultType="com.qmth.themis.business.entity.TOeExamRecord">
|
|
|
+ select f.* from t_oe_exam_record f
|
|
|
+ where f.exam_id = #{examId} and f.id>#{startId}
|
|
|
+ order by f.id
|
|
|
+ limit 500
|
|
|
+ </select>
|
|
|
</mapper>
|