mybatis 动态sql多条件括号

阅读 124

2022-01-07

多条件查询时,有的条件必须为括号内的多条件查询,就需要在.xml中拼接动态的括号,

<if test="sentRed !=null and sentRed!=' '">
	and ( tt.send_red &gt; 0
</if>
<if test="sentRed !=null and sentRed!=' '">
	)
执行结果为 and ( tt.send_red > 0)

相关推荐

精彩评论(0)

0 0 举报