Mybatis中if else的实现

首先在mybatis语法中是没有 if else写法得,如果需要使用则可以用choose when的语法代替

1
2
3
4
5
6
7
8
<choose>
<when test="params!=null">
right JOIN
</when>
<otherwise>
LEFT JOIN
</otherwise>
</choose>