mybatis三种批量插入方式对比
<insert id="addInquiryQA" parameterType="java.util.List"> insert into inquiry_resul_question (result_bill_id, question_id, answer_id, fill_in_answer) VALUES <foreach collection="list" item="item" separator=","> (#{item.resultBillId,jdbcType=INTEGER}, #{item.questionId,jdbcType=INTEGER}, #{item.answerId,jdbcType=INTEGER}, #{item.fillInAnswer,jdbcType=VARCHAR}) </foreach> </insert>
传入的是对象集合