fix: 修复嵌套空条件及表达式全被忽略时生成 NULL 导致 SQL 语义错误的问题

1. 嵌套子条件为空时也应返回对应逻辑类型的单位元(AND为true,OR为false),
   而不是只在根条件生效,否则空子条件会在父级拼接出 NULL,污染整个 WHERE 子句
2. 表达式因 IsIgnoreEmptyParma 被全部过滤后 conditions 为空的情况,
   同样需要按 AND/OR 返回单位元,避免拼出空的表达式列表
This commit is contained in:
2026-10-15 14:57:27 +08:00
parent dcfd2f42da
commit 92fe9f8c01
3 changed files with 9 additions and 10 deletions
+3 -2
View File
@@ -13,14 +13,15 @@ require (
)
require (
github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-chi/chi/v5 v5.0.12 // indirect
github.com/mattn/go-sqlite3 v1.14.42 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tidwall/gjson v1.17.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/text v0.39.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)