Forráskód Böngészése

1、教师端课程列表上的学员精确到课程上

Joburgess 5 éve
szülő
commit
c5d001c791

+ 14 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -1,12 +1,5 @@
 package com.ym.mec.biz.dal.dao;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import org.apache.ibatis.annotations.Param;
-
 import com.ym.mec.biz.dal.dto.StudentAttendanceViewDto;
 import com.ym.mec.biz.dal.dto.TeacherClassStudentDto;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
@@ -15,6 +8,11 @@ import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStudentMapper> {
     /**
@@ -69,6 +67,15 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     String[] findStudentNumByClassGroupId(@Param("classGroupId") Long classGroupId);
 
     /**
+     * @describe 获取课程上的学员名称集合
+     * @author Joburgess
+     * @date 2019/12/4
+     * @param courseScheduleId:
+     * @return java.lang.String[]
+     */
+    String[] findCourseStudentName(@Param("courseScheduleId") Integer courseScheduleId);
+
+    /**
      * @param params:
      * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherClassStudentDto>
      * @describe 获取班级学生

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

@@ -342,7 +342,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				courseScheduleDto.setStatus(CourseStatusEnum.UNDERWAY);
 			}
 			if(Objects.nonNull(courseScheduleDto.getClassGroupId())){
-				String[] studentNums = classGroupStudentMapperDao.findStudentNumByClassGroupId(courseScheduleDto.getClassGroupId().longValue());
+				String[] studentNums = classGroupStudentMapperDao.findCourseStudentName(courseScheduleDto.getId().intValue());
 				courseScheduleDto.setStudentNames(org.apache.commons.lang3.StringUtils.join(studentNums, ","));
 			}
 			courseScheduleDto.setSubjectName(subjectNameCourseMap.get(courseScheduleDto.getId()));

+ 10 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -94,6 +94,16 @@
             WHERE cgsm.class_group_id_=#{classGroupId} AND cgsm.status_!='QUIT'
     </select>
 
+    <select id="findCourseStudentName" resultType="string">
+        SELECT
+            su.username_
+        FROM
+            course_schedule_student_payment cssp
+            LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
+        WHERE
+            cssp.course_schedule_id_ = #{courseScheduleId}
+    </select>
+
     <resultMap id="teacherClassStudentDto" type="com.ym.mec.biz.dal.dto.TeacherClassStudentDto">
         <result property="userId" column="user_id_"/>
         <result property="userName" column="username_"/>

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

@@ -1226,7 +1226,7 @@
         FROM
             course_schedule cs left join class_group cg on cs.class_group_id_ = cg.id_
         WHERE (cs.class_date_ BETWEEN DATE_FORMAT(#{startTime},'%Y%m%d') AND DATE_FORMAT(#{endTime},'%Y%m%d'))
-            AND cs.del_flag_!=1 AND cg.del_flag_!=1
+            AND (cs.del_flag_ IS NULL OR cs.del_flag_=0) AND (cg.del_flag_ IS NULL OR cg.del_flag_=0)
     </select>
     
     <select id="queryStudentCoursesTimesOfTomorrow" resultMap="Mapper">