mybatis格式化异常:NumberFormatException,For input string:"x"

https://segmentfault.com/a/1190000006577082

 

问题定位:该问题通常出现在动态sql中,使用String与char类型做比较。如:

<if test="segment != null and segment != '' and segment == '1'">

解决方案:

--方案一
<if test="segment != null and segment != '' and segment == '1'.toString()">

--方案二
<if test='segment != null and segment != '' and segment == "1">

--方案三
<if test="segment != null and segment != '' and segment == &quot;1&quot;">

 

posted @ 2021-03-29 11:47  机械公敌  阅读(584)  评论(0编辑  收藏  举报