Mysql中在mybatis中批量插入数据

<insert id="insertByBatch" parameterType="java.util.List">
            insert into attachment_table (name, logID,url)
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.name,jdbcType=VARCHAR}, #{item.logid,jdbcType=INTEGER},#{item.url,jdbcType=LONGVARCHAR})
        foreach>
 insert>

你可能感兴趣的:(java,MySql)