<select id="insert^Batch" parameterType="java.util.List"> in^sert into xxx(id,ordersId,dishId) values <foreach collection="list" item="item" index="index" separator=","> (#{item.id,jdbcType=VARCHAR},#{item.orderId,jdbcType=BIGINT},#{item.dishId,jdbcType=INTEGER}) </foreach> </select>
Mapper接口里这么写: int in^sertBatch(List<XXX> xxxList);
破空间有关键字过滤,所以多加了尖号。
|