forked from github/dataease
fix: 过滤时间类型字段可能出错
This commit is contained in:
parent
176742748d
commit
a47c54c2a6
@ -690,7 +690,7 @@ public class DorisQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||||
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
@ -747,7 +747,7 @@ public class DorisQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||||
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
|
@ -675,7 +675,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
@ -733,7 +733,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
|
@ -710,7 +710,7 @@ public class OracleQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
@ -772,7 +772,7 @@ public class OracleQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
|
@ -702,7 +702,7 @@ public class PgQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(PgConstants.TO_DATE, originName, PgConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(PgConstants.TO_DATE, originName, PgConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(PgConstants.CAST, originName, "bigint");
|
String cast = String.format(PgConstants.CAST, originName, "bigint");
|
||||||
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
|
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
|
||||||
}
|
}
|
||||||
@ -760,7 +760,7 @@ public class PgQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(PgConstants.TO_DATE, originName, PgConstants.DEFAULT_DATE_FORMAT);
|
whereName = String.format(PgConstants.TO_DATE, originName, PgConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(PgConstants.CAST, originName, "bigint");
|
String cast = String.format(PgConstants.CAST, originName, "bigint");
|
||||||
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
|
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
|
||||||
}
|
}
|
||||||
|
@ -657,7 +657,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
|
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
|
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
|
||||||
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
|
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
|
||||||
}
|
}
|
||||||
@ -706,7 +706,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
|||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
|
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
|
||||||
}
|
}
|
||||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
|
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||||
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
|
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
|
||||||
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
|
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user