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; } }