Closed ciazealee closed 2 years ago
我想要达到 where a = true and (b = true or b is null)
<trimWhere> <andEqual field="a" value="true"/> <andIsNull field="b" /> <orEqual field="b" value="true"/> </trimWhere>
上面生成的是 where a = true and b = true or b is null,不是想要的效果,有什么办法可以加优先级吗?
你在 XML 中是可以写任意 SQL 纯文本的,原本 SQL 是啥样,你就写成啥样就行了,不一定要用语义化标签的,除非动态条件需要。如果需要动态 if /else 判断的,本身也是支持的,用逻辑控制语法 即可,就跟 Mybatis 一样了。
if /else
明白了
我想要达到 where a = true and (b = true or b is null)
上面生成的是 where a = true and b = true or b is null,不是想要的效果,有什么办法可以加优先级吗?