问题描述
栏位索引超过许可范围:1,栏位数:0。
aused by: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.postgresql.util.PSQLException:
原因分析:发现是 '#{}' 自己多加了一个单引号,
update tb_sku set enable = 0 where spu_id ='#{spuId}' and id not in
<foreach collection="skuIds" open="(" close=")" separator="," item="skuId">
#{skuId}
</foreach>
解决方案:把''去掉
update tb_sku set enable = 0 where spu_id =#{spuId} and id not in
<foreach collection="skuIds" open="(" close=")" separator="," item="skuId">
#{skuId}
</foreach>
本文介绍了在使用MyBatis时遇到的错误:栏位索引超过许可范围,导致更新语句执行失败。错误源于在#{spuId}
9876

被折叠的 条评论
为什么被折叠?



