From ca87475a448161644638d577d48e2137349ac2aa Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 19 二月 2024 08:12:58 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/common/domain/PageParam.java | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/common/domain/PageParam.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/common/domain/PageParam.java index bfc76e3..f627a5c 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/common/domain/PageParam.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/common/domain/PageParam.java @@ -97,9 +97,19 @@ } } - if (!Cools.isEmpty(where.getCondition()) && !Cools.isEmpty(cls)) { + Field[] fields = null; + if (!Cools.isEmpty(cls)) { + fields = Cools.getAllFields(cls); + for (Field field : fields) { + if ("createTime".equals(field.getName())) { + queryWrapper.orderByDesc(Utils.toSymbolCase(field.getName(), '_')); + } + } + } + + if (!Cools.isEmpty(where.getCondition()) && !Cools.isEmpty(fields)) { List<String> columns = new ArrayList<>(); - for (Field field :Cools.getAllFields(cls)){ + for (Field field : fields){ if (Modifier.isFinal(field.getModifiers()) || Modifier.isStatic(field.getModifiers()) || Modifier.isTransient(field.getModifiers())){ -- Gitblit v1.9.1