|
@@ -246,7 +246,7 @@
|
|
|
<select id="countStudentCourses" resultType="int">
|
|
|
SELECT count(*) FROM class_group cg
|
|
|
LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
|
|
|
- LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
|
|
|
+ LEFT JOIN course_schedule cs ON cg.id_ = cs.class_group_id_
|
|
|
LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
|
|
|
<include refid="studentManageCourseQueryCondition"/>
|
|
|
</select>
|
|
@@ -256,14 +256,17 @@
|
|
|
(cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
|
|
|
AND CONCAT(cs.class_date_," ",cs.start_class_time_) < NOW()
|
|
|
<if test="studentId!=null">
|
|
|
- and sa.user_id_ = #{studentId}
|
|
|
+ and cssp.user_id_ = #{studentId}
|
|
|
</if>
|
|
|
<if test="classGroupType!=null">
|
|
|
and cg.type_ = #{classGroupType}
|
|
|
</if>
|
|
|
- <if test="attendanceStatus!=null">
|
|
|
+ <if test="attendanceStatus != null and attendanceStatus != 'TRUANT'">
|
|
|
and sa.status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
|
+ <if test="attendanceStatus != null and attendanceStatus == 'TRUANT'">
|
|
|
+ and (sa.status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} OR sa.status_ IS NULL)
|
|
|
+ </if>
|
|
|
<if test="classGroupName!=null">
|
|
|
and cg.name_ like CONCAT("%",#{classGroupName},"%")
|
|
|
</if>
|
|
@@ -280,14 +283,14 @@
|
|
|
cg.type_ class_group_type_,
|
|
|
CONCAT(cs.class_date_," ",cs.start_class_time_) course_date_,
|
|
|
su.real_name_ teacher_name_,
|
|
|
- sa.status_,
|
|
|
+ IF(sa.status_ IS NULL,'TRUANT',sa.status_) status_,
|
|
|
sa.current_class_times_,
|
|
|
cg.total_class_times_
|
|
|
- FROM
|
|
|
- student_attendance sa
|
|
|
- LEFT JOIN class_group cg ON sa.class_group_id_=cg.id_
|
|
|
- LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
|
|
|
- LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
|
|
|
+ FROM course_schedule_student_payment cssp
|
|
|
+ LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
|
|
|
+ LEFT JOIN class_group cg ON cssp.class_group_id_ = cg.id_
|
|
|
+ LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
|
|
|
+ LEFT JOIN sys_user su ON cs.actual_teacher_id_ = su.id_
|
|
|
<include refid="studentManageAttendanceQueryCondition"/>
|
|
|
ORDER BY course_date_ DESC
|
|
|
<include refid="global.limit"/>
|
|
@@ -295,12 +298,12 @@
|
|
|
|
|
|
<select id="countStudentAttendances" resultType="int">
|
|
|
SELECT
|
|
|
- count(*)
|
|
|
- FROM
|
|
|
- student_attendance sa
|
|
|
- LEFT JOIN class_group cg ON sa.class_group_id_=cg.id_
|
|
|
- LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
|
|
|
- LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
|
|
|
+ count(cssp.id_)
|
|
|
+ FROM course_schedule_student_payment cssp
|
|
|
+ LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
|
|
|
+ LEFT JOIN class_group cg ON cssp.class_group_id_ = cg.id_
|
|
|
+ LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
|
|
|
+ LEFT JOIN sys_user su ON sa.teacher_id_ = su.id_
|
|
|
<include refid="studentManageAttendanceQueryCondition"/>
|
|
|
</select>
|
|
|
|
|
@@ -332,7 +335,7 @@
|
|
|
</resultMap>
|
|
|
<select id="queryStudentPayment" resultMap="StudentPaymentDto">
|
|
|
SELECT cs.class_date_,cs.start_class_time_,cs.type_ class_group_type_ ,cg.name_ class_group_name_,
|
|
|
- cg.total_class_times_,sa.current_class_times_,sa.status_,cssp.expect_price_,cssp.actual_price_
|
|
|
+ cg.total_class_times_,sa.current_class_times_,IF(sa.status_ IS NULL,'TRUANT',sa.status_) status_,cssp.expect_price_,cssp.actual_price_
|
|
|
FROM course_schedule_student_payment cssp
|
|
|
LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
|
|
|
LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
|