项目上遇到了
mybatis 异常: JDBC requires that the JdbcType must be specified for all nullable parameters.
1.此种情况 由于 mybatis 映射文件中,sql 参数值为 null , 由于 还有另一种 关于 参数为 null 的出现 oracle 无效列类型错误 1111 的异常,那种情况 发现 写的参数 是对的,但实际值为null, 而这种情况 由于参数写错了... ; 猜测 可能是 参数名写错导致的这种问题
2.将参数置为null的变为"".
3.如果是foreach报错
<if test="resids != null"> and r.id in <foreach item="item" index="index" collection="resids" open="(" separator="," close=")"> #{item} </foreach> </if>
改为
<if test="businessids != null"> and b.id in <foreach item="businessid" index="index" collection="businessids" open="(" separator="," close=")"> '${businessid}' </foreach>
</if>
这种形式