|
@@ -3,20 +3,19 @@
|
|
|
<mapper namespace="com.qmth.themis.business.dao.TBExamInvigilateUserMapper">
|
|
|
|
|
|
<sql id="queryCommon">
|
|
|
- (
|
|
|
select
|
|
|
- tbeiu.room_code as roomCode, tbeiu.room_name as roomName, tbeiu.user_id as userId,tee.id as examId,
|
|
|
- tee.name as examName, (
|
|
|
- select
|
|
|
- tbu.name
|
|
|
- from
|
|
|
- t_b_user tbu
|
|
|
- where
|
|
|
- tbu.id = tbeiu.user_id) as name
|
|
|
+ tbeiu.room_code as roomCode,
|
|
|
+ tbeiu.room_name as roomName,
|
|
|
+ tee.id as examId,
|
|
|
+ tee.name as examName,
|
|
|
+ GROUP_CONCAT(tbeiu.user_id) as userId,
|
|
|
+ GROUP_CONCAT(tbu.name) as name
|
|
|
from
|
|
|
t_b_exam_invigilate_user tbeiu
|
|
|
- left join t_e_exam tee on
|
|
|
+ join t_e_exam tee on
|
|
|
tee.id = tbeiu.exam_id
|
|
|
+ join t_b_user tbu on
|
|
|
+ tbu.id = tbeiu.user_id
|
|
|
<where>
|
|
|
<if test="examId != null and examId != ''">
|
|
|
and tbeiu.exam_id = #{examId}
|
|
@@ -31,47 +30,27 @@
|
|
|
and tbeiu.org_id = #{orgId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- ) t
|
|
|
+ group by
|
|
|
+ tee.id,
|
|
|
+ tee.name,
|
|
|
+ tbeiu.room_code,
|
|
|
+ tbeiu.room_name
|
|
|
</sql>
|
|
|
|
|
|
<select id="examInvigilateUserQuery" resultType="com.qmth.themis.business.dto.response.TBExamInvigilateUserDto">
|
|
|
- select
|
|
|
- t.examId,
|
|
|
- t.examName,
|
|
|
- t.roomCode,
|
|
|
- t.roomName,
|
|
|
- GROUP_CONCAT(t.userId) as userId,
|
|
|
- GROUP_CONCAT(t.name) as name
|
|
|
- from
|
|
|
<include refid="queryCommon"/>
|
|
|
- group by
|
|
|
- t.examId,
|
|
|
- t.examName,
|
|
|
- t.roomCode,
|
|
|
- t.roomName
|
|
|
- order by t.examName,CAST(t.roomCode AS UNSIGNED)
|
|
|
+ order by tee.name,CAST(tbeiu.room_code AS UNSIGNED)
|
|
|
</select>
|
|
|
|
|
|
<select id="examInvigilateUserExport" resultType="com.qmth.themis.business.dto.RoomCodeExportDto">
|
|
|
- select
|
|
|
- t.examId,
|
|
|
- t.examName,
|
|
|
- t.roomCode,
|
|
|
- t.roomName,
|
|
|
- GROUP_CONCAT(t.name) as name
|
|
|
- from
|
|
|
<include refid="queryCommon"/>
|
|
|
- group by
|
|
|
- t.examId,
|
|
|
- t.examName,
|
|
|
- t.roomCode,
|
|
|
- t.roomName
|
|
|
+ order by tee.name,CAST(tbeiu.room_code AS UNSIGNED)
|
|
|
</select>
|
|
|
|
|
|
<select id="getInvigilateUsers" resultType="java.util.Map">
|
|
|
- select f.login_name loginName,f.`name` from
|
|
|
- t_b_exam_invigilate_user t left join t_b_user f on t.user_id=f.id
|
|
|
- where t.exam_id=#{examId} and t.room_code=#{roomCode}
|
|
|
+ select f.login_name loginName,f.`name` from
|
|
|
+ t_b_exam_invigilate_user t left join t_b_user f on t.user_id=f.id
|
|
|
+ where t.exam_id=#{examId} and t.room_code=#{roomCode}
|
|
|
</select>
|
|
|
|
|
|
<select id="examInvigilateUserLoginTimeExport" resultType="com.qmth.themis.business.dto.InvigilateUserExportDto">
|
|
@@ -85,7 +64,7 @@
|
|
|
teea.code as 'code',
|
|
|
tbu.login_name as 'name',
|
|
|
teul.`type`,
|
|
|
- DATE_FORMAT(FROM_UNIXTIME(teul.create_time / 1000), '%Y-%m-%d %H:%i:%s') as 'createTime'
|
|
|
+ DATE_FORMAT(FROM_UNIXTIME(teul.create_time / 1000), '%Y-%m-%d %H:%i:%s') as 'createTime'
|
|
|
from
|
|
|
t_b_exam_invigilate_user tbeiu
|
|
|
join t_e_exam tee on
|