|
@@ -740,12 +740,14 @@
|
|
<select id="getAttendanceError" resultType="int">
|
|
<select id="getAttendanceError" resultType="int">
|
|
SELECT COUNT(DISTINCT c.id_) FROM (SELECT cs.id_ FROM course_schedule cs
|
|
SELECT COUNT(DISTINCT c.id_) FROM (SELECT cs.id_ FROM course_schedule cs
|
|
LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
|
|
LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
|
|
- LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
|
|
|
|
|
|
+ LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
|
|
+ LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
|
|
WHERE ta.teacher_id_ = cs.actual_teacher_id_
|
|
WHERE ta.teacher_id_ = cs.actual_teacher_id_
|
|
- AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>='2021-02-01'
|
|
|
|
- AND (ta.sign_in_status_ != 1 OR ta.sign_out_status_ != 1 OR sa.status_ != 'NORMAL') AND ta.dispose_content_ IS NULL
|
|
|
|
|
|
+ AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= '2021-02-01'
|
|
|
|
+ AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
|
|
|
|
+ AND (ta.dispose_content_ IS NOT NULL OR (ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL))
|
|
AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
|
|
AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
|
|
- <if test="organIds!=null and organIds.size() > 0">
|
|
|
|
|
|
+ <if test="organIds != null and organIds.size()>0">
|
|
AND cs.organ_id_ IN
|
|
AND cs.organ_id_ IN
|
|
<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
|
|
<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
|
|
#{organId}
|
|
#{organId}
|