斋月活动前三名顺序处理
This commit is contained in:
parent
b3dcc669c0
commit
e05d6866ee
@ -187,10 +187,13 @@ public class RankingActivityGatewayImpl implements RankingActivityGateway {
|
||||
.first("userId").as("userId")
|
||||
.first("userSex").as("userSex")
|
||||
.first("activityType").as("activityType")
|
||||
.first("dimension").as("dimension"),
|
||||
// 3. 按总数量降序排序
|
||||
.first("dimension").as("dimension")
|
||||
.first("createTime").as("createTime"),
|
||||
// 3. 按总数量降序排序,createTime升序排序
|
||||
Aggregation.sort(
|
||||
org.springframework.data.domain.Sort.Direction.DESC, "quantity"
|
||||
org.springframework.data.domain.Sort.Direction.DESC, "quantity"
|
||||
).and(
|
||||
org.springframework.data.domain.Sort.Direction.ASC, "createTime"
|
||||
),
|
||||
// 4. 限制返回数量
|
||||
Aggregation.limit(topN)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user