From ec262cff539b500d96b423a8a7c6ba8801943399 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Mon, 7 Nov 2022 14:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=94=A8=E6=88=B7=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=A1=A8=E6=97=A0=E9=BB=98=E8=AE=A4=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=8E=92=E5=BA=8F=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/system/query/QueryGenerator.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java index 45ac9b4a..feed6b38 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java @@ -238,7 +238,15 @@ public class QueryGenerator { if(parameterMap!=null&& parameterMap.containsKey(ORDER_TYPE)) { order = parameterMap.get(ORDER_TYPE)[0]; } - log.debug("排序规则>>列:" + column + ",排序方式:" + order); + log.info("排序规则>>列:" + column + ",排序方式:" + order); + + //update-begin-author:scott date:2022-11-07 for:避免用户自定义表无默认字段{创建时间},导致排序报错 + //TODO 避免用户自定义表无默认字段创建时间,导致排序报错 + if(DataBaseConstant.CREATE_TIME.equals(column) && !fieldColumnMap.containsKey(DataBaseConstant.CREATE_TIME)){ + column = "id"; + } + //update-end-author:scott date:2022-11-07 for:避免用户自定义表无默认字段{创建时间},导致排序报错 + if (oConvertUtils.isNotEmpty(column) && oConvertUtils.isNotEmpty(order)) { //字典字段,去掉字典翻译文本后缀 if(column.endsWith(CommonConstant.DICT_TEXT_SUFFIX)) {