瀏覽代碼

bug修改

zouxuan 3 年之前
父節點
當前提交
15209bbc16

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -849,4 +849,11 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     int countCourseNum(@Param("classGroupId") Integer classGroupId, @Param("teachMode") String teachMode);
     
     List<Mapper> countTeacherByMusicGroupId(String musicGroupId);
+
+    /**
+     * 获取学员班级列表map
+     * @param musicGroupId
+     * @return
+     */
+    List<Map<Integer, String>> queryStudentClassGroupMap(String musicGroupId);
 }

+ 6 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -864,7 +864,12 @@ public class StudentManageServiceImpl implements StudentManageService {
 
     @Override
     public List<StudentSubTotalCourseTimesDto> queryStudentSubTotalCourseTimes(String musicGroupId) {
-        return musicGroupPaymentStudentCourseDetailDao.queryStudentSubTotalCourseTimes(musicGroupId);
+        List<StudentSubTotalCourseTimesDto> timesDtos = musicGroupPaymentStudentCourseDetailDao.queryStudentSubTotalCourseTimes(musicGroupId);
+        Map<Integer,String> classMap = MapUtil.convertMybatisMap(classGroupDao.queryStudentClassGroupMap(musicGroupId));
+        for (StudentSubTotalCourseTimesDto timesDto : timesDtos) {
+            timesDto.setClassGroupId(classMap.get(timesDto.getUserId()));
+        }
+        return timesDtos;
     }
 
     @Override

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -1540,4 +1540,9 @@
 		LEFT JOIN sys_user u on u.id_ = cgtm.user_id_
 		where cg.del_flag_ = 0 and cg.group_type_ = 'MUSIC' and cg.music_group_id_ = #{musicGroupId}  group by cg.id_ order by cg.type_
     </select>
+    <select id="queryStudentClassGroupMap" resultType="java.util.Map">
+        SELECT user_id_ 'key',GROUP_CONCAT(class_group_id_) 'value' FROM class_group_student_mapper
+        WHERE music_group_id_ = #{musicGroupId} AND status_ = 'NORMAL'
+        GROUP BY user_id_
+    </select>
 </mapper>

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

@@ -257,10 +257,9 @@
     </resultMap>
     <select id="queryStudentSubTotalCourseTimes" resultMap="StudentSubTotalCourseTimesDto">
         SELECT mgpscd.user_id_,su.username_,su.phone_,mgpscd.course_type_ 'key',
-               SUM(CASE WHEN mgpscd.used_course_minutes_ = 0 THEN mgpscd.total_course_minutes_ ELSE 0 END) 'value',GROUP_CONCAT(DISTINCT cgsm.class_group_id_) class_group_id_
+               SUM(CASE WHEN mgpscd.used_course_minutes_ = 0 THEN mgpscd.total_course_minutes_ ELSE 0 END) 'value'
         FROM music_group_payment_student_course_detail mgpscd
         LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpscd.music_group_payment_calender_id_
-        LEFT JOIN class_group_student_mapper cgsm ON cgsm.music_group_id_ = mgpc.music_group_id_ AND cgsm.status_ = 'NORMAL' AND mgpscd.user_id_ = cgsm.user_id_
         LEFT JOIN sys_user su ON su.id_ = mgpscd.user_id_
         WHERE mgpc.music_group_id_ = #{musicGroupId}
         GROUP BY mgpscd.user_id_,mgpscd.course_type_