1.对应的xml文件:

<!--批量添加-->
<insert id="insertStandardItemInfo" parameterType="hashmap">
insert into t_standard_item(standard_id,item_id)
values
<foreach collection="itemIdList" index="index" item="item" separator="," >
(#{standardId,jdbcType=INTEGER}, #{item,jdbcType=INTEGER})
</foreach>
</insert> 2.对应的mapper文件:
int insertStandardItemInfo(Map<String,Object> map);

3.对应的service文件:
Map<String, Object> map = new HashMap<>();
map.put("standardId", standardId);
map.put("itemIdList", itemIdList);
standardItemMapper.insertStandardItemInfo(map);
 
 

Mybatis批量添加对象List的更多相关文章

  1. Mybatis 批量添加,批量更新

    此篇适合有一定的mybatis使用经验的人阅读. 一.批量更新 为了提升操作数据的效率,第一想到的是做批量操作,直接上批量更新代码: <update id="updateBatchMe ...

  2. Mybatis批量添加、更新小结

    虽然是很基础的东西,不过难免会忘记,所以写个笔记巩固一下,顺便分享. 实体类: @Data public class EventOrder { ​ private Long id; ​ private ...

  3. mybatis批量添加、批量删除

    <!-- 批量添加 --> <insert id="insertNameListSynHisBatch" parameterType="java.uti ...

  4. myBatis批量添加实例

    <!-- 批量添加中转地数据 -->      <insert id="addBatch" parameterType="com.isoftstone. ...

  5. mybatis 批量添加数据的两种实现方式

    做开发的这几年期间经常遇到类似处理这种形式数据的问题,也遇到很多刚刚入行的新同学,发现他们做处理这块,经验不够,今天特地整理了一下,大家都会遇到的几种情况,代码也都粘贴出来了,拿去不谢,有时间大家还是 ...

  6. MyBatis批量添加和删除

    一.批量插入 二.批量删除

  7. Mybatis -- 批量添加 -- insertBatch

    啦啦啦 ---------------InsertBatch Class : Dao /** * 批量插入perfEnvirons * * @author Liang * * 2017年4月25日 * ...

  8. myBatis批量添加,修改和删除

    摘自: http://blog.csdn.net/myjlvzlp/article/details/8434376 1.批量添加元素session.insert(String string,Objec ...

  9. MyBatis批量添加、修改和删除

    1.批量添加元素session.insert(String string,Object o) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...

随机推荐

  1. EF架构~有时使用SQL更方便

    回到目录 在进行统计时,尤其是按月进行统计,由于我们采用的时间是一个2015-12-12日这种,所以在linq你无法进行拆分,你拆分了在发到SQL时也会报错,因为SQL那边更新不需要你.net的方法, ...

  2. 第二天 Linux常见命令

    复习: 判断题 1.fedora.redhat.Centos.suse.ubuntu.都是常见的linux 2./分区.swap分区./boot分区都是linux的必须分区 3./dev/sda5在l ...

  3. iOS ---Extension编程指南

    当iOS 8.0和OS X v10.10发布后,一个全新的概念出现在我们眼前,那就是应用扩展.顾名思义,应用扩展允许开发者扩展应用的自定义功能和内容,能够让用户在使用其他app时使用该项功能.你可以开 ...

  4. How Google TestsSoftware - Part Two

    In order for the "you buildit, you break it" motto to be real, there are roles beyond the ...

  5. Java 线程 — ThreadLocal

    ThreadLocal 先来看看ThreadLocal的注释: This class provides** thread-local variables**. These variables diff ...

  6. echart饼状图使用,打发时间。

    新公司,刚来几天,闲着没事,领导让我做些无关痛痒的活,优化报表统计!!!之前是用flash做的,现在要改成echart实现.好吧,之前没用过,抱着学习态度,研究了下.写点东西打发下时间,能帮到需要帮助 ...

  7. angularjs之插件ngRoute和ngAnimate

    使用ngRoute和ngAnimate配合使用,可以实现页面切换的效果. 如果有使用过swiper,就知道这个效果是怎么样的. 代码: <!DOCTYPE html> <html l ...

  8. Enterprise Solution 2.3

    1. 登陆窗体和主界面增加语言选项,同时可记住用户登陆的语言和数据库. 2. 主界面的树功能可记住上次打开的模块菜单. 3. 修复主界面菜单生成问题和导航图区上下文菜单生成问题. 4. 增加自动更新功 ...

  9. 了解HTML表单之input元素的30个元素属性

    目录 传统属性 name type accept alt checked disabled readonly maxlength size src value 新增属性 autocomplete au ...

  10. [java] 汇率换算器实现(2)

    [java] 汇率换算器实现(2) // */ // ]]> // */ // ]]>   [java] 汇率换算器实现(2) Table of Contents 1 系列文章地址 2 前 ...