|
@@ -565,12 +565,12 @@
|
|
|
LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
|
|
|
LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
|
|
|
WHERE
|
|
|
- cs.status_ = 'OVER' AND sv.id_ IS NULL
|
|
|
+ cs.status_ = 'OVER' AND sv.id_ IS NULL AND cs.del_flag_ = 0
|
|
|
<if test="type!=null and type=='LEAVE'">
|
|
|
AND sa.status_ = 'LEAVE'
|
|
|
</if>
|
|
|
<if test="type!=null and type=='TRUANT'">
|
|
|
- AND (sa.status_ = 'TRUANT' OR sa.id_ IS NULL)
|
|
|
+ AND (sa.status_ = 'TRUANT' OR sa.id_ IS NULL) AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
|
|
|
</if>
|
|
|
<if test="firstDayOfMonth != null">
|
|
|
AND cs.class_date_ >= DATE_FORMAT(#{firstDayOfMonth},'%Y-%m-%d')
|
|
@@ -585,7 +585,7 @@
|
|
|
<select id="getAttendanceError" resultType="java.lang.Long">
|
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
|
LEFT JOIN course_schedule cs ON ta.course_schedule_id_ = cs.id_
|
|
|
- WHERE (ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND cs.status_ = 'OVER'
|
|
|
+ WHERE (ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
|
|
|
AND (ta.sign_in_time_ IS NOT NULL OR ta.sign_out_time_ IS NOT NULL) AND ta.dispose_content_ IS NULL
|
|
|
<if test="organIds != null and organIds != ''">
|
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
@@ -598,6 +598,7 @@
|
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
|
LEFT JOIN course_schedule cs ON ta.course_schedule_id_ = cs.id_
|
|
|
WHERE ta.sign_in_time_ IS NULL AND cs.status_ = 'OVER' AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
|
|
|
+ AND cs.del_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
|
|
|
<if test="organIds != null and organIds != ''">
|
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
|
</if>
|