forked from github/dataease
Merge branch 'dev' of github.com:dataease/dataease into dev
This commit is contained in:
commit
845e3d32bd
@ -297,7 +297,11 @@ public class DorisQueryProvider extends QueryProvider {
|
|||||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||||
} else {
|
} 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);
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||||
} else {
|
} 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);
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
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("\"");
|
stringBuilder.append(" \"").append(f.getOriginName()).append("\"");
|
||||||
return stringBuilder.toString();
|
return stringBuilder.toString();
|
||||||
}).toArray(String[]::new);
|
}).toArray(String[]::new);
|
||||||
if(ds!= null){
|
if (ds != null) {
|
||||||
Db2Configuration db2Configuration = new Gson().fromJson(ds.getConfiguration(), Db2Configuration.class);
|
Db2Configuration db2Configuration = new Gson().fromJson(ds.getConfiguration(), Db2Configuration.class);
|
||||||
return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(array, ","), db2Configuration.getSchema() + ".\"" + table + "\"");
|
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);
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
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")) {
|
} else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) {
|
||||||
whereValue = "'%" + value + "%'";
|
whereValue = "'%" + value + "%'";
|
||||||
} else {
|
} 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);
|
whereValue = String.format(ImpalaConstants.WHERE_NUMBER_VALUE_VALUE, value);
|
||||||
}else {
|
} else {
|
||||||
whereValue = String.format(ImpalaConstants.WHERE_VALUE_VALUE, value);
|
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));
|
whereValue = String.format(ImpalaConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||||
}
|
}
|
||||||
} else {
|
} 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));
|
whereValue = String.format(ImpalaConstants.WHERE_NUMBER_VALUE_VALUE, value.get(0));
|
||||||
}else {
|
} else {
|
||||||
whereValue = String.format(ImpalaConstants.WHERE_VALUE_VALUE, value.get(0));
|
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")) {
|
} else if (StringUtils.containsIgnoreCase(f.getTerm(), "like")) {
|
||||||
whereValue = "'%" + f.getValue() + "%'";
|
whereValue = "'%" + f.getValue() + "%'";
|
||||||
} else {
|
} 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());
|
whereValue = String.format(ImpalaConstants.WHERE_NUMBER_VALUE_VALUE, f.getValue());
|
||||||
}else {
|
} else {
|
||||||
whereValue = String.format(ImpalaConstants.WHERE_VALUE_VALUE, f.getValue());
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_TIME) {
|
||||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
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")) {
|
} else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) {
|
||||||
whereValue = "'%" + value + "%'";
|
whereValue = "'%" + value + "%'";
|
||||||
} else {
|
} else {
|
||||||
if(field.getDeType() == DeTypeConstants.DE_STRING){
|
if (field.getDeType() == DeTypeConstants.DE_STRING) {
|
||||||
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, value);
|
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));
|
whereValue = String.format(MongoConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(field.getDeType() == DeTypeConstants.DE_STRING){
|
if (field.getDeType() == DeTypeConstants.DE_STRING) {
|
||||||
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, value.get(0));
|
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||||
}else {
|
} else {
|
||||||
whereValue = value.get(0);
|
whereValue = value.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -941,9 +945,9 @@ public class MongoQueryProvider extends QueryProvider {
|
|||||||
} else if (StringUtils.containsIgnoreCase(f.getTerm(), "like")) {
|
} else if (StringUtils.containsIgnoreCase(f.getTerm(), "like")) {
|
||||||
whereValue = "'%" + f.getValue() + "%'";
|
whereValue = "'%" + f.getValue() + "%'";
|
||||||
} else {
|
} else {
|
||||||
if(y.getDeType() == DeTypeConstants.DE_STRING){
|
if (y.getDeType() == DeTypeConstants.DE_STRING) {
|
||||||
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, f.getValue());
|
whereValue = String.format(MongoConstants.WHERE_VALUE_VALUE, f.getValue());
|
||||||
}else {
|
} else {
|
||||||
whereValue = f.getValue();
|
whereValue = f.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
|
|||||||
import io.dataease.dto.chart.ChartViewFieldDTO;
|
import io.dataease.dto.chart.ChartViewFieldDTO;
|
||||||
import io.dataease.dto.sqlObj.SQLObj;
|
import io.dataease.dto.sqlObj.SQLObj;
|
||||||
import io.dataease.plugins.common.constants.MySQLConstants;
|
import io.dataease.plugins.common.constants.MySQLConstants;
|
||||||
|
import io.dataease.plugins.common.constants.engine.MysqlConstants;
|
||||||
import io.dataease.provider.QueryProvider;
|
import io.dataease.provider.QueryProvider;
|
||||||
import io.dataease.plugins.common.constants.SQLConstants;
|
import io.dataease.plugins.common.constants.SQLConstants;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@ -294,7 +295,11 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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));
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
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) {
|
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||||
originField = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
originField = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||||
} else {
|
} 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);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
// 处理横轴字段
|
// 处理横轴字段
|
||||||
|
@ -784,6 +784,7 @@ public class ChartViewService {
|
|||||||
PluginViewParam pluginViewParam = new PluginViewParam();
|
PluginViewParam pluginViewParam = new PluginViewParam();
|
||||||
PluginViewSet pluginViewSet = BeanUtils.copyBean(new PluginViewSet(), table);
|
PluginViewSet pluginViewSet = BeanUtils.copyBean(new PluginViewSet(), table);
|
||||||
pluginViewSet.setDsType(ds.getType());
|
pluginViewSet.setDsType(ds.getType());
|
||||||
|
pluginViewSet.setTabelId(table.getId());
|
||||||
PluginViewLimit pluginViewLimit = BeanUtils.copyBean(new PluginViewLimit(), view);
|
PluginViewLimit pluginViewLimit = BeanUtils.copyBean(new PluginViewLimit(), view);
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,29 +93,35 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
|||||||
public PluginViewSQL getTableObj(PluginViewSet pluginViewSet) {
|
public PluginViewSQL getTableObj(PluginViewSet pluginViewSet) {
|
||||||
String tableName = null;
|
String tableName = null;
|
||||||
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(pluginViewSet.getInfo(), DataTableInfoDTO.class);
|
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(pluginViewSet.getInfo(), DataTableInfoDTO.class);
|
||||||
switch (pluginViewSet.getType()) {
|
if (ObjectUtils.isNotEmpty(pluginViewSet.getMode()) && 1 == pluginViewSet.getMode()) {
|
||||||
case "db":
|
|
||||||
tableName = dataTableInfoDTO.getTable();
|
|
||||||
break;
|
|
||||||
case "sql":
|
|
||||||
tableName = dataTableInfoDTO.getSql();
|
|
||||||
break;
|
|
||||||
case "custom":
|
|
||||||
List<DataSetTableUnionDTO> list = dataSetTableUnionService.listByTableId(dataTableInfoDTO.getList().get(0).getTableId());
|
|
||||||
Datasource ds = new Datasource();
|
|
||||||
ds.setType(pluginViewSet.getDsType());
|
|
||||||
tableName = dataSetTableService.getCustomSQLDatasource(dataTableInfoDTO, list, ds);
|
|
||||||
break;
|
|
||||||
case "union":
|
|
||||||
Datasource datasource = new Datasource();
|
|
||||||
datasource.setType(pluginViewSet.getDsType());
|
|
||||||
Map<String, Object> sqlMap = dataSetTableService.getUnionSQLDatasource(dataTableInfoDTO, datasource);
|
|
||||||
tableName = (String) sqlMap.get("sql");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
tableName = "ds_" + pluginViewSet.getTabelId().replaceAll("-", "_");
|
||||||
|
|
||||||
|
}else {
|
||||||
|
switch (pluginViewSet.getType()) {
|
||||||
|
case "db":
|
||||||
|
tableName = dataTableInfoDTO.getTable();
|
||||||
|
break;
|
||||||
|
case "sql":
|
||||||
|
tableName = dataTableInfoDTO.getSql();
|
||||||
|
break;
|
||||||
|
case "custom":
|
||||||
|
List<DataSetTableUnionDTO> list = dataSetTableUnionService.listByTableId(dataTableInfoDTO.getList().get(0).getTableId());
|
||||||
|
Datasource ds = new Datasource();
|
||||||
|
ds.setType(pluginViewSet.getDsType());
|
||||||
|
tableName = dataSetTableService.getCustomSQLDatasource(dataTableInfoDTO, list, ds);
|
||||||
|
break;
|
||||||
|
case "union":
|
||||||
|
Datasource datasource = new Datasource();
|
||||||
|
datasource.setType(pluginViewSet.getDsType());
|
||||||
|
Map<String, Object> sqlMap = dataSetTableService.getUnionSQLDatasource(dataTableInfoDTO, datasource);
|
||||||
|
tableName = (String) sqlMap.get("sql");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tableName = dataTableInfoDTO.getTable();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
String keyword = ConstantsUtil.constantsValue(pluginViewSet.getDsType(), "KEYWORD_TABLE");
|
String keyword = ConstantsUtil.constantsValue(pluginViewSet.getDsType(), "KEYWORD_TABLE");
|
||||||
String tabelName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName);
|
String tabelName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName);
|
||||||
String tabelAlias = String.format(TABLE_ALIAS_PREFIX, 0);
|
String tabelAlias = String.format(TABLE_ALIAS_PREFIX, 0);
|
||||||
|
@ -260,6 +260,43 @@ const data = {
|
|||||||
}
|
}
|
||||||
for (let index = 0; index < state.componentData.length; index++) {
|
for (let index = 0; index < state.componentData.length; index++) {
|
||||||
const element = state.componentData[index]
|
const element = state.componentData[index]
|
||||||
|
if (element.type && element.type === 'de-tabs') {
|
||||||
|
for (let idx = 0; idx < element.options.tabList.length; idx++) {
|
||||||
|
const ele = element.options.tabList[idx].content
|
||||||
|
if (!ele.type || ele.type !== 'view') continue
|
||||||
|
|
||||||
|
const currentFilters = []
|
||||||
|
|
||||||
|
data.dimensionList.forEach(dimension => {
|
||||||
|
const sourceInfo = viewId + '#' + dimension.id
|
||||||
|
// 获取所有目标联动信息
|
||||||
|
const targetInfoList = trackInfo[sourceInfo] || []
|
||||||
|
targetInfoList.forEach(targetInfo => {
|
||||||
|
const targetInfoArray = targetInfo.split('#')
|
||||||
|
const targetViewId = targetInfoArray[0] // 目标视图
|
||||||
|
if (ele.propValue.viewId === targetViewId) { // 如果目标视图 和 当前循环组件id相等 则进行条件增减
|
||||||
|
const targetFieldId = targetInfoArray[1] // 目标视图列ID
|
||||||
|
const condition = new Condition('', targetFieldId, 'eq', [dimension.value], [targetViewId])
|
||||||
|
condition.sourceViewId = viewId
|
||||||
|
let j = currentFilters.length
|
||||||
|
while (j--) {
|
||||||
|
const filter = currentFilters[j]
|
||||||
|
// 兼容性准备 viewIds 只会存放一个值
|
||||||
|
if (targetFieldId === filter.fieldId && filter.viewIds.includes(targetViewId)) {
|
||||||
|
currentFilters.splice(j, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 不存在该条件 且 条件有效 直接保存该条件
|
||||||
|
// !filterExist && vValid && currentFilters.push(condition)
|
||||||
|
currentFilters.push(condition)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
ele.linkageFilters = currentFilters
|
||||||
|
}
|
||||||
|
state.componentData[index] = element
|
||||||
|
}
|
||||||
if (!element.type || element.type !== 'view') continue
|
if (!element.type || element.type !== 'view') continue
|
||||||
// const currentFilters = element.linkageFilters || [] // 当前联动filter
|
// const currentFilters = element.linkageFilters || [] // 当前联动filter
|
||||||
// 联动的视图情况历史条件
|
// 联动的视图情况历史条件
|
||||||
|
Loading…
Reference in New Issue
Block a user