|
@@ -1835,4 +1835,41 @@
|
|
|
group by toer.id
|
|
|
having count(toea.id) = 0
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="cleanExamFirstPrepareCache" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ a.*
|
|
|
+ from
|
|
|
+ (
|
|
|
+ select
|
|
|
+ tes.id as studentId,
|
|
|
+ toer.id as examRecordId,
|
|
|
+ DATE_FORMAT(FROM_UNIXTIME(toer.first_prepare_time / 1000), '%Y-%m-%d %H:%i:%s') as 'firstPrepareTime',
|
|
|
+ DATE_FORMAT(FROM_UNIXTIME(toer.finish_time / 1000), '%Y-%m-%d %H:%i:%s') as 'finishTime',
|
|
|
+ DATE_FORMAT(FROM_UNIXTIME(toer.first_start_time / 1000), '%Y-%m-%d %H:%i:%s') as 'firstStartTime',
|
|
|
+ DATE_FORMAT(FROM_UNIXTIME(toer.start_time / 1000), '%Y-%m-%d %H:%i:%s') as 'startTime',
|
|
|
+ DATE_FORMAT(FROM_UNIXTIME(toer.end_time / 1000), '%Y-%m-%d %H:%i:%s') as 'endTime'
|
|
|
+ from
|
|
|
+ t_oe_exam_record toer
|
|
|
+ join t_e_exam_student tees on tees.id = toer.exam_student_id
|
|
|
+ join t_e_student tes on tes.id = tees.student_id
|
|
|
+ <where>
|
|
|
+ toer.status = 'FIRST_PREPARE'
|
|
|
+ <if test="examIds != null and examIds != ''">
|
|
|
+ and toer.exam_id in
|
|
|
+ <foreach collection="examIds" item="examId" index="index" open="(" close=")" separator=",">
|
|
|
+ #{examId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and toer.first_prepare_time is not null
|
|
|
+ and toer.first_start_time is null
|
|
|
+ and toer.finish_time is null
|
|
|
+ and (toer.objective_score is null
|
|
|
+ or toer.objective_score = 0)
|
|
|
+ </where>
|
|
|
+ group by
|
|
|
+ toer.id
|
|
|
+ having
|
|
|
+ count(toer.id) > 0) a;
|
|
|
+ </select>
|
|
|
</mapper>
|