mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 12:03:05 +08:00
Merge pull request #1976 from dataease/pr@dev@fix_table_info
fix: 修复明细表数值排序会出现按文本顺序的问题
This commit is contained in:
commit
92b6421d83
@ -297,7 +297,11 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
} else {
|
||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(DorisConstants.CAST, String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName()), DorisConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
|
@ -297,7 +297,11 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
} else {
|
||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(MysqlConstants.CAST, String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName()), MysqlConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
|
@ -326,7 +326,11 @@ public class CKQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(CKConstants.toDecimal, String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()));
|
||||
} else {
|
||||
originField = String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
|
@ -300,7 +300,12 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(Db2Constants.CAST, String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), Db2Constants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
@ -685,10 +690,10 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
stringBuilder.append(" \"").append(f.getOriginName()).append("\"");
|
||||
return stringBuilder.toString();
|
||||
}).toArray(String[]::new);
|
||||
if(ds!= null){
|
||||
if (ds != null) {
|
||||
Db2Configuration db2Configuration = new Gson().fromJson(ds.getConfiguration(), Db2Configuration.class);
|
||||
return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(array, ","), db2Configuration.getSchema() + ".\"" + table + "\"");
|
||||
}else {
|
||||
} else {
|
||||
return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(array, ","), table);
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,11 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(HiveConstants.CAST, String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), HiveConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
|
@ -283,7 +283,11 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(ImpalaConstants.CAST, String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), ImpalaConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
@ -792,9 +796,9 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
} else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) {
|
||||
whereValue = "'%" + value + "%'";
|
||||
} else {
|
||||
if(field.getDeExtractType() == DeTypeConstants.DE_INT || field.getDeExtractType() == DeTypeConstants.DE_FLOAT|| field.getDeExtractType() == DeTypeConstants.DE_BOOL){
|
||||
if (field.getDeExtractType() == DeTypeConstants.DE_INT || field.getDeExtractType() == DeTypeConstants.DE_FLOAT || field.getDeExtractType() == DeTypeConstants.DE_BOOL) {
|
||||
whereValue = String.format(ImpalaConstants.WHERE_NUMBER_VALUE_VALUE, value);
|
||||
}else {
|
||||
} else {
|
||||
whereValue = String.format(ImpalaConstants.WHERE_VALUE_VALUE, value);
|
||||
}
|
||||
}
|
||||
@ -879,9 +883,9 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
whereValue = String.format(ImpalaConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
}
|
||||
} else {
|
||||
if(field.getDeExtractType() == DeTypeConstants.DE_INT || field.getDeExtractType() == DeTypeConstants.DE_FLOAT|| field.getDeExtractType() == DeTypeConstants.DE_BOOL){
|
||||
if (field.getDeExtractType() == DeTypeConstants.DE_INT || field.getDeExtractType() == DeTypeConstants.DE_FLOAT || field.getDeExtractType() == DeTypeConstants.DE_BOOL) {
|
||||
whereValue = String.format(ImpalaConstants.WHERE_NUMBER_VALUE_VALUE, value.get(0));
|
||||
}else {
|
||||
} else {
|
||||
whereValue = String.format(ImpalaConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
}
|
||||
}
|
||||
@ -1007,9 +1011,9 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
} else if (StringUtils.containsIgnoreCase(f.getTerm(), "like")) {
|
||||
whereValue = "'%" + f.getValue() + "%'";
|
||||
} else {
|
||||
if(y.getDeExtractType() == DeTypeConstants.DE_INT || y.getDeExtractType() == DeTypeConstants.DE_FLOAT|| y.getDeExtractType() == DeTypeConstants.DE_BOOL){
|
||||
if (y.getDeExtractType() == DeTypeConstants.DE_INT || y.getDeExtractType() == DeTypeConstants.DE_FLOAT || y.getDeExtractType() == DeTypeConstants.DE_BOOL) {
|
||||
whereValue = String.format(ImpalaConstants.WHERE_NUMBER_VALUE_VALUE, f.getValue());
|
||||
}else {
|
||||
} else {
|
||||
whereValue = String.format(ImpalaConstants.WHERE_VALUE_VALUE, f.getValue());
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +277,11 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_TIME) {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(MongoConstants.toDecimal, String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()));
|
||||
} else {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
@ -777,7 +781,7 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
} else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) {
|
||||
whereValue = "'%" + value + "%'";
|
||||
} else {
|
||||
if(field.getDeType() == DeTypeConstants.DE_STRING){
|
||||
if (field.getDeType() == DeTypeConstants.DE_STRING) {
|
||||
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, value);
|
||||
}
|
||||
}
|
||||
@ -838,9 +842,9 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
whereValue = String.format(MongoConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
}
|
||||
} else {
|
||||
if(field.getDeType() == DeTypeConstants.DE_STRING){
|
||||
if (field.getDeType() == DeTypeConstants.DE_STRING) {
|
||||
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
}else {
|
||||
} else {
|
||||
whereValue = value.get(0);
|
||||
}
|
||||
}
|
||||
@ -941,9 +945,9 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
} else if (StringUtils.containsIgnoreCase(f.getTerm(), "like")) {
|
||||
whereValue = "'%" + f.getValue() + "%'";
|
||||
} else {
|
||||
if(y.getDeType() == DeTypeConstants.DE_STRING){
|
||||
if (y.getDeType() == DeTypeConstants.DE_STRING) {
|
||||
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, f.getValue());
|
||||
}else {
|
||||
} else {
|
||||
whereValue = f.getValue();
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
|
||||
import io.dataease.dto.chart.ChartViewFieldDTO;
|
||||
import io.dataease.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.constants.MySQLConstants;
|
||||
import io.dataease.plugins.common.constants.engine.MysqlConstants;
|
||||
import io.dataease.provider.QueryProvider;
|
||||
import io.dataease.plugins.common.constants.SQLConstants;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -294,7 +295,11 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(MySQLConstants.CAST, String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), MysqlConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
|
@ -341,7 +341,11 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(OracleConstants.CAST, String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), OracleConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i));
|
||||
// 处理横轴字段
|
||||
|
@ -315,7 +315,11 @@ public class PgQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(PgConstants.CAST, String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), PgConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else {
|
||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
|
@ -313,7 +313,11 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if (x.getDeType() == 2 || x.getDeType() == 3) {
|
||||
originField = String.format(SqlServerSQLConstants.CONVERT, SqlServerSQLConstants.DEFAULT_FLOAT_FORMAT, String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()));
|
||||
} else {
|
||||
originField = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
|
Loading…
Reference in New Issue
Block a user