From 322fd202cd29699e9f958fd546c06bdb09204900 Mon Sep 17 00:00:00 2001 From: junjun Date: Wed, 17 Apr 2024 11:52:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/engine/trans/CustomWhere2Str.java | 4 ++-- .../src/main/java/io/dataease/engine/trans/WhereTree2Str.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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"));