mirror of
https://gitee.com/zhijiantianya/yudao-cloud.git
synced 2025-12-30 01:12:26 +00:00
Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/yudao-cloud
# Conflicts: # pom.xml # yudao-dependencies/pom.xml
This commit is contained in:
@@ -38,6 +38,7 @@ public class MyBatisUtils {
|
||||
public static <T> Page<T> buildPage(PageParam pageParam, Collection<SortingField> sortingFields) {
|
||||
// 页码 + 数量
|
||||
Page<T> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
|
||||
page.setOptimizeJoinOfCountSql(false); // 关联 issue:https://gitee.com/zhijiantianya/yudao-cloud/issues/ID2QLL
|
||||
// 排序字段
|
||||
if (CollUtil.isNotEmpty(sortingFields)) {
|
||||
for (SortingField sortingField : sortingFields) {
|
||||
@@ -69,8 +70,8 @@ public class MyBatisUtils {
|
||||
orderBy.append(", ");
|
||||
}
|
||||
orderBy.append(StrUtil.toUnderlineCase(sortingField.getField()))
|
||||
.append(" ")
|
||||
.append(SortingField.ORDER_ASC.equals(sortingField.getOrder()) ? "ASC" : "DESC");
|
||||
.append(" ")
|
||||
.append(SortingField.ORDER_ASC.equals(sortingField.getOrder()) ? "ASC" : "DESC");
|
||||
}
|
||||
lambdaQuery.last("ORDER BY " + orderBy);
|
||||
// 另外个思路:https://blog.csdn.net/m0_59084856/article/details/138450913
|
||||
|
||||
Reference in New Issue
Block a user