added getTeamRankingList sql query
This commit is contained in:
parent
35ad020c84
commit
c4b3c52fea
@ -35,4 +35,18 @@ public interface UserRepository extends CrudRepository<User, Integer> {
|
||||
"WHERE Name = ?1", nativeQuery = true)
|
||||
int getRankingPlaceFromUser(String username);
|
||||
|
||||
@Query(value = "SELECT DISTINCT t.name AS teamname, SUM(ui.ranking_points_sum) AS Ranglistenpunkte\n" +
|
||||
"FROM user u,\n" +
|
||||
" user_info ui,\n" +
|
||||
" user_roles ur,\n" +
|
||||
" team t\n" +
|
||||
"WHERE u.id = ui.user_id\n" +
|
||||
" AND u.id = ur.user_id\n" +
|
||||
" AND t.id = ui.team_id\n" +
|
||||
" AND ui.team_id IS NOT NULL\n" +
|
||||
"GROUP BY teamname\n" +
|
||||
"ORDER by ranking_points_sum DESC" +
|
||||
"LIMIT 10;", nativeQuery = true)
|
||||
List<Object[]> getTeamRankingList();
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user