java.lang.NumberFormatException: For input string: “110000-DVR-091594“

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>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值