From c519ddefa20f4a8aefb7c72babcf1f954448a65d Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 29 Jun 2021 11:06:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E5=9B=BE=E8=AE=A1=E7=AE=97SQL?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/provider/doris/DorisQueryProvider.java | 4 ++-- .../java/io/dataease/provider/mysql/MysqlQueryProvider.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java b/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java index 00bf32f724..aaedfd0524 100644 --- a/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java @@ -237,7 +237,7 @@ public class DorisQueryProvider extends QueryProvider { String filterSql = MessageFormat.format("SELECT * FROM {0} WHERE 1=1 {1} ORDER BY {2}", "(" + sql + ") AS tmp", StringUtils.join(resultFilter, " "), - StringUtils.join(yOrder, ",")); + ObjectUtils.isNotEmpty(yOrder) ? StringUtils.join(yOrder, ",") : "null"); return filterSql; } } @@ -318,7 +318,7 @@ public class DorisQueryProvider extends QueryProvider { String filterSql = MessageFormat.format("SELECT * FROM {0} WHERE 1=1 {1} ORDER BY {2}", "(" + sql + ") AS tmp", StringUtils.join(resultFilter, " "), - StringUtils.join(order, ",")); + ObjectUtils.isNotEmpty(order) ? StringUtils.join(order, ",") : "null"); return filterSql; } } diff --git a/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java b/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java index 4feaad6579..1b6362b326 100644 --- a/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java @@ -245,7 +245,7 @@ public class MysqlQueryProvider extends QueryProvider { String filterSql = MessageFormat.format("SELECT * FROM {0} WHERE 1=1 {1} ORDER BY {2}", "(" + sql + ") AS tmp", StringUtils.join(resultFilter, " "), - StringUtils.join(yOrder, ",")); + ObjectUtils.isNotEmpty(yOrder) ? StringUtils.join(yOrder, ",") : "null"); return filterSql; } } @@ -326,7 +326,7 @@ public class MysqlQueryProvider extends QueryProvider { String filterSql = MessageFormat.format("SELECT * FROM {0} WHERE 1=1 {1} ORDER BY {2}", "(" + sql + ") AS tmp", StringUtils.join(resultFilter, " "), - StringUtils.join(order, ",")); + ObjectUtils.isNotEmpty(order) ? StringUtils.join(order, ",") : "null"); return filterSql; } }