mybatis int 类型判断<if>

时间:2016-03-28 15:31:36   收藏:0   阅读:541

   如果数据类型是integer或者int,也就是数据类型的,在用<if>标签做动态语句的时候 不用判断是否为"‘‘"

<if test="sex != null">
        `sex` = #{sex},
        </if>
        <if test="mobile != null and mobile != ‘‘">
        `mobile` = #{mobile},
        </if>

  而字符类型则需要判断,例子如上,sex是integer类型的,mobile是字符类型的

 

原文:http://www.cnblogs.com/zhongzheng123/p/5328959.html

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