fix: 自定义sql中出现count(*)等函数导致数据查询异常bug修复

This commit is contained in:
junjie 2021-06-28 15:43:02 +08:00
parent 2e679dce73
commit 05d46702dd

View File

@ -128,7 +128,7 @@ public class MysqlQueryProvider extends QueryProvider {
String[] field = yAxis.stream().map(y -> {
StringBuilder f = new StringBuilder();
if (StringUtils.equalsIgnoreCase(y.getOriginName(), "*")) {
f.append(y.getSummary()).append("(`").append(y.getOriginName()).append("`)");
f.append(y.getSummary()).append("(").append(y.getOriginName()).append(")");
} else {
if (StringUtils.equalsIgnoreCase(y.getSummary(), "avg") || StringUtils.containsIgnoreCase(y.getSummary(), "pop")) {
f.append("CAST(")
@ -266,7 +266,7 @@ public class MysqlQueryProvider extends QueryProvider {
String[] field = yAxis.stream().map(y -> {
StringBuilder f = new StringBuilder();
if (StringUtils.equalsIgnoreCase(y.getOriginName(), "*")) {
f.append(y.getSummary()).append("(`").append(y.getOriginName()).append("`)");
f.append(y.getSummary()).append("(").append(y.getOriginName()).append(")");
} else {
if (StringUtils.equalsIgnoreCase(y.getSummary(), "avg") || StringUtils.containsIgnoreCase(y.getSummary(), "pop")) {
f.append("CAST(")