diff --git a/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java b/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java index 360f99c6ab..1b8ca9c25d 100644 --- a/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java +++ b/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java @@ -113,12 +113,12 @@ public class CustomWhere2Str { } else { // 如果是时间字段过滤,当条件是等于和不等于的时候转换成between和not between if (field.getDeType() == 1) { - if (StringUtils.containsIgnoreCase(whereTerm, "=")) { + if (StringUtils.equalsIgnoreCase(whereTerm, " = ")) { whereTerm = " BETWEEN "; // 把value类似过滤组件处理,获得start time和end time Map stringLongMap = Utils.parseDateTimeValue(value); whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime")); - } else if (StringUtils.containsIgnoreCase(whereTerm, "<>")) { + } else if (StringUtils.equalsIgnoreCase(whereTerm, " <> ")) { whereTerm = " NOT BETWEEN "; Map stringLongMap = Utils.parseDateTimeValue(value); whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime")); diff --git a/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java b/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java index cef6a80e07..32aa0a51d6 100644 --- a/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java +++ b/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java @@ -149,12 +149,12 @@ public class WhereTree2Str { } else { // 如果是时间字段过滤,当条件是等于和不等于的时候转换成between和not between if (field.getDeType() == 1) { - if (StringUtils.containsIgnoreCase(whereTerm, "=")) { + if (StringUtils.equalsIgnoreCase(whereTerm, " = ")) { whereTerm = " BETWEEN "; // 把value类似过滤组件处理,获得start time和end time Map stringLongMap = Utils.parseDateTimeValue(value); whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime")); - } else if (StringUtils.containsIgnoreCase(whereTerm, "<>")) { + } else if (StringUtils.equalsIgnoreCase(whereTerm, " <> ")) { whereTerm = " NOT BETWEEN "; Map stringLongMap = Utils.parseDateTimeValue(value); whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime"));