forked from github/dataease
parent
64e5c51578
commit
081ba6e434
@ -46,4 +46,5 @@ public class ChartViewDTO extends ChartViewWithBLOBs {
|
|||||||
private long totalItems;
|
private long totalItems;
|
||||||
private int datasetMode;
|
private int datasetMode;
|
||||||
private String datasourceType;
|
private String datasourceType;
|
||||||
|
private Boolean aggregate;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -777,12 +778,15 @@ public class DorisQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -823,21 +827,29 @@ public class DorisQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(DorisConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(DorisConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(DorisConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(DorisConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -849,6 +861,9 @@ public class DorisQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -28,6 +28,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -383,12 +384,15 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -431,22 +435,29 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
|
if (ifAggregate) {
|
||||||
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
|
String fieldName = String.format(MysqlConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
String fieldName = String.format(MysqlConstants.AGG_FIELD, "min", originField);
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
|
String fieldName = String.format(MysqlConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
String fieldName = String.format(MysqlConstants.AGG_FIELD, "max", originField);
|
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -458,6 +469,9 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -27,6 +27,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -771,12 +772,15 @@ public class CKQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -817,21 +821,29 @@ public class CKQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(CKConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(CKConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(CKConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(CKConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -843,6 +855,9 @@ public class CKQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -29,6 +29,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -756,12 +757,15 @@ public class Db2QueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -802,21 +806,29 @@ public class Db2QueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(Db2Constants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(Db2Constants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(Db2Constants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(Db2Constants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -828,6 +840,9 @@ public class Db2QueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -25,6 +25,7 @@ import io.dataease.plugins.datasource.entity.Dateformat;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -771,12 +772,15 @@ public class EsQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -827,21 +831,29 @@ public class EsQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(EsSqlLConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(EsSqlLConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(EsSqlLConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(EsSqlLConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -853,6 +865,9 @@ public class EsQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -26,6 +26,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -720,12 +721,15 @@ public class HiveQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -766,21 +770,29 @@ public class HiveQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(HiveConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(HiveConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(HiveConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(HiveConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -792,6 +804,9 @@ public class HiveQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -26,6 +26,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -724,12 +725,15 @@ public class ImpalaQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -770,21 +774,29 @@ public class ImpalaQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(ImpalaConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(ImpalaConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(ImpalaConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(ImpalaConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -796,6 +808,9 @@ public class ImpalaQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -696,12 +697,15 @@ public class MongoQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -742,22 +746,31 @@ public class MongoQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(MongoConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(MongoConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(MongoConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(MongoConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||||
xOrders.add(SQLObj.builder()
|
xOrders.add(SQLObj.builder()
|
||||||
@ -767,6 +780,9 @@ public class MongoQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -27,6 +27,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -417,12 +418,15 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -463,21 +467,29 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(MySQLConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(MySQLConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(MySQLConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(MySQLConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -489,6 +501,9 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -30,6 +30,7 @@ import io.dataease.plugins.datasource.query.QueryProvider;
|
|||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import io.dataease.service.chart.ChartFilterTreeService;
|
import io.dataease.service.chart.ChartFilterTreeService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -826,12 +827,15 @@ public class OracleQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -872,21 +876,29 @@ public class OracleQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
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));
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(OracleConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(OracleConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(OracleConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(OracleConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -898,6 +910,9 @@ public class OracleQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -755,12 +756,15 @@ public class PgQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -801,21 +805,29 @@ public class PgQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(PgConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(PgConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(PgConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(PgConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -827,6 +839,9 @@ public class PgQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -27,6 +27,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -756,12 +757,15 @@ public class RedshiftQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -802,21 +806,29 @@ public class RedshiftQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(PgConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(PgConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(PgConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(PgConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -828,6 +840,9 @@ public class RedshiftQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -842,12 +843,15 @@ public class SqlserverQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -888,21 +892,29 @@ public class SqlserverQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(SqlServerSQLConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(SqlServerSQLConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(SqlServerSQLConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(SqlServerSQLConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -914,6 +926,9 @@ public class SqlserverQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
ALTER TABLE `sys_auth`
|
|
||||||
MODIFY COLUMN `auth_details` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权明细' AFTER `auth_time`;
|
|
||||||
|
|
||||||
ALTER TABLE `sys_auth_detail`
|
|
||||||
MODIFY COLUMN `privilege_type` int(6) NULL DEFAULT NULL COMMENT '权限类型:1 使用/查看 3 导出/管理 5 仪表板管理 15 授权' AFTER `privilege_name`,
|
|
||||||
MODIFY COLUMN `privilege_value` int(6) NULL DEFAULT NULL COMMENT '权限值:1 可用 0 不可用' AFTER `privilege_type`;
|
|
@ -0,0 +1,2 @@
|
|||||||
|
alter table `chart_view`
|
||||||
|
add `_aggregate` TINYINT(1) default 0 null comment 'aggregate';
|
@ -1287,6 +1287,7 @@ export default {
|
|||||||
map_range: 'Map range',
|
map_range: 'Map range',
|
||||||
select_map_range: 'Please select map range',
|
select_map_range: 'Please select map range',
|
||||||
area: 'Area',
|
area: 'Area',
|
||||||
|
aggregate: 'Aggregate',
|
||||||
placeholder_field: 'Drag Field To Here',
|
placeholder_field: 'Drag Field To Here',
|
||||||
axis_label_rotate: 'Label Rotate',
|
axis_label_rotate: 'Label Rotate',
|
||||||
chart_scatter_bubble: 'Bubble',
|
chart_scatter_bubble: 'Bubble',
|
||||||
|
@ -1285,6 +1285,7 @@ export default {
|
|||||||
select_map_range: '請選擇地圖範圍',
|
select_map_range: '請選擇地圖範圍',
|
||||||
area: '地區',
|
area: '地區',
|
||||||
stack_item: '堆疊項',
|
stack_item: '堆疊項',
|
||||||
|
aggregate: '聚合',
|
||||||
placeholder_field: '拖動字段至此處',
|
placeholder_field: '拖動字段至此處',
|
||||||
axis_label_rotate: '標簽角度',
|
axis_label_rotate: '標簽角度',
|
||||||
chart_scatter_bubble: '氣泡圖',
|
chart_scatter_bubble: '氣泡圖',
|
||||||
|
@ -1285,6 +1285,7 @@ export default {
|
|||||||
select_map_range: '请选择地图范围',
|
select_map_range: '请选择地图范围',
|
||||||
area: '地区',
|
area: '地区',
|
||||||
stack_item: '堆叠项',
|
stack_item: '堆叠项',
|
||||||
|
aggregate: '聚合',
|
||||||
placeholder_field: '拖动字段至此处',
|
placeholder_field: '拖动字段至此处',
|
||||||
axis_label_rotate: '标签角度',
|
axis_label_rotate: '标签角度',
|
||||||
chart_scatter_bubble: '气泡图',
|
chart_scatter_bubble: '气泡图',
|
||||||
|
@ -12,8 +12,8 @@ import {
|
|||||||
setGradientColor,
|
setGradientColor,
|
||||||
getMeta
|
getMeta
|
||||||
} from '@/views/chart/chart/common/common_antv'
|
} from '@/views/chart/chart/common/common_antv'
|
||||||
import { antVCustomColor, handleEmptyDataStrategy } from '@/views/chart/chart/util'
|
import { antVCustomColor, getColors, handleEmptyDataStrategy, hexColorToRGBA } from '@/views/chart/chart/util'
|
||||||
import _ from 'lodash'
|
import { cloneDeep, find } from 'lodash-es'
|
||||||
|
|
||||||
export function baseBarOptionAntV(plot, container, chart, action, isGroup, isStack) {
|
export function baseBarOptionAntV(plot, container, chart, action, isGroup, isStack) {
|
||||||
// theme
|
// theme
|
||||||
@ -26,7 +26,7 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
|
|||||||
const xAxis = getXAxis(chart)
|
const xAxis = getXAxis(chart)
|
||||||
const yAxis = getYAxis(chart)
|
const yAxis = getYAxis(chart)
|
||||||
// data
|
// data
|
||||||
const data = _.cloneDeep(chart.data.data)
|
const data = cloneDeep(chart.data.data)
|
||||||
// config
|
// config
|
||||||
const slider = getSlider(chart)
|
const slider = getSlider(chart)
|
||||||
const analyse = getAnalyse(chart)
|
const analyse = getAnalyse(chart)
|
||||||
@ -153,7 +153,7 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
|
|||||||
const xAxis = getXAxis(chart)
|
const xAxis = getXAxis(chart)
|
||||||
const yAxis = getYAxis(chart)
|
const yAxis = getYAxis(chart)
|
||||||
// data
|
// data
|
||||||
const data = _.cloneDeep(chart.data.data)
|
const data = cloneDeep(chart.data.data)
|
||||||
// config
|
// config
|
||||||
const slider = getSlider(chart)
|
const slider = getSlider(chart)
|
||||||
const analyse = getAnalyse(chart)
|
const analyse = getAnalyse(chart)
|
||||||
@ -263,17 +263,27 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
||||||
|
const ifAggregate = !!chart.aggregate
|
||||||
|
|
||||||
// theme
|
// theme
|
||||||
const theme = getTheme(chart)
|
const theme = getTheme(chart)
|
||||||
// attr
|
// attr
|
||||||
const label = getLabel(chart)
|
const label = getLabel(chart)
|
||||||
|
if (label && !ifAggregate) {
|
||||||
|
label.layout = [
|
||||||
|
{ type: 'interval-adjust-position' },
|
||||||
|
{ type: 'interval-hide-overlap' },
|
||||||
|
{ type: 'limit-in-plot', cfg: { action: 'hide' }}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
const tooltip = getTooltip(chart)
|
const tooltip = getTooltip(chart)
|
||||||
// style
|
// style
|
||||||
const legend = getLegend(chart)
|
const legend = getLegend(chart)
|
||||||
const yAxis = getXAxis(chart)
|
const yAxis = getXAxis(chart)
|
||||||
const xAxis = getYAxis(chart)
|
const xAxis = getYAxis(chart)
|
||||||
// data
|
// data
|
||||||
const data = _.cloneDeep(chart.data.data)
|
const data = cloneDeep(chart.data.data)
|
||||||
|
|
||||||
const isDate = !!chart.data.isDate
|
const isDate = !!chart.data.isDate
|
||||||
|
|
||||||
@ -292,7 +302,7 @@ export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
|||||||
data: data,
|
data: data,
|
||||||
xField: 'values',
|
xField: 'values',
|
||||||
yField: 'field',
|
yField: 'field',
|
||||||
seriesField: 'category',
|
colorFiled: 'category',
|
||||||
appendPadding: getPadding(chart),
|
appendPadding: getPadding(chart),
|
||||||
label: label,
|
label: label,
|
||||||
tooltip: tooltip,
|
tooltip: tooltip,
|
||||||
@ -339,19 +349,32 @@ export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ifAggregate) {
|
||||||
|
options.seriesField = 'category'
|
||||||
|
delete options.isGroup
|
||||||
|
delete options.isStack
|
||||||
|
} else {
|
||||||
|
options.isGroup = true
|
||||||
|
options.isStack = true
|
||||||
|
}
|
||||||
|
|
||||||
if (isDate) {
|
if (isDate) {
|
||||||
options.meta = {
|
options.meta = {
|
||||||
values: {
|
values: {
|
||||||
type: 'time',
|
type: 'time',
|
||||||
min: minTime,
|
min: minTime,
|
||||||
max: maxTime
|
max: maxTime,
|
||||||
|
mask: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
key: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
options.meta = {
|
options.meta = {
|
||||||
values: {
|
values: {
|
||||||
min: minNumber,
|
min: minNumber,
|
||||||
max: maxNumber
|
max: maxNumber,
|
||||||
|
mask: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
key: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -370,17 +393,39 @@ export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete options.isGroup
|
|
||||||
delete options.isStack
|
|
||||||
|
|
||||||
options.isPercent = chart.type.includes('percentage')
|
options.isPercent = chart.type.includes('percentage')
|
||||||
// custom color
|
// custom color
|
||||||
options.color = antVCustomColor(chart)
|
if (ifAggregate) {
|
||||||
if (customAttr.color.gradient) {
|
options.color = antVCustomColor(chart)
|
||||||
options.color = options.color.map((ele) => {
|
if (customAttr.color.gradient) {
|
||||||
return setGradientColor(ele, customAttr.color.gradient)
|
options.color = options.color.map((ele) => {
|
||||||
})
|
return setGradientColor(ele, customAttr.color.gradient)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (chart.customAttr) {
|
||||||
|
// color
|
||||||
|
if (customAttr.color) {
|
||||||
|
const c = JSON.parse(JSON.stringify(customAttr.color))
|
||||||
|
const customColors = getColors(chart, c.colors, false)
|
||||||
|
options.color = function(obj) {
|
||||||
|
const colorObj = find(customColors, (o) => {
|
||||||
|
return o.name === obj.field
|
||||||
|
})
|
||||||
|
if (colorObj === undefined) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
const color = hexColorToRGBA(colorObj.color, c.alpha)
|
||||||
|
if (customAttr.color.gradient) {
|
||||||
|
return setGradientColor(color, customAttr.color.gradient)
|
||||||
|
} else {
|
||||||
|
return color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理空值
|
// 处理空值
|
||||||
if (chart.senior) {
|
if (chart.senior) {
|
||||||
let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy
|
let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy
|
||||||
@ -415,7 +460,7 @@ export function baseBidirectionalBarOptionAntV(plot, container, chart, action, i
|
|||||||
// 处理横轴标题方向不对
|
// 处理横轴标题方向不对
|
||||||
yAxis?.title && (yAxis.title.autoRotate = false)
|
yAxis?.title && (yAxis.title.autoRotate = false)
|
||||||
// data
|
// data
|
||||||
const data = _.cloneDeep(chart.data.data)
|
const data = cloneDeep(chart.data.data)
|
||||||
// options
|
// options
|
||||||
const options = {
|
const options = {
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
@ -3526,10 +3526,30 @@ export function customColor(custom, res, colors) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getColors(chart, colors, reset) {
|
export function getColors(chart, colors, reset) {
|
||||||
|
const ifAggregate = !!chart.aggregate
|
||||||
// 自定义颜色,先按照没有设定的情况,并排好序,当做最终结果
|
// 自定义颜色,先按照没有设定的情况,并排好序,当做最终结果
|
||||||
let seriesColors = []
|
let seriesColors = []
|
||||||
let series
|
let series
|
||||||
if (chart.type.includes('stack')) {
|
if (!ifAggregate && chart.type === 'bar-time-range') {
|
||||||
|
if (chart.data && chart.data.data && chart.data.data.length > 0) {
|
||||||
|
// 只能处理field字段
|
||||||
|
const groups = []
|
||||||
|
for (let i = 0; i < chart.data.data.length; i++) {
|
||||||
|
const name = chart.data.data[i].field
|
||||||
|
if (groups.indexOf(name) < 0) {
|
||||||
|
groups.push(name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < groups.length; i++) {
|
||||||
|
const s = groups[i]
|
||||||
|
seriesColors.push({
|
||||||
|
name: s,
|
||||||
|
color: colors[i % colors.length],
|
||||||
|
isCustom: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (chart.type.includes('stack')) {
|
||||||
if (chart.data) {
|
if (chart.data) {
|
||||||
const data = chart.data.data
|
const data = chart.data.data
|
||||||
const stackData = []
|
const stackData = []
|
||||||
|
@ -1192,6 +1192,21 @@
|
|||||||
<span class="drag-placeholder-style-span">{{ $t('chart.placeholder_field') }}</span>
|
<span class="drag-placeholder-style-span">{{ $t('chart.placeholder_field') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row class="padding-lr">
|
||||||
|
<span>
|
||||||
|
{{ $t('chart.aggregate') }}{{ $t('chart.chart_bar_time') }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="padding-lr"
|
||||||
|
>
|
||||||
|
<el-checkbox
|
||||||
|
v-model="view.aggregate"
|
||||||
|
class="el-input-refresh-loading"
|
||||||
|
@change="aggregateChange"
|
||||||
|
/>
|
||||||
|
{{ $t('chart.aggregate') }}
|
||||||
|
</span>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@ -3400,6 +3415,9 @@ export default {
|
|||||||
drillItemChange(item) {
|
drillItemChange(item) {
|
||||||
this.calcData(true)
|
this.calcData(true)
|
||||||
},
|
},
|
||||||
|
aggregateChange() {
|
||||||
|
this.calcData(true)
|
||||||
|
},
|
||||||
drillItemRemove(item) {
|
drillItemRemove(item) {
|
||||||
this.view.drillFields.splice(item.index, 1)
|
this.view.drillFields.splice(item.index, 1)
|
||||||
this.calcData(true)
|
this.calcData(true)
|
||||||
|
@ -28,6 +28,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -473,12 +474,15 @@ public class DmQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -525,22 +529,31 @@ public class DmQueryProvider extends QueryProvider {
|
|||||||
String fieldAlias = String.format(OracleConstants.ALIAS_FIX,
|
String fieldAlias = String.format(OracleConstants.ALIAS_FIX,
|
||||||
String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i));
|
String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i));
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(OracleConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(OracleConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(OracleConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(OracleConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||||
xOrders.add(SQLObj.builder()
|
xOrders.add(SQLObj.builder()
|
||||||
@ -550,6 +563,9 @@ public class DmQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理视图中字段过滤
|
// 处理视图中字段过滤
|
||||||
|
@ -28,6 +28,7 @@ import io.dataease.plugins.datasource.kingbase.provider.KingbaseConfig;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -460,12 +461,15 @@ public class KingbaseQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -510,22 +514,31 @@ public class KingbaseQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(KingbaseConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(KingbaseConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(KingbaseConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(KingbaseConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||||
xOrders.add(SQLObj.builder()
|
xOrders.add(SQLObj.builder()
|
||||||
@ -535,6 +548,9 @@ public class KingbaseQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeIt
|
|||||||
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -369,12 +370,16 @@ public class KylinQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -415,22 +420,31 @@ public class KylinQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(KylinConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(KylinConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(KylinConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(KylinConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||||
xOrders.add(SQLObj.builder()
|
xOrders.add(SQLObj.builder()
|
||||||
@ -440,6 +454,9 @@ public class KylinQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
|||||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -374,12 +375,15 @@ public class MaxcomputeQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -420,22 +424,31 @@ public class MaxcomputeQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(MaxConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(MaxConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(MaxConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(MaxConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||||
xOrders.add(SQLObj.builder()
|
xOrders.add(SQLObj.builder()
|
||||||
@ -445,6 +458,9 @@ public class MaxcomputeQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import io.dataease.plugins.datasource.entity.PageInfo;
|
|||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import io.dataease.plugins.datasource.query.Utils;
|
import io.dataease.plugins.datasource.query.Utils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -375,12 +376,15 @@ public class MongobiQueryProvider extends QueryProvider {
|
|||||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||||
.build();
|
.build();
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -421,22 +425,31 @@ public class MongobiQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(MongoConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(MongoConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(MongoConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(MongoConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||||
xOrders.add(SQLObj.builder()
|
xOrders.add(SQLObj.builder()
|
||||||
@ -446,6 +459,9 @@ public class MongobiQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import io.dataease.plugins.datasource.entity.Dateformat;
|
|||||||
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
||||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -371,12 +372,15 @@ public class PrestoQueryProvider extends QueryProvider {
|
|||||||
.build();
|
.build();
|
||||||
setSchema(tableObj, ds);
|
setSchema(tableObj, ds);
|
||||||
List<SQLObj> xFields = new ArrayList<>();
|
List<SQLObj> xFields = new ArrayList<>();
|
||||||
|
List<SQLObj> xFields2Tail = new ArrayList<>();
|
||||||
List<SQLObj> xOrders = new ArrayList<>();
|
List<SQLObj> xOrders = new ArrayList<>();
|
||||||
|
|
||||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||||
List<String> yWheres = new ArrayList<>();
|
List<String> yWheres = new ArrayList<>();
|
||||||
List<SQLObj> yOrders = new ArrayList<>();
|
List<SQLObj> yOrders = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean ifAggregate = BooleanUtils.isTrue(view.getAggregate());
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||||
for (int i = 0; i < xAxis.size(); i++) {
|
for (int i = 0; i < xAxis.size(); i++) {
|
||||||
ChartViewFieldDTO x = xAxis.get(i);
|
ChartViewFieldDTO x = xAxis.get(i);
|
||||||
@ -417,21 +421,29 @@ public class PrestoQueryProvider extends QueryProvider {
|
|||||||
}
|
}
|
||||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||||
|
|
||||||
if (i == baseXAxis.size()) {// 起止时间
|
if (ifAggregate) {
|
||||||
String fieldName = String.format(PrestoConstants.AGG_FIELD, "min", originField);
|
if (i == baseXAxis.size()) {// 起止时间
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
String fieldName = String.format(PrestoConstants.AGG_FIELD, "min", originField);
|
||||||
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
|
||||||
} else if (i == baseXAxis.size() + 1) {
|
} else if (i == baseXAxis.size() + 1) {
|
||||||
String fieldName = String.format(PrestoConstants.AGG_FIELD, "max", originField);
|
String fieldName = String.format(PrestoConstants.AGG_FIELD, "max", originField);
|
||||||
|
|
||||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||||
|
|
||||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
// 处理横轴字段
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 处理横轴字段
|
if (i == baseXAxis.size() || i == baseXAxis.size() + 1) {// 起止时间
|
||||||
xFields.add(getXFields(x, originField, fieldAlias));
|
xFields2Tail.add(getXFields(x, originField, fieldAlias));
|
||||||
|
} else {
|
||||||
|
xFields.add(getXFields(x, originField, fieldAlias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理横轴排序
|
// 处理横轴排序
|
||||||
@ -443,6 +455,9 @@ public class PrestoQueryProvider extends QueryProvider {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ifAggregate) { //把起止时间放到数组最后
|
||||||
|
xFields.addAll(xFields2Tail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,5 +43,7 @@ public class ChartView implements Serializable {
|
|||||||
|
|
||||||
private Integer refreshTime;
|
private Integer refreshTime;
|
||||||
|
|
||||||
|
private Boolean aggregate;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
@ -1373,6 +1373,66 @@ public class ChartViewExample {
|
|||||||
addCriterion("refresh_time not between", value1, value2, "refreshTime");
|
addCriterion("refresh_time not between", value1, value2, "refreshTime");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateIsNull() {
|
||||||
|
addCriterion("_aggregate is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateIsNotNull() {
|
||||||
|
addCriterion("_aggregate is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateEqualTo(Boolean value) {
|
||||||
|
addCriterion("_aggregate =", value, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateNotEqualTo(Boolean value) {
|
||||||
|
addCriterion("_aggregate <>", value, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateGreaterThan(Boolean value) {
|
||||||
|
addCriterion("_aggregate >", value, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateGreaterThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("_aggregate >=", value, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateLessThan(Boolean value) {
|
||||||
|
addCriterion("_aggregate <", value, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateLessThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("_aggregate <=", value, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateIn(List<Boolean> values) {
|
||||||
|
addCriterion("_aggregate in", values, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateNotIn(List<Boolean> values) {
|
||||||
|
addCriterion("_aggregate not in", values, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("_aggregate between", value1, value2, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAggregateNotBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("_aggregate not between", value1, value2, "aggregate");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Criteria extends GeneratedCriteria {
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
<result column="refresh_view_enable" jdbcType="BIT" property="refreshViewEnable" />
|
<result column="refresh_view_enable" jdbcType="BIT" property="refreshViewEnable" />
|
||||||
<result column="refresh_unit" jdbcType="VARCHAR" property="refreshUnit" />
|
<result column="refresh_unit" jdbcType="VARCHAR" property="refreshUnit" />
|
||||||
<result column="refresh_time" jdbcType="INTEGER" property="refreshTime" />
|
<result column="refresh_time" jdbcType="INTEGER" property="refreshTime" />
|
||||||
|
<result column="_aggregate" jdbcType="BIT" property="aggregate" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.plugins.common.base.domain.ChartViewWithBLOBs">
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.plugins.common.base.domain.ChartViewWithBLOBs">
|
||||||
<result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" />
|
<result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" />
|
||||||
@ -98,7 +99,7 @@
|
|||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
|
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
|
||||||
create_by, create_time, update_time, style_priority, chart_type, is_plugin, data_from,
|
create_by, create_time, update_time, style_priority, chart_type, is_plugin, data_from,
|
||||||
refresh_view_enable, refresh_unit, refresh_time
|
refresh_view_enable, refresh_unit, refresh_time, _aggregate
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
|
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
|
||||||
@ -159,22 +160,24 @@
|
|||||||
create_by, create_time, update_time,
|
create_by, create_time, update_time,
|
||||||
style_priority, chart_type, is_plugin,
|
style_priority, chart_type, is_plugin,
|
||||||
data_from, refresh_view_enable, refresh_unit,
|
data_from, refresh_view_enable, refresh_unit,
|
||||||
refresh_time, x_axis, x_axis_ext,
|
refresh_time, _aggregate, x_axis,
|
||||||
y_axis, y_axis_ext, ext_stack,
|
x_axis_ext, y_axis, y_axis_ext,
|
||||||
ext_bubble, custom_attr, custom_style,
|
ext_stack, ext_bubble, custom_attr,
|
||||||
custom_filter, drill_fields, senior,
|
custom_style, custom_filter, drill_fields,
|
||||||
snapshot, view_fields)
|
senior, snapshot, view_fields
|
||||||
|
)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
|
||||||
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||||
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
|
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
|
||||||
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||||
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
|
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
|
||||||
#{dataFrom,jdbcType=VARCHAR}, #{refreshViewEnable,jdbcType=BIT}, #{refreshUnit,jdbcType=VARCHAR},
|
#{dataFrom,jdbcType=VARCHAR}, #{refreshViewEnable,jdbcType=BIT}, #{refreshUnit,jdbcType=VARCHAR},
|
||||||
#{refreshTime,jdbcType=INTEGER}, #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR},
|
#{refreshTime,jdbcType=INTEGER}, #{aggregate,jdbcType=BIT}, #{xAxis,jdbcType=LONGVARCHAR},
|
||||||
#{yAxis,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR},
|
#{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR},
|
||||||
#{extBubble,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR},
|
#{extStack,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR},
|
||||||
#{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR},
|
#{customStyle,jdbcType=LONGVARCHAR}, #{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR},
|
||||||
#{snapshot,jdbcType=LONGVARCHAR}, #{viewFields,jdbcType=LONGVARCHAR})
|
#{senior,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR}, #{viewFields,jdbcType=LONGVARCHAR}
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.dataease.plugins.common.base.domain.ChartViewWithBLOBs">
|
<insert id="insertSelective" parameterType="io.dataease.plugins.common.base.domain.ChartViewWithBLOBs">
|
||||||
insert into chart_view
|
insert into chart_view
|
||||||
@ -236,6 +239,9 @@
|
|||||||
<if test="refreshTime != null">
|
<if test="refreshTime != null">
|
||||||
refresh_time,
|
refresh_time,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="aggregate != null">
|
||||||
|
_aggregate,
|
||||||
|
</if>
|
||||||
<if test="xAxis != null">
|
<if test="xAxis != null">
|
||||||
x_axis,
|
x_axis,
|
||||||
</if>
|
</if>
|
||||||
@ -334,6 +340,9 @@
|
|||||||
<if test="refreshTime != null">
|
<if test="refreshTime != null">
|
||||||
#{refreshTime,jdbcType=INTEGER},
|
#{refreshTime,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="aggregate != null">
|
||||||
|
#{aggregate,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
<if test="xAxis != null">
|
<if test="xAxis != null">
|
||||||
#{xAxis,jdbcType=LONGVARCHAR},
|
#{xAxis,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -441,6 +450,9 @@
|
|||||||
<if test="record.refreshTime != null">
|
<if test="record.refreshTime != null">
|
||||||
refresh_time = #{record.refreshTime,jdbcType=INTEGER},
|
refresh_time = #{record.refreshTime,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.aggregate != null">
|
||||||
|
_aggregate = #{record.aggregate,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
<if test="record.xAxis != null">
|
<if test="record.xAxis != null">
|
||||||
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
|
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -506,6 +518,7 @@
|
|||||||
refresh_view_enable = #{record.refreshViewEnable,jdbcType=BIT},
|
refresh_view_enable = #{record.refreshViewEnable,jdbcType=BIT},
|
||||||
refresh_unit = #{record.refreshUnit,jdbcType=VARCHAR},
|
refresh_unit = #{record.refreshUnit,jdbcType=VARCHAR},
|
||||||
refresh_time = #{record.refreshTime,jdbcType=INTEGER},
|
refresh_time = #{record.refreshTime,jdbcType=INTEGER},
|
||||||
|
_aggregate = #{record.aggregate,jdbcType=BIT},
|
||||||
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
|
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
|
||||||
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
|
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
|
||||||
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
|
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
|
||||||
@ -543,7 +556,8 @@
|
|||||||
data_from = #{record.dataFrom,jdbcType=VARCHAR},
|
data_from = #{record.dataFrom,jdbcType=VARCHAR},
|
||||||
refresh_view_enable = #{record.refreshViewEnable,jdbcType=BIT},
|
refresh_view_enable = #{record.refreshViewEnable,jdbcType=BIT},
|
||||||
refresh_unit = #{record.refreshUnit,jdbcType=VARCHAR},
|
refresh_unit = #{record.refreshUnit,jdbcType=VARCHAR},
|
||||||
refresh_time = #{record.refreshTime,jdbcType=INTEGER}
|
refresh_time = #{record.refreshTime,jdbcType=INTEGER},
|
||||||
|
_aggregate = #{record.aggregate,jdbcType=BIT}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
@ -605,6 +619,9 @@
|
|||||||
<if test="refreshTime != null">
|
<if test="refreshTime != null">
|
||||||
refresh_time = #{refreshTime,jdbcType=INTEGER},
|
refresh_time = #{refreshTime,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="aggregate != null">
|
||||||
|
_aggregate = #{aggregate,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
<if test="xAxis != null">
|
<if test="xAxis != null">
|
||||||
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
|
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -667,6 +684,7 @@
|
|||||||
refresh_view_enable = #{refreshViewEnable,jdbcType=BIT},
|
refresh_view_enable = #{refreshViewEnable,jdbcType=BIT},
|
||||||
refresh_unit = #{refreshUnit,jdbcType=VARCHAR},
|
refresh_unit = #{refreshUnit,jdbcType=VARCHAR},
|
||||||
refresh_time = #{refreshTime,jdbcType=INTEGER},
|
refresh_time = #{refreshTime,jdbcType=INTEGER},
|
||||||
|
_aggregate = #{aggregate,jdbcType=BIT},
|
||||||
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
|
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
|
||||||
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
|
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
|
||||||
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
|
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
|
||||||
@ -701,7 +719,8 @@
|
|||||||
data_from = #{dataFrom,jdbcType=VARCHAR},
|
data_from = #{dataFrom,jdbcType=VARCHAR},
|
||||||
refresh_view_enable = #{refreshViewEnable,jdbcType=BIT},
|
refresh_view_enable = #{refreshViewEnable,jdbcType=BIT},
|
||||||
refresh_unit = #{refreshUnit,jdbcType=VARCHAR},
|
refresh_unit = #{refreshUnit,jdbcType=VARCHAR},
|
||||||
refresh_time = #{refreshTime,jdbcType=INTEGER}
|
refresh_time = #{refreshTime,jdbcType=INTEGER},
|
||||||
|
_aggregate = #{aggregate,jdbcType=BIT}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table tableName="de_driver">
|
<table tableName="chart_view">
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user