mybatis的mapper不允许重载,因为它需要通过方法名称[不加签名]去查找需要执行的sql

1.批量删除

  <delete id="deletePlanLocations" parameterType="list" >
delete from plan_location where uuid in
(<foreach collection="list" item="item" separator="," index="index">
#{item, jdbcType=VARCHAR}
</foreach>)
</delete>

2.批量插入

<insert id="insertPlanLocations" parameterType="list" >
insert into plan_location (uuid, location_name, group_id, x,
y, tenant_id,
create_time, create_user_id, update_user_id
) values
<foreach collection="list" item="item" separator="," index="index" >
(#{item.uuid, jdbcType=VARCHAR}, #{item.locationName,jdbcType=VARCHAR},#{item.groupId,jdbcType=INTEGER},
#{item.x,jdbcType=DOUBLE},#{item.y,jdbcType=DOUBLE},
#{item.tenantId,jdbcType=INTEGER},#{item.createTime,jdbcType=TIMESTAMP},
#{item.createUserId,jdbcType=INTEGER},#{item.createUserId,jdbcType=INTEGER})
</foreach>
</insert>

mybatis例子的更多相关文章

  1. IDEA maven项目下测试mybatis例子,使用mappper class或package引入mapper映射文件,总是报错Invalid bound statement(所有配置完全正确)

    困扰几个小时,终于查到解决办法及原因(可以直接到最后看解决方案) 环境就是用IDEA搭建的maven项目,主要jar包引入配置如下 <dependencies> <dependenc ...

  2. SpringBoot整合MyBatis例子

    1.pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="h ...

  3. SpringMvc+Spring3+MyBatis整合

    1.MyBatis 例子 首先,单独使用MyBatis时: import java.io.IOException; import java.io.Reader; import org.apache.i ...

  4. SpringBoot+Mybatis集成搭建

    本博客介绍一下SpringBoot集成Mybatis,数据库连接池使用alibaba的druid,使用SpringBoot微框架虽然集成Mybatis之后可以不使用xml的方式来写sql,但是用惯了x ...

  5. Spring集成MyBatis的使用-使用Mapper映射器

    Spring集成MyBatis使用 前面复习MyBatis时,发现在测试时,需要手动创建sqlSessionFactory,Spring将帮忙自动创建sqlSessionFactory,并且将自动扫描 ...

  6. SpringBoot整合Thymeleaf

    一个整合Thymeleaf与Mybatis的CRUD例子 整合Mybatis例子 一.添加maven依赖 <dependency> <groupId>org.springfra ...

  7. MyBatis Generator作为maven插件自动生成增删改查代码及配置文件例子

    什么是MyBatis Generator MyBatis Generator (MBG) 是一个Mybatis的代码生成器,可以自动生成一些简单的CRUD(插入,查询,更新,删除)操作代码,model ...

  8. 调用mybatis generator已经生成好的dao来查询例子

    package com.cib.xj.controller; import java.util.List; import javax.annotation.Resource; import org.s ...

  9. MyBatis Mapper 文件例子

    转载:http://blog.csdn.net/ppby2002/article/details/20611737 <?xml version="1.0" encoding= ...

随机推荐

  1. 编译源码 JAVA out of memory

  2. 生产环境的gitlab大版本升级思路(从7.x升级到8.x)

    之前在生产环境部署的gitlab是7.x版本的,提供给公司内部的员工来使用,大概有350个用户左右,gitlab从8.x版本之后内置了CI和CD的集成,所以就考虑到升级版本的问题 通过参考和总结git ...

  3. 【CQgame】[幸运方块 v1.1.3] [Lucky_Block v1.1.3]

    搬家首发!!! 其实从初一我就写过一些小型战斗的游戏,但是画面都太粗糙,代码也比较乱,也就是和两三个同学瞎玩,但自从观摩了PoPoQQQ大神的游戏,顿时产生了重新写一部游戏的冲动,于是各种上网查找各种 ...

  4. Unity3D笔记 Collect

    一.输入轴 默认输入轴: Horizontal 和 Vertical被映射到w, a, s, d键和方向键 Fire1, Fire2, Fire3被分别映射到Ctrl,Option(Alt)和Comm ...

  5. freemarker了解

    今天主要了解了项目流程,了解了这周要做退款详情迁移,了解了freemarker

  6. Elasticsearch 不同的搜索类型之间的区别

    1.match   轻量级搜索 GET /wymlib/_search { "query": { "match": {  "title": ...

  7. 基于pandas python的美团某商家的评论销售数据分析(可视化)

    基于pandas python的美团某商家的评论销售数据分析 第一篇 数据初步的统计 本文是该可视化系列的第二篇 第三篇 数据中的评论数据用于自然语言处理 导入相关库 from pyecharts i ...

  8. 2.2RNN

    RNN RNN无法回忆起长久的记忆 LSTM (long short Term memory长短期记忆)解决梯度消失或弥散vanishing 和梯度爆炸explosion  0.9*n-->0 ...

  9. Linux:32/64位程序(应用程序、共享库、内核模块)

    摘要: Linux系统区分32/64位,相应地,应用程序.共享库和内核模块也区分32/64位. 本文以Ubuntu系统为例,介绍如何编译和使用32/64位的应用程序.共享库和内核模块. 1. 应用程序 ...

  10. android call and audio

    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system ConnCtl *:s android audio (http://blog.cs ...