mybatis报错:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exception
问题一:
传参数为0的时候,为啥它默认也是null,我的参数为0和1,如果参数为0和1的时候做事件A,为null或者其他的时候做事件B,但是传1的时候正常,传0的时候它自动默认也是NULL,这个要怎么处理啊。
解决方案:
<if test="noRenewalFalg != null">,不能用<if test="noRenewalFalg!= null and noRenewalFalg!= '' ">
问题二:
在注册或者修改的时间如果用到时间参数的话,在mybatis里面也配置也必须是
<if test="noRenewalFalg != null">,不能用<if test="noRenewalFalg!= null and noRenewalFalg!= '' ">
本文总结了在使用MyBatis时遇到的两个问题:一是当参数为0时,MyBatis将其识别为NULL;二是处理时间参数时的配置问题。针对问题一,解决方案是在XML映射文件中使用条件判断`<if test="noRenewalFalg != null">`,避免使用`<if test="noRenewalFalg!= null and noRenewalFalg!= '' ">`。对于问题二,同样需要正确配置条件判断来确保时间参数的正确处理。
991

被折叠的 条评论
为什么被折叠?



