|
@@ -17,14 +17,14 @@
|
|
|
<if test="userId != null and userId != ''">
|
|
|
and EXISTS(
|
|
|
select
|
|
|
- DISTINCT tbeiu.exam_id
|
|
|
+ DISTINCT tees.exam_id
|
|
|
from
|
|
|
t_b_exam_invigilate_user tbeiu
|
|
|
left join t_e_exam_student tees on
|
|
|
tees.room_code = tbeiu.room_code
|
|
|
where
|
|
|
tbeiu.user_id = #{userId}
|
|
|
- and t.id = tbeiu.exam_id)
|
|
|
+ and t.id = tees.exam_id)
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
@@ -75,14 +75,14 @@
|
|
|
and t.enable = 1
|
|
|
and EXISTS(
|
|
|
select
|
|
|
- DISTINCT tbeiu.exam_id
|
|
|
+ DISTINCT tees.exam_id
|
|
|
from
|
|
|
t_b_exam_invigilate_user tbeiu
|
|
|
left join t_e_exam_student tees on
|
|
|
tees.room_code = tbeiu.room_code
|
|
|
where
|
|
|
tbeiu.user_id = #{userId}
|
|
|
- and t.id = tbeiu.exam_id)
|
|
|
+ and t.id = tees.exam_id)
|
|
|
</if>
|
|
|
<if test="orgId != null and orgId != ''">
|
|
|
and t.org_id = #{orgId}
|
|
@@ -110,11 +110,11 @@
|
|
|
t.*
|
|
|
from
|
|
|
(
|
|
|
- select
|
|
|
- distinct tee.id, teea.id as examActivityId,tee.name, tee.mode, tee.pre_notice as preNotice, tee.pre_notice_stay_seconds as
|
|
|
- preNoticeStaySeconds, tee.post_notice as postNotice,
|
|
|
- datediff(teea.finish_time,teea.start_time) as diffSum,
|
|
|
- datediff(teea.finish_time,teea.start_time) - datediff(now(),teea.start_time) as reallyTime
|
|
|
+ select
|
|
|
+ distinct tee.id, teea.id as examActivityId,tee.name, tee.mode, tee.pre_notice as preNotice, tee.pre_notice_stay_seconds as
|
|
|
+ preNoticeStaySeconds, tee.post_notice as postNotice,
|
|
|
+ datediff(teea.finish_time,teea.start_time) as diffSum,
|
|
|
+ datediff(teea.finish_time,teea.start_time) - datediff(now(),teea.start_time) as reallyTime
|
|
|
from
|
|
|
t_e_exam_student tees
|
|
|
left join t_e_exam tee on
|
|
@@ -125,19 +125,19 @@
|
|
|
<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>
|
|
|
- <!--and IF(tee.mode = 'TOGETHER', teea.start_time >= date_sub(now(),
|
|
|
- interval IFNULL(teea.opening_seconds, tee.opening_seconds) second),1 = 1 )-->
|
|
|
+ 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>
|
|
|
+ <!--and IF(tee.mode = 'TOGETHER', teea.start_time >= date_sub(now(),
|
|
|
+ interval IFNULL(teea.opening_seconds, tee.opening_seconds) second),1 = 1 )-->
|
|
|
</where>
|
|
|
- ) t
|
|
|
+ ) t
|
|
|
<where>
|
|
|
t.reallyTime <![CDATA[ <= ]]> diffSum + 15
|
|
|
and t.reallyTime <![CDATA[ >= ]]> 0
|
|
@@ -146,24 +146,24 @@
|
|
|
|
|
|
<select id="examPrivilegeQuery" resultType="com.qmth.themis.business.entity.TEExam">
|
|
|
select
|
|
|
- *
|
|
|
+ *
|
|
|
from
|
|
|
- t_e_exam tee
|
|
|
+ t_e_exam tee
|
|
|
where
|
|
|
- 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
|
|
|
- <where> 1 = 1
|
|
|
- <if test="userId != null and userId != ''">
|
|
|
- and tbeiu.user_id = #{userId}
|
|
|
- </if>
|
|
|
- and tee.id = tbeiu.exam_id
|
|
|
- </where>
|
|
|
- )
|
|
|
- order by tee.create_time desc
|
|
|
- </select>
|
|
|
+ EXISTS(
|
|
|
+ select
|
|
|
+ DISTINCT tees.exam_id
|
|
|
+ from
|
|
|
+ t_b_exam_invigilate_user tbeiu
|
|
|
+ left join t_e_exam_student tees on
|
|
|
+ tees.room_code = tbeiu.room_code
|
|
|
+ <where> 1 = 1
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ and tbeiu.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ and tee.id = tees.exam_id
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ order by tee.create_time desc
|
|
|
+ </select>
|
|
|
</mapper>
|