数据库mybaits的xml配置问题导致字段数字转换异常
2020-01-08 09:47:43.885 INFO com.aoto.vdata.manager.controllers.InterfaceController - 导入接口异常:nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.NumberFormatException: For input string: "2019-01-01 10:10:10"
### Cause: java.lang.NumberFormatException: For input string: "2019-01-01 10:10:10"
数据库字段类型和javabean字段类型均为字符串,到底是哪里进行了强制转换呢?
导致错误的代码及解决
<if test="null != paramDefault and 0 != paramDefault">
0 != paramDefault 造成了字符串到数字类型的强转,
修改为<if test="null != paramDefault and paramDefault.equals(0)">
问题解决