在批量插入的时候报的这个错。
原因是:
<insert id="batchInsert" parameterType="com.test.Serial"
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into stock_serial (<include refid="all_sql_columns_fields"/>) values
<foreach item="item" collection="list" separator=",">
(#{item.id,jdbcType=BIGINT},#{item.yn,jdbcType=INTEGER},
#{item.version,jdbcType=INTEGER},#{orderGuid,jdbcType=VARCHAR})
</foreach>
</insert>
这是一个动态SQL,通过循环构造批量插入的语句。
orderGuid的取值应该是#{item.orderGuid, jdbcType=VARCHAR}
少了一个"item."。