多条件查询时,有的条件必须为括号内的多条件查询,就需要在.xml中拼接动态的括号,
<if test="sentRed !=null and sentRed!=' '">
and ( tt.send_red > 0
</if>
<if test="sentRed !=null and sentRed!=' '">
)
执行结果为 and ( tt.send_red > 0)
多条件查询时,有的条件必须为括号内的多条件查询,就需要在.xml中拼接动态的括号,
<if test="sentRed !=null and sentRed!=' '">
and ( tt.send_red > 0
</if>
<if test="sentRed !=null and sentRed!=' '">
)
执行结果为 and ( tt.send_red > 0)