|
@@ -494,38 +494,48 @@
|
|
|
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 organization o on o.id_ = cs.organ_id_
|
|
|
+ LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
|
|
|
<include refid="findStudentAttendanceSql"/>
|
|
|
ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
|
<sql id="findStudentAttendanceSql">
|
|
|
<where>
|
|
|
+ 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 == 1">
|
|
|
+ AND sv.id_ IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test="visitFlag == 0">
|
|
|
+ AND sv.id_ IS NULL
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
<if test="courseScheduleId != null">
|
|
|
- cssp.course_schedule_id_ = #{courseScheduleId}
|
|
|
+ AND cssp.course_schedule_id_ = #{courseScheduleId}
|
|
|
</if>
|
|
|
<if test="search != null">
|
|
|
- and cssp.course_schedule_id_ = #{search}
|
|
|
+ AND cssp.course_schedule_id_ = #{search}
|
|
|
</if>
|
|
|
<if test="studentID != null">
|
|
|
- and cssp.user_id_ = #{studentID}
|
|
|
+ AND cssp.user_id_ = #{studentID}
|
|
|
</if>
|
|
|
<if test="startDateOfCourse != null">
|
|
|
- and cs.class_date_ >= #{startDateOfCourse}
|
|
|
+ AND cs.class_date_ >= #{startDateOfCourse}
|
|
|
</if>
|
|
|
<if test="endDateOfCourse != null">
|
|
|
- and cs.class_date_ <= #{endDateOfCourse}
|
|
|
+ AND cs.class_date_ <= #{endDateOfCourse}
|
|
|
</if>
|
|
|
<if test="courseScheduleType != null">
|
|
|
- and cs.type_ = #{courseScheduleType}
|
|
|
+ AND cs.type_ = #{courseScheduleType}
|
|
|
</if>
|
|
|
<if test="teacherId != null">
|
|
|
- and cs.actual_teacher_id_ = #{teacherId}
|
|
|
+ AND cs.actual_teacher_id_ = #{teacherId}
|
|
|
</if>
|
|
|
<if test="courseStatus != null">
|
|
|
- and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
- and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ AND (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
<if test="status.code == 'TRUANT'">
|
|
|
OR sa.id_ IS NULL
|
|
|
</if>
|
|
@@ -551,6 +561,7 @@
|
|
|
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_visit sv ON cssp.id_ = sv.object_id_
|
|
|
<include refid="findStudentAttendanceSql"/>
|
|
|
</select>
|
|
|
<select id="findByCourseId" resultMap="StudentAttendance">
|