|
@@ -822,7 +822,7 @@
|
|
|
<sql id="queryStudentCourseScheduleRecordCondition">
|
|
|
<where>
|
|
|
(cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
|
|
|
- AND sa.user_id_=#{userId}
|
|
|
+ AND cssp.user_id_=#{userId}
|
|
|
AND cs.status_ != 'NOT_START'
|
|
|
<if test="teachMode!=null and teachMode!=''">
|
|
|
AND cs.teach_mode_=#{teachMode}
|
|
@@ -830,8 +830,11 @@
|
|
|
<if test="type!=null and type!=''">
|
|
|
AND cs.group_type_ = #{type}
|
|
|
</if>
|
|
|
- <if test="status!=null and status!=''">
|
|
|
- AND sa.status_=#{status}
|
|
|
+ <if test="status != null and status != 'TRUANT'">
|
|
|
+ AND sa.status_ = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status = 'TRUANT'">
|
|
|
+ AND (sa.status_ = #{status} OR sa.status_ IS NULL)
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
@@ -839,7 +842,7 @@
|
|
|
<select id="findStudentCourseScheduleRecords" resultMap="studentCourseScheduleRecord">
|
|
|
SELECT
|
|
|
sa.id_,
|
|
|
- sa.status_,
|
|
|
+ IF(sa.status_ IS NULL,'TRUANT',sa.status_) status_,
|
|
|
sa.teacher_id_,
|
|
|
su.username_,
|
|
|
cs.id_ course_schedule_id_,
|
|
@@ -849,8 +852,8 @@
|
|
|
CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
|
|
|
cs.teacher_id_,
|
|
|
cs.teach_mode_
|
|
|
- FROM
|
|
|
- student_attendance sa
|
|
|
+ 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 course_schedule cs ON sa.course_schedule_id_=cs.id_
|
|
|
LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
|
|
|
<include refid="queryStudentCourseScheduleRecordCondition"/>
|
|
@@ -859,9 +862,9 @@
|
|
|
</select>
|
|
|
<select id="countStudentCourseScheduleRecords" resultType="int">
|
|
|
SELECT
|
|
|
- count(*)
|
|
|
- FROM
|
|
|
- student_attendance sa
|
|
|
+ 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 course_schedule cs ON sa.course_schedule_id_=cs.id_
|
|
|
LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
|
|
|
<include refid="queryStudentCourseScheduleRecordCondition"/>
|
|
@@ -1882,13 +1885,13 @@
|
|
|
<where>
|
|
|
<if test="search != null">
|
|
|
AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search}
|
|
|
- <if test="groups != null and organIdList==null">
|
|
|
+ <if test="groups != null and groupId==null">
|
|
|
OR cs.music_group_id_ IN
|
|
|
<foreach collection="groups" item="group" open="(" close=")" separator=",">
|
|
|
#{group.id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="courseIds != null and organIdList==null">
|
|
|
+ <if test="courseIds != null and groupId==null">
|
|
|
OR cs.id_ IN
|
|
|
<foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
|
|
|
#{courseId}
|
|
@@ -1896,13 +1899,13 @@
|
|
|
</if>
|
|
|
)
|
|
|
</if>
|
|
|
- <if test="groups != null and organIdList!=null">
|
|
|
+ <if test="groups != null and groupId!=null">
|
|
|
AND cs.music_group_id_ IN
|
|
|
<foreach collection="groups" item="group" open="(" close=")" separator=",">
|
|
|
#{group.id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="courseIds != null and organIdList!=null">
|
|
|
+ <if test="courseIds != null and groupId!=null">
|
|
|
AND cs.id_ IN
|
|
|
<foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
|
|
|
#{courseId}
|