Mybatisd对MySQL批量插入、批量更新及批量删除语句

1、批量插入

`<insert

    id="insertBatch" 

    parameterType="java.util.List">

    insert into 

        t_student(name, age, class)

    values

    <foreach 

        collection="list" 

        item="item" 

        index="index" 

        separator=",">

        (

            #{item.name,jdbcType=VARCHAR}, 

            #{item.age,jdbcType=INTEGER},

            #{item.class,jdbcType=LONGVARCHAR}

        )

    </foreach>

`

2、批量更新

评论

暂无评论