mybatis中写sql语句的注意事项--批量新增数据

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Gr_lbxx/article/details/81044744

<select id="" parameter="list">

insert into 表名

       <foreach collection="list" item="item" index="index"  open="("  close=")"  separator="union all">

            select #{item.字段1},

                       #{item.字段2}

                      from dual

    </foreach>

</select>

猜你喜欢

转载自blog.csdn.net/Gr_lbxx/article/details/81044744
今日推荐