浏览代码

fix:首页改版、学生服务指标更新、学生应交奋勇更新延迟优化

Joburgess 4 年之前
父节点
当前提交
e4d225c952

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -400,7 +400,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @date 2020/12/2 0002
      * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleStudentPaymentDto>
      */
-    List<CourseScheduleStudentPaymentDto> findNeedUpdateActualPriceStudentCourses();
+    List<CourseScheduleStudentPaymentDto> findNeedUpdateActualPriceStudentCourses(@Param("courseIds") List<Long> courseIds);
 
     /**
      * 根据课程编号和,学员编号获取列表信息

+ 39 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -1,7 +1,9 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.IndexDataType;
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.poi.ss.formula.functions.Index;
@@ -39,19 +41,52 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @describe 统计系统中指定时间段的学员注册数据
      * @author Joburgess
      * @date 2021/1/7 0007
-     * @param startMonth:
+     * @param month:
      * @return java.util.List<com.ym.mec.biz.dal.dto.IndexBaseMonthDto>
      */
-    List<IndexBaseMonthData> getStudentSignUpData(@Param("startMonth") String startMonth);
+    List<IndexBaseMonthData> getStudentSignUpData(@Param("month") String month);
 
     /**
      * @describe 统计作业布置数据
      * @author Joburgess
      * @date 2021/1/7 0007
-     * @param startMonth:
+     * @param month:
      * @return java.util.List<com.ym.mec.biz.dal.dto.IndexBaseMonthDto>
      */
-    List<IndexBaseMonthData> getHomeworkDate(@Param("startMonth") String startMonth,
+    List<IndexBaseMonthData> getHomeworkData(@Param("month") String month,
                                              @Param("type") String type);
 
+    /**
+     * @describe 统计合作单位数据
+     * @author Joburgess
+     * @date 2021/1/11 0011
+     * @param month:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
+     */
+    List<IndexBaseMonthData> getSchoolData(@Param("month") String month);
+
+    /**
+     * @describe 统计乐团数据
+     * @author Joburgess
+     * @date 2021/1/11 0011
+     * @param month:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
+     */
+    List<IndexBaseMonthData> getMusicData(@Param("month") String month);
+
+    /**
+     * @describe 统计乐团学员数据
+     * @author Joburgess
+     * @date 2021/1/11 0011
+     * @param month:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
+     */
+    List<IndexBaseMonthData> getMusicStudentData(@Param("month") String month);
+
+    List<IndexBaseMonthData> getTeacherData(@Param("month") String month,
+                                            @Param("jobNature") JobNatureEnum jobNature,
+                                            @Param("isDemission") Boolean isDemission);
+
+    List<IndexBaseMonthData> getGroupCourseData(@Param("month") String month,
+                                                @Param("groupType")GroupType groupType);
 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java

@@ -11,22 +11,27 @@ public enum IndexDataType implements BaseEnum<String, IndexDataType> {
     MUSIC_GROUP_NUM("MUSIC_GROUP_NUM","乐团数量"),
     MUSIC_GROUP_STUDENT("MUSIC_GROUP_STUDENT","乐团学员"),
     OTHER_STUDENT("OTHER_STUDENT","其他学员"),
+
     ACTIVATION_RATE("ACTIVATION_RATE","激活率"),
     HOMEWORK_CREATE_RATE("HOMEWORK_CREATE_RATE","作业布置率"),
     HOMEWORK_SUBMIT_RATE("HOMEWORK_SUBMIT_RATE","作业提交率"),
     HOMEWORK_COMMENT_RATE("HOMEWORK_COMMENT_RATE","作业点评率"),
+
     SHOULD_INCOME_MONEY("SHOULD_INCOME_MONEY","应收金额"),
     ANTICIPATED_INCOME_MONEY("ANTICIPATED_INCOME_MONEY","预收金额"),
     SHOULD_EXPEND_MONEY("SHOULD_EXPEND_MONEY","预付金额"),
     ANTICIPATED_EXPEND_MONEY("ANTICIPATED_EXPEND_MONEY","应付金额"),
     REVENUE_MONEY("REVENUE_MONEY","营收金额"),
+
     TEACHER_NUM("TEACHER_NUM","老师总数"),
     FULL_TIME_NUM("FULL_TIME_NUM","全职人数"),
     PART_TIME_NUM("PART_TIME_NUM","兼职人数"),
     DIMISSION_NUM("DIMISSION_NUM","离职人数"),
+
     NEWLY_STUDENT_NUM("NEWLY_STUDENT_NUM","新增学员"),
     QUIT_MUSIC_GROUP_STUDENT_NUM("QUIT_MUSIC_GROUP_STUDENT_NUM","退团学员"),
     STUDENT_CONVERSION("STUDENT_CONVERSION","学员转化"),
+
     MUSIC_GROUP_COURSE("MUSIC_GROUP_COURSE","乐团课"),
     VIP_GROUP_COURSE("VIP_GROUP_COURSE","VIP课"),
     PRACTICE_GROUP_COURSE("PRACTICE_GROUP_COURSE","网管课");

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/event/listener/CourseEventListener.java

@@ -56,7 +56,7 @@ public class CourseEventListener {
         logger.info("课程状态变更(执行开始):{}", courseStatusChangeEvent.getCourseIds());
 
         try{
-            courseScheduleStudentPaymentService.updateCourseActualPrice();
+            courseScheduleStudentPaymentService.updateCourseActualPrice(new ArrayList<>(courseStatusChangeEvent.getCourseIds()));
         } finally {
             redisCache.delete(KEY);
         }

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

@@ -125,6 +125,6 @@ public interface CourseScheduleStudentPaymentService extends BaseService<Long, C
 	 * @date 2020/12/2 0002
 	 * @return void
 	 */
-	void updateCourseActualPrice();
+	void updateCourseActualPrice(List<Long> courseIds);
 
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1910,6 +1910,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //学生结算表
         if (courseScheduleList.size() > 0) {
             courseScheduleStudentPaymentService.createForMusicGroup(musicGroupId, courseScheduleList, studentIdList);
+            studentDao.updateStudentServiceTag(null, studentIdList, YesOrNoEnum.YES.getCode());
         }
         return classGroup;
     }
@@ -2631,6 +2632,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //学生结算表
         if (!CollectionUtils.isEmpty(studentIdList)) {
             courseScheduleStudentPaymentService.createForMusicGroup(musicGroupId, courseScheduleList, studentIdList);
+            studentDao.updateStudentServiceTag(null, studentIdList, YesOrNoEnum.YES.getCode());
         }
         return classGroup;
     }

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

@@ -4002,6 +4002,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     }
 
     @Override
+	@Transactional(rollbackFor = Exception.class)
 	public boolean updateCourseScheduleToUnderway() {
     	Date date = new Date();
     	List<CourseSchedule> list = courseScheduleDao.queryUnderwayWithNoUpdateStatus();
@@ -4016,7 +4017,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
         if (updateList.size() > 0) {
             courseScheduleDao.batchUpdate(updateList);
-        }
+			Set<Long> courseIds = updateList.stream().map(CourseSchedule::getId).collect(Collectors.toSet());
+			courseEventSource.courseStatusChange(courseIds);
+		}
 		return true;
 	}
 

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

@@ -691,8 +691,8 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void updateCourseActualPrice() {
-		List<CourseScheduleStudentPaymentDto> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findNeedUpdateActualPriceStudentCourses();
+	public void updateCourseActualPrice(List<Long> courseIds) {
+		List<CourseScheduleStudentPaymentDto> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findNeedUpdateActualPriceStudentCourses(courseIds);
 		if(CollectionUtils.isEmpty(courseScheduleStudentPayments)){
 			return;
 		}

+ 38 - 56
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -3,7 +3,9 @@ package com.ym.mec.biz.service.impl;
 import com.ym.mec.biz.dal.dao.OrganizationDao;
 import com.ym.mec.biz.dal.dto.IndexBaseDto;
 import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.IndexDataType;
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.date.DateUtil;
@@ -82,27 +84,48 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM");
 		LocalDate nowDate = LocalDate.now();
-		LocalDate startDate = nowDate.withMonth(1).withDayOfMonth(1);
-		LocalDate endDate = nowDate.withDayOfMonth(1);
-		if(StringUtils.isNotBlank(startMonth)){
-			startDate = LocalDate.parse(startMonth+"-01", DateUtil.dateFormatter);
-		}
-
-		if(StringUtils.isNotBlank(endMonth)){
-			endDate = LocalDate.parse(endMonth+"-01", DateUtil.dateFormatter);
-		}
 
 		List<Organization> allOrgans = organizationDao.findAllOrgans();
 		Set<Integer> organIds = allOrgans.stream().map(Organization::getId).collect(Collectors.toSet());
 		this.organIds.get().clear();
 		this.organIds.get().addAll(organIds);
 
-		while (startDate.compareTo(endDate)<=0){
-			countUserSignUpData(df.format(startDate));
-			countHomeworkData(startMonth);
-
-			startDate = startDate.plusMonths(1);
-		}
+		startMonth = df.format(nowDate);
+
+		//运营数据
+		saveData(indexBaseMonthDataDao.getSchoolData(startMonth), startMonth, IndexDataType.SCHOOL);
+		saveData(indexBaseMonthDataDao.getMusicData(startMonth), startMonth, IndexDataType.MUSIC_GROUP_NUM);
+		saveData(indexBaseMonthDataDao.getMusicStudentData(startMonth), startMonth, IndexDataType.MUSIC_GROUP_STUDENT);
+		saveData(null, startMonth, IndexDataType.OTHER_STUDENT);
+
+		//业务数据
+		saveData(indexBaseMonthDataDao.getStudentSignUpData(startMonth), startMonth, IndexDataType.ACTIVATION_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, null), startMonth, IndexDataType.HOMEWORK_CREATE_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, "submit"), startMonth, IndexDataType.HOMEWORK_SUBMIT_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, "comment"), startMonth, IndexDataType.HOMEWORK_COMMENT_RATE);
+
+		//经营数据
+		saveData(null, startMonth, IndexDataType.SHOULD_INCOME_MONEY);
+		saveData(null, startMonth, IndexDataType.ANTICIPATED_INCOME_MONEY);
+		saveData(null, startMonth, IndexDataType.SHOULD_EXPEND_MONEY);
+		saveData(null, startMonth, IndexDataType.ANTICIPATED_EXPEND_MONEY);
+		saveData(null, startMonth, IndexDataType.REVENUE_MONEY);
+
+		//人事数据
+		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, null, null), startMonth, IndexDataType.TEACHER_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, JobNatureEnum.FULL_TIME, null), startMonth, IndexDataType.FULL_TIME_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, JobNatureEnum.PART_TIME, null), startMonth, IndexDataType.PART_TIME_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, null, true), startMonth, IndexDataType.DIMISSION_NUM);
+
+		//学员变动
+		saveData(null, startMonth, IndexDataType.NEWLY_STUDENT_NUM);
+		saveData(null, startMonth, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
+		saveData(null, startMonth, IndexDataType.STUDENT_CONVERSION);
+
+		//课程数据
+		saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.MUSIC), startMonth, IndexDataType.MUSIC_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.VIP), startMonth, IndexDataType.VIP_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.PRACTICE), startMonth, IndexDataType.PRACTICE_GROUP_COURSE);
 
 		return result;
 	}
@@ -129,45 +152,4 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		indexBaseMonthDataDao.deleteWithMonthAndType(Arrays.asList(startMonth), indexDataType);
 		indexBaseMonthDataDao.batchInsertWithDataType(dataList, indexDataType);
 	}
-
-	/**
-	 * @describe 激活率
-	 * @author Joburgess
-	 * @date 2021/1/11 0011
-	 * @param startMonth:
-	 * @return void
-	 */
-	private void countUserSignUpData(String startMonth){
-		List<IndexBaseMonthData> dataList = indexBaseMonthDataDao.getStudentSignUpData(startMonth);
-		saveData(dataList, startMonth, IndexDataType.ACTIVATION_RATE);
-	}
-
-	/**
-	 * @describe 作业数据
-	 * @author Joburgess
-	 * @date 2021/1/11 0011
-	 * @param startMonth:
-	 * @return void
-	 */
-	private void countHomeworkData(String startMonth){
-		List<IndexBaseMonthData> dataList = indexBaseMonthDataDao.getHomeworkDate(startMonth, null);
-		saveData(dataList, startMonth, IndexDataType.HOMEWORK_CREATE_RATE);
-
-		List<IndexBaseMonthData> dataList1 = indexBaseMonthDataDao.getHomeworkDate(startMonth, "submit");
-		saveData(dataList1, startMonth, IndexDataType.HOMEWORK_SUBMIT_RATE);
-
-		List<IndexBaseMonthData> dataList2 = indexBaseMonthDataDao.getHomeworkDate(startMonth, "comment");
-		saveData(dataList2, startMonth, IndexDataType.HOMEWORK_COMMENT_RATE);
-	}
-
-	/**
-	 * @describe 统计合作单位数据
-	 * @author Joburgess
-	 * @date 2021/1/11 0011
-	 * @param startMonth:
-	 * @return void
-	 */
-	private void countSchoolData(String startMonth){
-
-	}
 }

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -634,6 +634,12 @@
 			AND cs.id_ IS NOT NULL
 			AND ((cs.status_ = 'OVER' AND (cssp.actual_price_ IS NULL OR cssp.actual_price_ &lt; cssp.expect_price_))
 			OR ( cs.status_ = 'NOT_START' AND cssp.actual_price_ IS NOT NULL AND cssp.actual_price_ &gt; 0))
+			<if test="courseIds!=null and courseIds.size()>0">
+				AND cs.id_ IN
+				<foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+					#{courseId}
+				</foreach>
+			</if>
 	</select>
 	<select id="queryCourseByIdsAndStudentId" resultMap="CourseScheduleStudentPayment">
 		SELECT cssp.* FROM course_schedule_student_payment cssp

+ 117 - 11
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -139,7 +139,7 @@
 	<select id="getStudentSignUpData" resultMap="IndexBaseMonthData">
 		SELECT
 			organ_id_,
-			CONCAT( #{startMonth}, '-01' ) month_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
 			COUNT( id_ ) total_num_,
 			COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END) activate_num_,
 			TRUNCATE(COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END)/COUNT( id_ )*100, 2) percent_
@@ -148,17 +148,15 @@
 			del_flag_=0
 		  	AND organ_id_ IS NOT NULL
 			AND user_type_ LIKE '%STUDENT%'
-			<if test="startMonth!=null and startMonth!=''">
-				AND DATE_FORMAT(create_time_, '%Y-%m')=#{startMonth}
-			</if>
+			AND YEAR(create_time_)=YEAR(NOW())
 		GROUP BY organ_id_
-		ORDER BY organ_id_,month_;
+		ORDER BY organ_id_;
 	</select>
 
-	<select id="getHomeworkDate" resultMap="IndexBaseMonthData">
+	<select id="getHomeworkData" resultMap="IndexBaseMonthData">
 		SELECT
 			su.organ_id_,
-			CONCAT( #{startMonth}, '-01' ) month_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
 			<choose>
 				<when test="type == 'submit'">
 					SUM(sees.expect_exercises_num_) total_num_,
@@ -180,10 +178,118 @@
 		LEFT JOIN sys_user su ON sees.student_id_=su.id_
 		WHERE su.del_flag_=0
 			AND su.organ_id_ IS NOT NULL
-			<if test="startMonth!=null and startMonth!=''">
-				AND DATE_FORMAT(sees.monday_, '%Y-%m')=#{startMonth}
-			</if>
+			AND DATE_FORMAT(sees.monday_, '%Y-%m')=#{month}
 		GROUP BY su.organ_id_
-		ORDER BY su.organ_id_,month_
+		ORDER BY su.organ_id_
+	</select>
+
+	<select id="getSchoolData" resultMap="IndexBaseMonthData">
+		SELECT
+			organ_id_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
+			COUNT( id_ ) total_num_,
+			COUNT( id_ ) activate_num_,
+			COUNT( id_ ) percent_
+		FROM
+			school
+		WHERE
+			del_flag_ = 0
+		  	AND organ_id_ IS NOT NULL
+			AND YEAR(create_time_)=YEAR(NOW())
+		GROUP BY
+			organ_id_
+		ORDER BY
+			organ_id_;
+	</select>
+	<select id="getMusicData" resultMap="IndexBaseMonthData">
+		SELECT
+			organ_id_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
+			COUNT( id_ ) total_num_,
+			COUNT( id_ ) activate_num_,
+			COUNT( id_ ) percent_
+		FROM
+			music_group
+		WHERE
+			del_flag_ = 0
+			AND status_ = 'PROGRESS'
+			AND organ_id_ IS NOT NULL
+			AND YEAR(create_time_)=YEAR(NOW())
+		GROUP BY
+			organ_id_
+		ORDER BY
+			organ_id_;
+	</select>
+	<select id="getMusicStudentData" resultMap="IndexBaseMonthData">
+		SELECT
+			mg.organ_id_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
+			COUNT( DISTINCT sr.user_id_ ) total_num_,
+			COUNT( DISTINCT sr.user_id_ ) activate_num_,
+			COUNT( DISTINCT sr.user_id_ ) percent_
+		FROM student_registration sr
+				 LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
+		WHERE
+			mg.del_flag_ = 0
+			AND mg.status_ = 'PROGRESS'
+			AND mg.organ_id_ IS NOT NULL
+			AND sr.music_group_status_='NORMAL'
+			AND YEAR(sr.create_time_)=YEAR(NOW())
+		GROUP BY
+			mg.organ_id_
+		ORDER BY
+			mg.organ_id_;
+	</select>
+
+	<select id="getTeacherData" resultMap="IndexBaseMonthData">
+		SELECT
+			t.organ_id_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
+			COUNT( t.id_ ) total_num_,
+			COUNT( t.id_ ) activate_num_,
+			COUNT( t.id_ ) percent_
+		FROM
+			teacher t
+				LEFT JOIN sys_user su ON su.id_ = t.id_
+		WHERE
+			su.del_flag_ = 0
+		  	AND YEAR(t.create_time_)=YEAR(NOW())
+		  	<if test="isDemission==null">
+				AND su.lock_flag_ = 0
+			</if>
+		  	<if test="isDemission!=null">
+				AND (su.lock_flag_ = 1 OR t.demission_date_ IS NOT NULL)
+			</if>
+			AND t.organ_id_ IS NOT NULL
+			<if test="jobNature!=null">
+				AND t.job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+		GROUP BY
+			t.organ_id_
+		ORDER BY
+			t.organ_id_;
+	</select>
+
+	<select id="getGroupCourseData" resultMap="IndexBaseMonthData">
+		SELECT
+			m.organ_id_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
+			COUNT( m.id_ ) total_num_,
+			COUNT( m.id_ ) activate_num_,
+			COUNT( m.id_ ) percent_
+		FROM
+			course_schedule m
+		WHERE
+			m.del_flag_ = 0
+			AND m.is_lock_ = 0
+			AND m.organ_id_ IS NOT NULL
+			AND YEAR(m.create_time_)=YEAR(NOW())
+			<if test="groupType!=null">
+				AND m.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+		GROUP BY
+			m.organ_id_
+		ORDER BY
+			m.organ_id_;
 	</select>
 </mapper>

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

@@ -498,6 +498,7 @@
             LEFT JOIN course_schedule cs ON cssp.course_schedule_id_=cs.id_
             LEFT JOIN student stu ON cssp.user_id_ = stu.user_id_
         WHERE stu.service_tag_=1
+            AND stu.service_tag_update_time_&lt;#{nextMonday}
             AND cs.class_date_&gt;=#{monday}
             AND cs.type_ IN ('SINGLE','VIP','MIX','PRACTICE')
             AND cssp.create_time_&lt;#{nextMonday}