Mybatis的Xml中if-else写法,when会不会匹配多个

例子有点憨,将就看

<choose>
  <when test="id = 1">
  and id = 2
  </when>
  <when test="id = 2">
  and id = 3
  </when>
  <otherwise>
  and id is null
  </otherwise>
</choose>

choose中的when会不会匹配多个? 不会,从上到下判断,匹配到一个之后,其他的就不会匹配了

posted @   InkYi  阅读(463)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示