From 1a7624b303b06210ba275543c87fbe11433f1f3d Mon Sep 17 00:00:00 2001 From: sanshan Date: Fri, 1 Nov 2024 10:19:24 +0800 Subject: [PATCH] Update query.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 判断一个值是不是null,使用的是is null,不是isnull,需要把is和null分开写。 --- tools/search/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/search/query.go b/tools/search/query.go index ff56f1ac..5646b912 100644 --- a/tools/search/query.go +++ b/tools/search/query.go @@ -98,7 +98,7 @@ func pgSql(driver string, t *resolveSearchTag, condition Condition, qValue refle condition.SetWhere(fmt.Sprintf("%s.%s in (?)", t.Table, t.Column), []interface{}{qValue.Field(i).Interface()}) case "isnull": if !(qValue.Field(i).IsZero() && qValue.Field(i).IsNil()) { - condition.SetWhere(fmt.Sprintf("%s.%s isnull", t.Table, t.Column), make([]interface{}, 0)) + condition.SetWhere(fmt.Sprintf("%s.%s is null", t.Table, t.Column), make([]interface{}, 0)) } case "order": switch strings.ToLower(qValue.Field(i).String()) {