Skip to content

Commit

Permalink
fix same song and difficulty different type score get wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyDynamic committed Nov 27, 2024
1 parent 1796db9 commit 3062c12
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ interface MaimaiScoreDao {
SELECT t1.*
FROM maimai_score_entity t1
JOIN (
SELECT title, diff, MAX(achievement) as maxAchievement
SELECT title, diff, type, MAX(achievement) as maxAchievement
FROM maimai_score_entity
GROUP BY title, diff
) t2 ON t1.title = t2.title AND t1.diff = t2.diff AND t1.achievement = t2.maxAchievement
GROUP BY title, diff, type
) t2 ON t1.title = t2.title AND t1.diff = t2.diff AND t1.type = t2.type AND t1.achievement = t2.maxAchievement
JOIN (
SELECT title, diff, achievement, MAX(dxScore) as maxDxScore
SELECT title, diff, type, achievement, MAX(dxScore) as maxDxScore
FROM maimai_score_entity
GROUP BY title, diff, achievement
) t3 ON t1.title = t3.title AND t1.diff = t3.diff AND t1.achievement = t3.achievement AND t1.dxScore = t3.maxDxScore
GROUP BY title, diff, type, achievement
) t3 ON t1.title = t3.title AND t1.diff = t3.diff AND t1.type = t3.type AND t1.achievement = t3.achievement AND t1.dxScore = t3.maxDxScore
ORDER BY t1.achievement DESC, t1.dxScore DESC
""")
suspend fun getAllHighestMusicScore(): List<MaimaiScoreEntity>
Expand Down

0 comments on commit 3062c12

Please sign in to comment.