[O] Handle ranking with binary search

This commit is contained in:
Azalea
2024-12-23 18:00:06 -05:00
parent 5b20cb316b
commit f5959925aa
2 changed files with 11 additions and 5 deletions

View File

@@ -121,8 +121,6 @@ open class BaseEntity(
interface GenericUserDataRepo<T : IUserData> : JpaRepository<T, Long> {
fun findByCard(card: Card): T?
fun findByCard_ExtId(extId: Long): Optional<T>
@Query("select count(*) from #{#entityName} e where e.playerRating > :rating and e.card.rankingBanned = false")
fun getRanking(rating: Int): Long
@Query("select e from #{#entityName} e where e.card.rankingBanned = false")
fun findAllNonBanned(): List<T>