1. mybatis批量插入数据
生活随笔
收集整理的這篇文章主要介紹了
1. mybatis批量插入数据
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?通過list
<insert id="saveByList" useGeneratedKeys="true" parameterType="java.util.List"> insert into T_App_Default_User(UserID,AppType,CreateTime)values <foreach collection="list" item="item" index="index" separator="," > (#{item.userId},#{item.appType},now()) </foreach> </insert>對應的Mapper文件
public interface AppDefaultUserMapper {void saveByList(List<Map<String, Long>> list); }搞定~~~
轉載于:https://www.cnblogs.com/liaokailin/p/4485862.html
總結
以上是生活随笔為你收集整理的1. mybatis批量插入数据的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: js进阶 11-16 jquery如何查
- 下一篇: pop to 特定的UIViewCont