Browse Source

feat:首页

Joburgess 4 years ago
parent
commit
01728a4c1d

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

@@ -331,6 +331,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds), indexBaseMonthDataDao.getNoPaymentMusicGroup(organIds)));
 		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), indexBaseMonthDataDao.countApplyForQuitGroupNum(organIds),  null));
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode()), null));
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode()), null));
 		two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 		two.setResult(twoChild);
 		all.add(two);

+ 9 - 5
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -528,12 +528,16 @@
 			COUNT( DISTINCT cssp.user_id_ )
 		FROM
 			course_schedule_student_payment cssp
-				LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
-				LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
-				LEFT JOIN student_visit sv ON cssp.id_=sv.object_id_
+			LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+			LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
+			LEFT JOIN student_visit sv ON cssp.id_=sv.object_id_
 		WHERE
-			( sa.status_ = 'LEAVE' AND sa.remark_ IS NOT NULL AND sv.id_ IS NULL)
-			OR sa.id_ IS NULL
+			<if test="type!=null and type=='LEAVE'">
+				(sa.status_ = 'LEAVE' AND sa.remark_ IS NOT NULL AND sv.id_ IS NULL)
+			</if>
+			<if test="type!=null and type=='TRUANT'">
+				(sa.status_ = 'TRUANT' OR sa.id_ IS NULL)
+			</if>
 			<if test="organIds!=null and organIds.size()>0">
 				AND cs.organ_id_ IN
 				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">