MyBatis 判断条件为等于的时候,常量需要加 .toString()

时间:2017-09-02 17:36:55   收藏:0   阅读:1240

当MyBatis 判断条件为等于的时候,常量需要加 .toString() 来转换,这种方法是稳定的,推荐使用,比如:

<!-- 正确的,稳定,推荐使用 -->  
<if test="newsImage != null and newsImage == ‘0‘.toString()">  
    <![CDATA[ and len(newsImage) > 0 ]]>  
</if> 

参考网址

原文:http://www.cnblogs.com/Dreamice/p/7466962.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!