forked from github/dataease
Merge pull request #12918 from dataease/pr@dev-v2@fix_ds
fix(数据源): 修复date类型过滤出错的问题 #12912 #12913
This commit is contained in:
commit
4fb63b12fd
@ -130,7 +130,13 @@ public class CustomWhere2Str {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 此处获取标准格式的日期
|
// 此处获取标准格式的日期
|
||||||
whereName = originName;
|
if (StringUtils.equalsIgnoreCase(field.getType(), "date")) {
|
||||||
|
whereName = String.format(SQLConstants.DE_CAST_DATE_FORMAT, originName,
|
||||||
|
SQLConstants.DEFAULT_DATE_FORMAT,
|
||||||
|
SQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
|
} else {
|
||||||
|
whereName = originName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
|
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
|
||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
|
@ -143,7 +143,13 @@ public class WhereTree2Str {
|
|||||||
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originName), SQLConstants.DEFAULT_DATE_FORMAT);
|
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originName), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
whereName = originName;
|
if (StringUtils.equalsIgnoreCase(field.getType(), "date")) {
|
||||||
|
whereName = String.format(SQLConstants.DE_CAST_DATE_FORMAT, originName,
|
||||||
|
SQLConstants.DEFAULT_DATE_FORMAT,
|
||||||
|
SQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
|
} else {
|
||||||
|
whereName = originName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
|
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
|
||||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||||
|
Loading…
Reference in New Issue
Block a user