|
@@ -4,132 +4,135 @@
|
|
|
|
|
|
<select id="reexamPageRequestList" resultType="com.qmth.themis.business.bean.backend.ReexamListRequestBean">
|
|
|
select * from(select distinct
|
|
|
- tees.room_code as roomCode,
|
|
|
- tees.room_name as roomName,
|
|
|
- tees.`identity`,
|
|
|
- tees.name,
|
|
|
- tees.exam_activity_id as examActivityId,
|
|
|
- tees.id as examStudentId,
|
|
|
- tees.course_code as courseCode,
|
|
|
- tees.course_name as courseName,
|
|
|
- tees.exam_id as examId,
|
|
|
- if(tee.exam_count - tees.already_exam_count <![CDATA[ < ]]> 0,0,tee.exam_count - tees.already_exam_count) as examCount,
|
|
|
- (select count(1) from t_oe_exam_record toer where (toer.status <![CDATA[ <> ]]> 'FINISHED' and toer.status <![CDATA[ <> ]]> 'PERSISTED') and toer.exam_student_id = tees.id) as statusCount,
|
|
|
- (select count(1) from t_e_exam_reexam teer where teer.exam_student_id = tees.id and teer.status = 1) as reexamCount
|
|
|
+ tees.room_code as roomCode,
|
|
|
+ tees.room_name as roomName,
|
|
|
+ tees.`identity`,
|
|
|
+ tees.name,
|
|
|
+ tees.exam_activity_id as examActivityId,
|
|
|
+ tees.id as examStudentId,
|
|
|
+ tees.course_code as courseCode,
|
|
|
+ tees.course_name as courseName,
|
|
|
+ tees.exam_id as examId,
|
|
|
+ if(tee.exam_count - tees.already_exam_count <![CDATA[ < ]]> 0,0,tee.exam_count - tees.already_exam_count) as
|
|
|
+ examCount,
|
|
|
+ (select count(1) from t_oe_exam_record toer where (toer.status <![CDATA[ <> ]]> 'FINISHED' and toer.status
|
|
|
+ <![CDATA[ <> ]]> 'PERSISTED') and toer.exam_student_id = tees.id) as statusCount,
|
|
|
+ (select count(1) from t_e_exam_reexam teer where teer.exam_student_id = tees.id and teer.status = 1) as
|
|
|
+ reexamCount
|
|
|
from
|
|
|
- t_e_exam_student tees
|
|
|
- left join t_e_exam tee on
|
|
|
- tees.exam_id = tee.id
|
|
|
- <where>
|
|
|
- exists(
|
|
|
- select
|
|
|
- distinct tbeiu.exam_id
|
|
|
- from
|
|
|
- t_b_exam_invigilate_user tbeiu where 1 = 1
|
|
|
- <if test="userId != null and userId != ''">
|
|
|
- and tbeiu.user_id = #{userId}
|
|
|
- </if>
|
|
|
- and tbeiu.exam_id = tees.exam_id and tees.exam_id = tbeiu.exam_id
|
|
|
- )
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and tees.exam_id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="orgId != null and orgId != ''">
|
|
|
- and tee.org_id = #{orgId}
|
|
|
- </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 tees.enable = 1
|
|
|
- and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
|
|
|
- </where>
|
|
|
+ t_e_exam_student tees
|
|
|
+ left join t_e_exam tee on
|
|
|
+ tees.exam_id = tee.id
|
|
|
+ <where>
|
|
|
+ exists(
|
|
|
+ select
|
|
|
+ distinct tbeiu.exam_id
|
|
|
+ from
|
|
|
+ t_b_exam_invigilate_user tbeiu where 1 = 1
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ and tbeiu.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ and tbeiu.exam_id = tees.exam_id
|
|
|
+ )
|
|
|
+ <if test="examId != null and examId != ''">
|
|
|
+ and tees.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
+ and tee.org_id = #{orgId}
|
|
|
+ </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 tees.enable = 1
|
|
|
+ and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
|
|
|
+ </where>
|
|
|
) t where t.examCount = 0 and statusCount = 0
|
|
|
- order by t.roomCode
|
|
|
+ order by t.roomCode
|
|
|
</select>
|
|
|
|
|
|
<select id="reexamPageNotDoneList" resultType="com.qmth.themis.business.bean.backend.ReexamListNotDoneBean">
|
|
|
select
|
|
|
- teer.id as reexamId,
|
|
|
- teer.exam_id as examId,
|
|
|
- teer.exam_activity_id as examActivityId,
|
|
|
- teea.code as examActivityCode,
|
|
|
- tees.room_code as roomCode,
|
|
|
- tees.room_name as roomName,
|
|
|
- tees.course_code as courseCode,
|
|
|
- tees.course_name as courseName,
|
|
|
- tees.`identity`,
|
|
|
- tee.name as examName,
|
|
|
- tees.name,
|
|
|
- teer.reason,
|
|
|
- teer.create_time as applyTime,
|
|
|
- tbu.name as applyName
|
|
|
+ teer.id as reexamId,
|
|
|
+ teer.exam_id as examId,
|
|
|
+ teer.exam_activity_id as examActivityId,
|
|
|
+ teea.code as examActivityCode,
|
|
|
+ tees.room_code as roomCode,
|
|
|
+ tees.room_name as roomName,
|
|
|
+ tees.course_code as courseCode,
|
|
|
+ tees.course_name as courseName,
|
|
|
+ tees.`identity`,
|
|
|
+ tee.name as examName,
|
|
|
+ tees.name,
|
|
|
+ teer.reason,
|
|
|
+ teer.create_time as applyTime,
|
|
|
+ tbu.name as applyName
|
|
|
from
|
|
|
- t_e_exam_reexam teer
|
|
|
+ t_e_exam_reexam teer
|
|
|
left join t_e_exam_student tees on
|
|
|
- tees.id = teer.exam_student_id
|
|
|
+ tees.id = teer.exam_student_id
|
|
|
left join t_e_exam tee on
|
|
|
- tee.id = teer.exam_id
|
|
|
+ tee.id = teer.exam_id
|
|
|
left join t_e_exam_activity teea on
|
|
|
- teea.id = teer.exam_activity_id
|
|
|
+ teea.id = teer.exam_activity_id
|
|
|
left join t_b_user tbu on
|
|
|
- tbu.id = teer.create_id
|
|
|
+ tbu.id = teer.create_id
|
|
|
left join t_e_exam_reexam_auditing teera on
|
|
|
- teera.reexam_id = teer.id
|
|
|
- <where>
|
|
|
- <if test="userId != null and userId !=''">
|
|
|
- and teera.auditing_id = #{userId}
|
|
|
- </if>
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and teer.exam_id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="orgId != null and orgId != ''">
|
|
|
- and tee.org_id = #{orgId}
|
|
|
- </if>
|
|
|
- <if test="examActivityId != null and examActivityId != ''">
|
|
|
- and teer.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>
|
|
|
- <if test="reason != null and reason !=''">
|
|
|
- and teer.reason = #{reason}
|
|
|
- </if>
|
|
|
- <if test="reasonStartTime != null and reasonStartTime != ''">
|
|
|
- and teer.create_time >= #{reasonStartTime}
|
|
|
- </if>
|
|
|
- <if test="reasonEndTime != null and reasonEndTime != ''">
|
|
|
- and teer.create_time <= #{reasonEndTime}
|
|
|
- </if>
|
|
|
- <if test="applyName != null and applyName !=''">
|
|
|
- and tbu.name like CONCAT('%', #{applyName},'%')
|
|
|
- </if>
|
|
|
- and tee.enable = 1
|
|
|
- and teea.enable = 1
|
|
|
- and tees.enable = 1
|
|
|
- and teer.status = 1
|
|
|
- </where>
|
|
|
- order by tees.room_code
|
|
|
+ teera.reexam_id = teer.id
|
|
|
+ <where>
|
|
|
+ <if test="userId != null and userId !=''">
|
|
|
+ and teera.auditing_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null and examId != ''">
|
|
|
+ and teer.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
+ and tee.org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ <if test="examActivityId != null and examActivityId != ''">
|
|
|
+ and teer.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>
|
|
|
+ <if test="reason != null and reason !=''">
|
|
|
+ and teer.reason = #{reason}
|
|
|
+ </if>
|
|
|
+ <if test="reasonStartTime != null and reasonStartTime != ''">
|
|
|
+ and teer.create_time >= #{reasonStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="reasonEndTime != null and reasonEndTime != ''">
|
|
|
+ and teer.create_time <= #{reasonEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="applyName != null and applyName !=''">
|
|
|
+ and tbu.name like CONCAT('%', #{applyName},'%')
|
|
|
+ </if>
|
|
|
+ and tee.enable = 1
|
|
|
+ and teea.enable = 1
|
|
|
+ and tees.enable = 1
|
|
|
+ and teer.status = 1
|
|
|
+ </where>
|
|
|
+ order by tees.room_code
|
|
|
</select>
|
|
|
|
|
|
<select id="reexamPageNotDoneCount" resultType="java.lang.Integer">
|
|
@@ -165,36 +168,36 @@
|
|
|
|
|
|
<select id="reexamPageDoneList" resultType="com.qmth.themis.business.bean.backend.ReexamListDoneBean">
|
|
|
select
|
|
|
- teer.id as reexamId,
|
|
|
- teer.exam_id as examId,
|
|
|
- teer.exam_activity_id as examActivityId,
|
|
|
- teea.code as examActivityCode,
|
|
|
- tees.room_code as roomCode,
|
|
|
- tees.room_name as roomName,
|
|
|
- tees.course_code as courseCode,
|
|
|
- tees.course_name as courseName,
|
|
|
- tees.`identity`,
|
|
|
- tee.name as examName,
|
|
|
- tees.name,
|
|
|
- teer.reason,
|
|
|
- teer.create_time as applyTime,
|
|
|
- teer.auditing_status as auditingStatus,
|
|
|
- teer.update_time as auditingTime,
|
|
|
- tbu.name as applyName,
|
|
|
- tbu1.name as auditingName,
|
|
|
- if(teer.auditing_status = 0,'通过','不通过') as auditingStatusStr
|
|
|
+ teer.id as reexamId,
|
|
|
+ teer.exam_id as examId,
|
|
|
+ teer.exam_activity_id as examActivityId,
|
|
|
+ teea.code as examActivityCode,
|
|
|
+ tees.room_code as roomCode,
|
|
|
+ tees.room_name as roomName,
|
|
|
+ tees.course_code as courseCode,
|
|
|
+ tees.course_name as courseName,
|
|
|
+ tees.`identity`,
|
|
|
+ tee.name as examName,
|
|
|
+ tees.name,
|
|
|
+ teer.reason,
|
|
|
+ teer.create_time as applyTime,
|
|
|
+ teer.auditing_status as auditingStatus,
|
|
|
+ teer.update_time as auditingTime,
|
|
|
+ tbu.name as applyName,
|
|
|
+ tbu1.name as auditingName,
|
|
|
+ if(teer.auditing_status = 0,'通过','不通过') as auditingStatusStr
|
|
|
from
|
|
|
- t_e_exam_reexam teer
|
|
|
+ t_e_exam_reexam teer
|
|
|
left join t_e_exam_student tees on
|
|
|
- tees.id = teer.exam_student_id
|
|
|
+ tees.id = teer.exam_student_id
|
|
|
left join t_e_exam tee on
|
|
|
- tee.id = teer.exam_id
|
|
|
+ tee.id = teer.exam_id
|
|
|
left join t_e_exam_activity teea on
|
|
|
- teea.id = teer.exam_activity_id
|
|
|
+ teea.id = teer.exam_activity_id
|
|
|
left join t_b_user tbu on
|
|
|
- tbu.id = teer.create_id
|
|
|
+ tbu.id = teer.create_id
|
|
|
left join t_b_user tbu1 on
|
|
|
- tbu1.id = teer.auditing_id
|
|
|
+ tbu1.id = teer.auditing_id
|
|
|
<where>
|
|
|
<if test="userId != null and userId !=''">
|
|
|
and teer.auditing_id = #{userId}
|
|
@@ -239,41 +242,41 @@
|
|
|
</where>
|
|
|
order by tees.room_code
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="getExamReexamPage" resultType="com.qmth.themis.business.bean.backend.ExamReexamListBean">
|
|
|
- SELECT
|
|
|
- f.exam_student_id examStudentId,
|
|
|
- t.exam_id examId,
|
|
|
- t.exam_activity_id examActivityId,
|
|
|
- t.room_code roomCode,
|
|
|
- t.course_code courseCode,
|
|
|
- t.course_name courseName,
|
|
|
- t.NAME,
|
|
|
- t.identity,
|
|
|
- t.room_name roomName
|
|
|
- FROM
|
|
|
- t_e_exam_reexam f
|
|
|
- LEFT JOIN t_e_exam_student t ON f.exam_student_id = t.id
|
|
|
- left join t_e_student h on t.student_id=h.id
|
|
|
- where f.exam_id =#{examId}
|
|
|
- <if test="orgId != null">
|
|
|
- and h.org_id=#{orgId}
|
|
|
- </if>
|
|
|
- <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>
|
|
|
- <if test="identity != null and identity != ''">
|
|
|
- and t.identity like concat(#{identity},'%')
|
|
|
- </if>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and t.name like concat(#{name},'%')
|
|
|
- </if>
|
|
|
- GROUP BY f.exam_student_id
|
|
|
- </select>
|
|
|
+ SELECT
|
|
|
+ f.exam_student_id examStudentId,
|
|
|
+ t.exam_id examId,
|
|
|
+ t.exam_activity_id examActivityId,
|
|
|
+ t.room_code roomCode,
|
|
|
+ t.course_code courseCode,
|
|
|
+ t.course_name courseName,
|
|
|
+ t.NAME,
|
|
|
+ t.identity,
|
|
|
+ t.room_name roomName
|
|
|
+ FROM
|
|
|
+ t_e_exam_reexam f
|
|
|
+ LEFT JOIN t_e_exam_student t ON f.exam_student_id = t.id
|
|
|
+ left join t_e_student h on t.student_id=h.id
|
|
|
+ where f.exam_id =#{examId}
|
|
|
+ <if test="orgId != null">
|
|
|
+ and h.org_id=#{orgId}
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ <if test="identity != null and identity != ''">
|
|
|
+ and t.identity like concat(#{identity},'%')
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and t.name like concat(#{name},'%')
|
|
|
+ </if>
|
|
|
+ GROUP BY f.exam_student_id
|
|
|
+ </select>
|
|
|
</mapper>
|