java.lang.NumberFormatException: For input string: “110000-DVR-091594”
### Error updating database. Cause: java.lang.NumberFormatException: For input string: "110000-DVR-091594"
### The error may exist in file [D:\Java\bscc-mysql\target\classes\mapper\newModalMapper\ZoneeProcComplexReplaceMapper.xml]
### The error may involve com.typrotech.app.bscc.dao.ZoneeProcComplexReplaceMapper.updateTerminalInfo
### The error occurred while executing an update
### Cause: java.lang.NumberFormatException: For input string: "110000-DVR-091594"
这个问题的主要原因是mybatis中的一个字段用到了 if标签,其中TI_DeviceCode_Char!=0会报错,因为TI_DeviceCode_Char是字符串类型,如果判断!0 mybatis会把TI_DeviceCode_Char转换成int所以会报错,所以直接改为TI_DeviceCode_Char!=''即可
错误的地方
<if test="params.TI_DeviceCode_Char !=null and params.TI_DeviceCode_Char!=0">TI_DeviceCode_Char=#{params.TI_DeviceCode_Char},</if>
改正后
<if test="params.TI_DeviceCode_Char !=null and params.TI_DeviceCode_Char!=''">TI_DeviceCode_Char=#{params.TI_DeviceCode_Char},</if>