|
|
@@ -31,6 +31,7 @@
|
|
|
<result column="teacher_name_" property="courseSchedule.teacherName"/>
|
|
|
<result column="teach_mode_" property="courseSchedule.teachMode"/>
|
|
|
<result column="course_type_" property="courseSchedule.type"/>
|
|
|
+ <result column="course_status_" property="courseSchedule.status"/>
|
|
|
<result column="current_schedule_id_" property="courseSchedule.id"/>
|
|
|
<result column="course_schedule_name_" property="courseSchedule.name"/>
|
|
|
<result column="class_date_" property="courseSchedule.classDate"/>
|
|
|
@@ -483,66 +484,90 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findStudentAttendance" resultMap="StudentAttendance">
|
|
|
- SELECT sa.*,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.class_date_ ,cs.start_class_time_,cs.end_class_time_
|
|
|
- FROM student_attendance sa
|
|
|
- LEFT JOIN sys_user su ON sa.user_id_ = su.id_
|
|
|
- left join course_schedule cs on cs.id_ = sa.course_schedule_id_
|
|
|
+ SELECT cssp.course_schedule_id_,cssp.user_id_,cssp.group_type_,cssp.music_group_id_,sa.sign_in_time_,sa.sign_out_time_,sa.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_
|
|
|
+ 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_
|
|
|
+ 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_
|
|
|
<where>
|
|
|
<if test="courseScheduleId != null">
|
|
|
- sa.course_schedule_id_ = #{courseScheduleId}
|
|
|
+ cssp.course_schedule_id_ = #{courseScheduleId}
|
|
|
</if>
|
|
|
<if test="search != null">
|
|
|
- sa.course_schedule_id_ = #{search}
|
|
|
+ cssp.course_schedule_id_ = #{search}
|
|
|
</if>
|
|
|
<if test="studentID != null">
|
|
|
- and sa.user_id_ = #{studentID}
|
|
|
+ and cssp.user_id_ = #{studentID}
|
|
|
+ </if>
|
|
|
+ <if test="startDateOfCourse != null">
|
|
|
+ and cs.class_date_ >= #{startDateOfCourse}
|
|
|
+ </if>
|
|
|
+ <if test="endDateOfCourse != null">
|
|
|
+ and cs.class_date_ <= #{endDateOfCourse}
|
|
|
</if>
|
|
|
<if test="courseScheduleType != null">
|
|
|
and cs.type_ = #{courseScheduleType}
|
|
|
</if>
|
|
|
<if test="teacherId != null">
|
|
|
- and sa.teacher_id_ = #{teacherId}
|
|
|
+ and cs.actual_teacher_id_.teacher_id_ = #{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="courseStatus != null">
|
|
|
+ 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}
|
|
|
</if>
|
|
|
<if test="groupType != null">
|
|
|
- and sa.group_type_ = #{groupType}
|
|
|
+ and cssp.group_type_ = #{groupType}
|
|
|
</if>
|
|
|
<if test="musicGroupId != null">
|
|
|
- and sa.music_group_id_ = #{musicGroupId}
|
|
|
+ and cssp.music_group_id_ = #{musicGroupId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- ORDER BY sa.id_ DESC
|
|
|
+ ORDER BY cs.id_ DESC
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="countStudentAttendance" resultType="java.lang.Integer">
|
|
|
- SELECT COUNT(sa.id_) FROM student_attendance sa left join course_schedule cs on sa.course_schedule_id_ = cs.id_
|
|
|
+ SELECT count(cssp.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_
|
|
|
<where>
|
|
|
<if test="courseScheduleId != null">
|
|
|
- sa.course_schedule_id_ = #{courseScheduleId}
|
|
|
+ cssp.course_schedule_id_ = #{courseScheduleId}
|
|
|
+ </if>
|
|
|
+ <if test="search != null">
|
|
|
+ cssp.course_schedule_id_ = #{search}
|
|
|
</if>
|
|
|
<if test="studentID != null">
|
|
|
- and sa.user_id_ = #{studentID}
|
|
|
+ and cssp.user_id_ = #{studentID}
|
|
|
+ </if>
|
|
|
+ <if test="startDateOfCourse != null">
|
|
|
+ and cs.class_date_ >= #{startDateOfCourse}
|
|
|
+ </if>
|
|
|
+ <if test="endDateOfCourse != null">
|
|
|
+ and cs.class_date_ <= #{endDateOfCourse}
|
|
|
</if>
|
|
|
<if test="courseScheduleType != null">
|
|
|
and cs.type_ = #{courseScheduleType}
|
|
|
</if>
|
|
|
<if test="teacherId != null">
|
|
|
- and sa.teacher_id_ = #{teacherId}
|
|
|
+ and cs.actual_teacher_id_.teacher_id_ = #{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="courseStatus != null">
|
|
|
+ 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}
|
|
|
</if>
|
|
|
<if test="groupType != null">
|
|
|
- and sa.group_type_ = #{groupType}
|
|
|
+ and cssp.group_type_ = #{groupType}
|
|
|
</if>
|
|
|
<if test="musicGroupId != null">
|
|
|
- and sa.music_group_id_ = #{musicGroupId}
|
|
|
+ and cssp.music_group_id_ = #{musicGroupId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|