|
@@ -496,13 +496,12 @@
|
|
CASE WHEN sa.status_ IS NULL THEN 'TRUANT' ELSE sa.status_ END status_,
|
|
CASE WHEN sa.status_ IS NULL THEN 'TRUANT' ELSE sa.status_ END status_,
|
|
su.username_,su.phone_,su.avatar_,cs.teach_mode_,cs.type_ course_type_,o.name_ organ_name_,tu.real_name_ teacher_name_,cs.name_ course_schedule_name_,cs.status_ course_status_,
|
|
su.username_,su.phone_,su.avatar_,cs.teach_mode_,cs.type_ course_type_,o.name_ organ_name_,tu.real_name_ teacher_name_,cs.name_ course_schedule_name_,cs.status_ course_status_,
|
|
cs.actual_teacher_id_ teacher_id_,cs.class_date_ ,cs.start_class_time_,cs.end_class_time_ ,cs.new_course_id_,
|
|
cs.actual_teacher_id_ teacher_id_,cs.class_date_ ,cs.start_class_time_,cs.end_class_time_ ,cs.new_course_id_,
|
|
- CASE WHEN MAX(sv.id_) IS NULL THEN 0 ELSE 1 END visitFlag
|
|
|
|
|
|
+ CASE WHEN sa.visit_flag_ IS NULL THEN 0 ELSE sa.visit_flag_ END visitFlag
|
|
FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
|
|
FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
|
|
left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
|
|
left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
|
|
LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
|
|
LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
|
|
left join sys_user tu on tu.id_ = cs.actual_teacher_id_
|
|
left join sys_user tu on tu.id_ = cs.actual_teacher_id_
|
|
left join organization o on o.id_ = cs.organ_id_
|
|
left join organization o on o.id_ = cs.organ_id_
|
|
- LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
|
|
|
|
<include refid="findStudentAttendanceSql"/>
|
|
<include refid="findStudentAttendanceSql"/>
|
|
GROUP BY cssp.id_
|
|
GROUP BY cssp.id_
|
|
ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) ASC
|
|
ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) ASC
|
|
@@ -513,10 +512,10 @@
|
|
cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
|
|
cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
|
|
<if test="visitFlag != null">
|
|
<if test="visitFlag != null">
|
|
<if test="visitFlag == 1">
|
|
<if test="visitFlag == 1">
|
|
- AND sv.id_ IS NOT NULL
|
|
|
|
|
|
+ AND sa.visit_flag_ = 1
|
|
</if>
|
|
</if>
|
|
<if test="visitFlag == 0">
|
|
<if test="visitFlag == 0">
|
|
- AND sv.id_ IS NULL
|
|
|
|
|
|
+ AND (sa.visit_flag_ = 0 OR sa.visit_flag_ IS NULL)
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
<if test="courseScheduleId != null">
|
|
<if test="courseScheduleId != null">
|
|
@@ -570,7 +569,6 @@
|
|
FROM course_schedule_student_payment cssp
|
|
FROM course_schedule_student_payment cssp
|
|
left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
|
|
left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
|
|
left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
|
|
left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
|
|
- LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
|
|
|
|
<include refid="findStudentAttendanceSql"/>
|
|
<include refid="findStudentAttendanceSql"/>
|
|
</select>
|
|
</select>
|
|
<select id="findByCourseId" resultMap="StudentAttendance">
|
|
<select id="findByCourseId" resultMap="StudentAttendance">
|