Commit 4d8f9682 by gonglei

加入框架代码

1 parent 1bb67417
......@@ -142,7 +142,7 @@ public class AuctionController {
Join auctionJoin = root.join(AuctionVehicle_.auction, JoinType.LEFT);
Join<Auction, AccountTag> tagsJoin = auctionJoin.join(Auction_.accountTags, JoinType.LEFT);
Predicate tagsIn = tagsJoin.in(finalAccountTags);
query.distinct(true); // 去重
// query.distinct(true); // 去重
Expression<Double> randomExp = builder.function("RAND", Double.class); // MySQL 用 RAND()
if (StringUtils.hasText(cityCode)) {
......@@ -152,8 +152,6 @@ public class AuctionController {
} else {
query.orderBy(builder.asc(randomExp)); // 按随机值升序(或降序,效果相同)
}
return builder.or(builder.equal(auctionJoin.get(Auction_.accessScope), Auction.AccessScope.GLOBAL), tagsIn);
});
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!