Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

Joburgess 5 anni fa
parent
commit
5952245dc0

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -2066,7 +2066,7 @@
         SELECT cs.id_ FROM course_schedule cs
         LEFT JOIN vip_group vg ON cs.music_group_id_ = vg.id_
         LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
-        WHERE cs.group_type_ = 'VIP' AND vg.group_status_  = '2' AND cs.del_flag_ = 0 AND cg.del_flag_ = 0
+        WHERE cs.group_type_ = 'VIP' AND vg.group_status_ IN(2,4) AND cs.del_flag_ = 0 AND cg.del_flag_ = 0
         <if test="search != null and search != ''">
             AND (vg.id_ = #{search} OR vg.name_ LIKE CONCAT('%',#{search},'%')
             OR cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%')

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml

@@ -280,7 +280,7 @@
     <select id="findStudentCourseHomeworks" resultMap="StudentCourseHomeworkDtoMap">
         SELECT sch.attachments_,sch.is_replied_,sch.is_view_,sch.create_time_,su.username_,su.phone_,s.name_ subject_name_
         FROM course_schedule_student_payment cssp
-        LEFT JOIN student_course_homework sch ON sch.course_schedule_id_ = cssp.course_schedule_id_
+        LEFT JOIN student_course_homework sch ON sch.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sch.user_id_
         LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
         LEFT JOIN student_registration sr ON cssp.music_group_id_ = sr.music_group_id_ AND cssp.user_id_ = sr.user_id_
         LEFT JOIN `subject` s ON s.id_ = sr.actual_subject_id_

+ 19 - 16
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -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_) &lt; 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_