码迷,mamicode.com
首页 > 其他好文 > 详细

MyBatis中choose when正确写法

时间:2018-12-22 19:36:58      阅读:435      评论:0      收藏:0      [点我收藏+]

标签:tis   core   null   ISE   otherwise   range   cdata   when   test   

<choose>
    <when test="scoreRange!=null and scoreRange eq 1">
        AND sc.score <![CDATA[ < ]]> 60
    </when>
    <when test="scoreRange!=null and scoreRange eq 2">
        AND (sc.score <![CDATA[ >= ]]> 60 AND sc.score <![CDATA[ <= ]]> 70 )
    </when>
    <when test="scoreRange!=null and scoreRange eq 3">
        AND (sc.score <![CDATA[ >= ]]> 70 AND sc.score <![CDATA[ <= ]]> 80 )
    </when>
    <when test="scoreRange!=null and scoreRange eq 4">
        AND (sc.score <![CDATA[ >= ]]> 80 AND sc.score <![CDATA[ <= ]]> 90 )
    </when>
    <when test="scoreRange!=null and scoreRange eq 5">
        AND sc.score <![CDATA[ > ]]> 90
    </when>
    <otherwise>
    </otherwise>
</choose>

MyBatis中choose when正确写法

标签:tis   core   null   ISE   otherwise   range   cdata   when   test   

原文地址:https://www.cnblogs.com/tangyouwei/p/Mybatis.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!