Mybatis的Mapper.xml中<if test>报NumberFormatException

来源:互联网 发布:宝信软件 编辑:程序博客网 时间:2024/05/17 23:09

在Mybatis的Mapper.xml中<if test="">中使用纯数字字符串进行判断时报NumberFormatException异常

解决:

if <test="">条件中若判断有某参数是否为String类型的'0',需要使用'0'.toString()方法

即if<test="type != null and'0'.toString()!=type">
PLUS:<if test="">中多条件判断 用and 连接,注意是小写and
阅读全文
1 0
原创粉丝点击