Merge pull request #763 from dataease/pr@dev@fix_ds_filter

fix: 过滤时间类型字段可能出错
This commit is contained in:
XiaJunjie2020
2021-09-03 16:37:45 +08:00
committed by GitHub
4 changed files with 24 additions and 0 deletions

View File

@@ -679,6 +679,9 @@ public class MysqlQueryProvider extends QueryProvider {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}
@@ -734,6 +737,9 @@ public class MysqlQueryProvider extends QueryProvider {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}

View File

@@ -714,6 +714,9 @@ public class OracleQueryProvider extends QueryProvider {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}
@@ -773,6 +776,9 @@ public class OracleQueryProvider extends QueryProvider {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}

View File

@@ -706,6 +706,9 @@ public class PgQueryProvider extends QueryProvider {
String cast = String.format(PgConstants.CAST, originName, "bigint");
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}
@@ -761,6 +764,9 @@ public class PgQueryProvider extends QueryProvider {
String cast = String.format(PgConstants.CAST, originName, "bigint");
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}

View File

@@ -661,6 +661,9 @@ public class SqlserverQueryProvider extends QueryProvider {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}
@@ -707,6 +710,9 @@ public class SqlserverQueryProvider extends QueryProvider {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
}
if (field.getDeExtractType() == 1) {
whereName = originName;
}
} else {
whereName = originName;
}