|
@@ -7,6 +7,9 @@
|
|
t.id as examId
|
|
t.id as examId
|
|
from
|
|
from
|
|
t_e_exam t
|
|
t_e_exam t
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = t.id
|
|
|
|
+ </if>
|
|
<where>1 = 1
|
|
<where>1 = 1
|
|
and t.monitor_status <![CDATA[ <> ]]> 'FINISHED'
|
|
and t.monitor_status <![CDATA[ <> ]]> 'FINISHED'
|
|
and t.start_time <![CDATA[ <= ]]> unix_timestamp(current_timestamp()) * 1000
|
|
and t.start_time <![CDATA[ <= ]]> unix_timestamp(current_timestamp()) * 1000
|
|
@@ -15,48 +18,13 @@
|
|
and t.org_id = #{orgId}
|
|
and t.org_id = #{orgId}
|
|
</if>
|
|
</if>
|
|
<if test="userId != null and userId != ''">
|
|
<if test="userId != null and userId != ''">
|
|
- and EXISTS(
|
|
|
|
- select
|
|
|
|
- DISTINCT tbeiu.exam_id
|
|
|
|
- from
|
|
|
|
- t_b_exam_invigilate_user tbeiu
|
|
|
|
- left join t_e_exam_student tees on
|
|
|
|
- tees.room_code = tbeiu.room_code and tees.exam_id = tbeiu.exam_id
|
|
|
|
- where
|
|
|
|
- tbeiu.user_id = #{userId}
|
|
|
|
- and t.id = tbeiu.exam_id)
|
|
|
|
|
|
+ and tbeiu.user_id = #{userId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="examQuery" resultType="com.qmth.themis.business.dto.response.TEExamQueryDto">
|
|
<select id="examQuery" resultType="com.qmth.themis.business.dto.response.TEExamQueryDto">
|
|
- select
|
|
|
|
- t.id,
|
|
|
|
- t.code,
|
|
|
|
- t.name,
|
|
|
|
- t.tag,
|
|
|
|
- t.mode,
|
|
|
|
- t.enable,
|
|
|
|
- t.startTime,
|
|
|
|
- t.endTime,
|
|
|
|
- t.progress,
|
|
|
|
- t.score_status scoreStatus,
|
|
|
|
- if(t.updateName is not null, t.updateName, t.createName) as updateName,
|
|
|
|
- if(t.updateTime is not null, t.updateTime, t.createTime) as updateTime,
|
|
|
|
- t.enableIpLimit,
|
|
|
|
- t.monitorVideoSource,
|
|
|
|
- t.monitorRecord,
|
|
|
|
- t.monitorStatus,
|
|
|
|
- t.examStudentCallEnable,
|
|
|
|
- t.objectiveScorePush,
|
|
|
|
- (select tbth.status from t_b_task_history tbth where tbth.exam_id = t.id and tbth.`type` = 'CLOUD_MARK_DATA_PUSH' and tbth.progress = 100 order by tbth.create_time desc limit 1) as cloudMarkPushDataStatus,
|
|
|
|
- t.examStudentBreachPush
|
|
|
|
- <if test="type != null and type != '' and type == 'monitor'">
|
|
|
|
- ,group_concat(distinct tees.room_code) as roomCode,
|
|
|
|
- group_concat(distinct tees.room_name) as roomName
|
|
|
|
- </if>
|
|
|
|
- from
|
|
|
|
- (select t.id,
|
|
|
|
|
|
+ select t.id,
|
|
t.code,
|
|
t.code,
|
|
t.name,
|
|
t.name,
|
|
t.tag,
|
|
t.tag,
|
|
@@ -71,24 +39,37 @@
|
|
t.monitor_record as monitorRecord,
|
|
t.monitor_record as monitorRecord,
|
|
t.monitor_status as monitorStatus,
|
|
t.monitor_status as monitorStatus,
|
|
TRUNCATE(t.progress,2) as progress,
|
|
TRUNCATE(t.progress,2) as progress,
|
|
- t.score_status,
|
|
|
|
|
|
+ t.score_status as scoreStatus,
|
|
|
|
+ tbu1.name as createName,
|
|
|
|
+ tbu2.name as updateName,
|
|
|
|
+ t.exam_student_call_enable as examStudentCallEnable,
|
|
|
|
+ t.objective_score_push as objectiveScorePush,
|
|
|
|
+ t.exam_student_breach_push as examStudentBreachPush,
|
|
(
|
|
(
|
|
select
|
|
select
|
|
- t1.name
|
|
|
|
- from
|
|
|
|
- t_b_user t1
|
|
|
|
- where
|
|
|
|
- t1.id = t.create_id) as createName, (
|
|
|
|
- select
|
|
|
|
- t1.name
|
|
|
|
|
|
+ tbth.status
|
|
from
|
|
from
|
|
- t_b_user t1
|
|
|
|
|
|
+ t_b_task_history tbth
|
|
where
|
|
where
|
|
- t1.id = t.update_id) as updateName,
|
|
|
|
- t.exam_student_call_enable as examStudentCallEnable,
|
|
|
|
- t.objective_score_push as objectiveScorePush,
|
|
|
|
- t.exam_student_breach_push as examStudentBreachPush
|
|
|
|
|
|
+ tbth.exam_id = t.id
|
|
|
|
+ and tbth.`type` = 'CLOUD_MARK_DATA_PUSH'
|
|
|
|
+ and tbth.progress = 100
|
|
|
|
+ order by
|
|
|
|
+ tbth.create_time desc
|
|
|
|
+ limit 1) as cloudMarkPushDataStatus
|
|
|
|
+ <if test="type != null and type != '' and type == 'monitor'">
|
|
|
|
+ ,group_concat(distinct tees.room_code) as roomCode,
|
|
|
|
+ group_concat(distinct tees.room_name) as roomName
|
|
|
|
+ </if>
|
|
from t_e_exam t
|
|
from t_e_exam t
|
|
|
|
+ left join t_b_user tbu1 on t.create_id = tbu1.id
|
|
|
|
+ left join t_b_user tbu2 on t.update_id = tbu2.id
|
|
|
|
+ <if test="type != null and type != '' and type == 'monitor'">
|
|
|
|
+ left join t_e_exam_student tees on tees.exam_id = t.id
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = t.id
|
|
|
|
+ </if>
|
|
<where>1 = 1
|
|
<where>1 = 1
|
|
<if test="type != null and type != '' and type == 'monitor'">
|
|
<if test="type != null and type != '' and type == 'monitor'">
|
|
and t.monitor_status <![CDATA[ <> ]]> 'FINISHED'
|
|
and t.monitor_status <![CDATA[ <> ]]> 'FINISHED'
|
|
@@ -98,17 +79,7 @@
|
|
and t.monitor_status = 'FINISHED'
|
|
and t.monitor_status = 'FINISHED'
|
|
</if>
|
|
</if>
|
|
<if test="userId != null and userId != ''">
|
|
<if test="userId != null and userId != ''">
|
|
- and t.enable = 1
|
|
|
|
- and EXISTS(
|
|
|
|
- select
|
|
|
|
- DISTINCT tbeiu.exam_id
|
|
|
|
- from
|
|
|
|
- t_b_exam_invigilate_user tbeiu
|
|
|
|
- left join t_e_exam_student tees on
|
|
|
|
- tees.room_code = tbeiu.room_code and tees.exam_id = tbeiu.exam_id
|
|
|
|
- where
|
|
|
|
- tbeiu.user_id = #{userId}
|
|
|
|
- and t.id = tbeiu.exam_id)
|
|
|
|
|
|
+ and tbeiu.user_id = #{userId}
|
|
</if>
|
|
</if>
|
|
<if test="orgId != null and orgId != ''">
|
|
<if test="orgId != null and orgId != ''">
|
|
and t.org_id = #{orgId}
|
|
and t.org_id = #{orgId}
|
|
@@ -129,26 +100,24 @@
|
|
and t.enable = #{enable}
|
|
and t.enable = #{enable}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- ) t
|
|
|
|
<if test="type != null and type != '' and type == 'monitor'">
|
|
<if test="type != null and type != '' and type == 'monitor'">
|
|
- left join t_e_exam_student tees on tees.exam_id = t.id
|
|
|
|
|
|
+ group by t.id,
|
|
|
|
+ t.code,
|
|
|
|
+ t.name,
|
|
|
|
+ t.tag,
|
|
|
|
+ t.mode,
|
|
|
|
+ t.enable,
|
|
|
|
+ t.start_time,
|
|
|
|
+ t.end_time,
|
|
|
|
+ t.progress,
|
|
|
|
+ tbu2.name,
|
|
|
|
+ t.update_ime,
|
|
|
|
+ t.enable_ip_limit,
|
|
|
|
+ t.monitor_video_source,
|
|
|
|
+ t.monitor_record,
|
|
|
|
+ t.monitor_status
|
|
</if>
|
|
</if>
|
|
- group by t.id,
|
|
|
|
- t.code,
|
|
|
|
- t.name,
|
|
|
|
- t.tag,
|
|
|
|
- t.mode,
|
|
|
|
- t.enable,
|
|
|
|
- t.startTime,
|
|
|
|
- t.endTime,
|
|
|
|
- t.progress,
|
|
|
|
- t.updateName,
|
|
|
|
- t.updateTime,
|
|
|
|
- t.enableIpLimit,
|
|
|
|
- t.monitorVideoSource,
|
|
|
|
- t.monitorRecord,
|
|
|
|
- t.monitorStatus
|
|
|
|
- order by t.createTime desc
|
|
|
|
|
|
+ order by t.create_time desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="examroomQuery" resultType="java.util.HashMap">
|
|
<select id="examroomQuery" resultType="java.util.HashMap">
|