1、问题
在使用过程中,后台传入的值是int型
Integer version = Integer.parseInt(MapUtils.getString(evalMap, “version_id”));
paraMap.put(“version_id”,version+1);
<update id="publish">
update test_evaluation.`stdtrain_eval_setting`
set `is_use` =#{is_use}
,update_date=#{update_date}
,update_by=#{update_by}
<if test="version_id != null and version_id != ''">
,version_id=#{version_id}
</if>
where id = #{id}
</update>
如果直接使用null或者“”判断,出现错误
For input string : “null”
2、解决
所以要加上,jdbcType=INTEGER
<update id="publish">
update test_evaluation.`stdtrain_eval_setting`
set `is_use` =#{is_use}
,update_date=#{update_date}
,update_by=#{update_by}
<if test="version_id != null and version_id != ''">
,version_id=#{version_id ,jdbcType=INTEGER}
</if>
where id = #{id}
</update>
```