@malloc

导航

mybatis异常问题记录

1、参数类型integer,if标签<if test="dstIp=! '' ">,若dstIp=0,返回false,因""空字符串被转换为0.

 mybatis源码OgnlOps.class中compareWithconversion()方法中doubleValue()方法

2、if标签比较使用的是OGNL表达式,<if test ="id=='a'"> 因OGNL表达式把单引号'',作为字符处理,与字符串比较时,永为false。因此若要比较单字符字符串可:

   交换单双引号<if test =‘id==“a” ’>,或者<if test ="id=='a'.toString()">

posted on 2019-11-02 15:22  malloc+  阅读(119)  评论(0编辑  收藏  举报