MyBatis把传过来的Integer类型的0当作空字符串

传递Integer类型的值,如果传递的是0,到mybatis的mapper的xml文件中是把值当作空字符串,mybatis源码对其进行了强制定义。

<if test="status != null and status !=  '' or status == 0">

使用时增加多一个or status == 0判断

posted @ 2018-01-05 09:32  黎波波  阅读(336)  评论(0编辑  收藏  举报