Browse Source

Merge remote-tracking branch 'origin/music_score' into music_score

zouxuan 3 years ago
parent
commit
2258ba5795

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicCompareRecordServiceImpl.java

@@ -111,13 +111,13 @@ public class SysMusicCompareRecordServiceImpl extends BaseServiceImpl<Long, SysM
 		List<MusicCompareRankingDto> detail = new ArrayList<>();
 		switch (queryInfo.getOrderType()){
 			case 1:
-				userTrainStat.sort(Comparator.comparing(m->m.getScore(), Comparator.reverseOrder()));
+				userTrainStat.sort(Comparator.comparing(MusicCompareRankingDto::getScore, Comparator.reverseOrder()).thenComparing(MusicCompareRankingDto::getUserId));
 				break;
 			case 2:
-				userTrainStat.sort(Comparator.comparing(m->m.getTrainDays(), Comparator.reverseOrder()));
+				userTrainStat.sort(Comparator.comparing(MusicCompareRankingDto::getTrainDays, Comparator.reverseOrder()).thenComparing(MusicCompareRankingDto::getUserId));
 				break;
 			default:
-				userTrainStat.sort(Comparator.comparing(m->m.getTrainTime(), Comparator.reverseOrder()));
+				userTrainStat.sort(Comparator.comparing(MusicCompareRankingDto::getTrainTime, Comparator.reverseOrder()).thenComparing(MusicCompareRankingDto::getUserId));
 				break;
 		}
 

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

@@ -144,7 +144,7 @@
 		    su.username_ studentName,
 		    sms.name_ musicScoreName,
 			COUNT(smcr.id_) trainNum,
-		    SUM(smcr.score_)/COUNT(smcr.id_) score,
+		    MAX(smcr.score_) score,
 			COUNT(DISTINCT DATE(smcr.create_time_)) trainDays,
 			SUM(smcr.play_time_) trainTime
 		FROM sys_music_compare_record smcr