mybatis int 类型判断<if>

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

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

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

 

posted @ 2016-03-28 14:35  钟政123  阅读(4864)  评论(0编辑  收藏  举报