Browse Source

小组课

zouxuan 7 months ago
parent
commit
3d17f7093b

+ 4 - 5
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml

@@ -343,12 +343,12 @@
         cssp.order_no_ as orderNo,
         sa.id_ as studentAttendanceId
         from course_schedule cs
-        left join course_schedule_student_payment cssp on cs.id_ = cssp.course_id_
-        left join student_attendance sa on cssp.course_id_ = sa.course_schedule_id_
+        left join course_schedule_student_payment cssp on cs.id_ = cssp.course_id_ and #{param.studentId} = cssp.user_id_
+        left join student_attendance sa on cs.id_ = sa.course_schedule_id_ and #{param.studentId} = sa.student_id_
         <where>
-            cs.status_ !=  '${@ com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum@CANCEL}'
+            cs.status_ !=  '${@com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum@CANCEL}'
             <if test="param.studentId != null">
-                and cssp.user_id_ = #{param.studentId}
+                and cssp.user_id_ = #{param.studentId} and #{param.studentId} = sa.student_id_
             </if>
             <if test="param.status != null">
                 <choose>
@@ -357,7 +357,6 @@
                     </when>
                     <when test="param.status == @com.yonge.cooleshow.biz.dal.enums.StudentCourseEnum@ATTENDCLASS">
                         and sa.id_ is not null
-                        and #{param.studentId} = sa.student_id_
                     </when>
                     <when test="param.status == @com.yonge.cooleshow.biz.dal.enums.StudentCourseEnum@NOTSTART">
                         and cs.status_ = '${@ com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum@NOT_START}'