0
点赞
收藏
分享

微信扫一扫

mybatis 动态sql多条件括号

一ke大白菜 2022-01-07 阅读 123
sqlmybatis

多条件查询时,有的条件必须为括号内的多条件查询,就需要在.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 条评论