forked from github/dataease
Merge pull request #9159 from dataease/pr@dev-v2@fix_filter
fix: 修复日期过滤逻辑错误 #9155
This commit is contained in:
commit
b58e61f24a
@ -86,18 +86,17 @@ public class CustomWhere2Str {
|
|||||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (field.getDeType() == 1) {
|
||||||
|
// 规定几种日期格式,一一匹配,匹配到就是该格式
|
||||||
|
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
|
||||||
|
}
|
||||||
|
|
||||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||||
String value = filterItemDTO.getValue();
|
String value = filterItemDTO.getValue();
|
||||||
String whereTerm = Utils.transFilterTerm(filterItemDTO.getTerm());
|
String whereTerm = Utils.transFilterTerm(filterItemDTO.getTerm());
|
||||||
String whereValue = "";
|
String whereValue = "";
|
||||||
|
|
||||||
// String whereNameReal;
|
|
||||||
if (field.getDeType() == 1) {
|
|
||||||
// 规定几种日期格式,一一匹配,匹配到就是该格式
|
|
||||||
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||||
whereValue = "";
|
whereValue = "";
|
||||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user