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. 2018 青岛ICPC区域赛E ZOJ 4062 Plants vs. Zombie(二分答案)

    Plants vs. Zombies Time Limit: 2 Seconds      Memory Limit: 65536 KB BaoBao and DreamGrid are playin ...

  2. Unity3D Shader描边效果

    Shader "Custom/RimColor" { Properties { _MainTex ("Base (RGB)", 2D) = "whit ...

  3. 【咸鱼教程】BitmapLabel位图字体使用

    引擎版本3.2.6 教程目录一 为什么要使用位图字体二 如何使用位图字体2.1 TextureMerger制作位图字体2.2 exml中使用位图字体三 Demo源码 一  为什么要使用位图字体egre ...

  4. JavaScript—倒计时

    当前时间-倒计时下载 效果: 代码: <!doctype html> <html> <head> <meta http-equiv="Content ...

  5. Css 中的 block,inline和inline-block概念和区别

    1.block和inline这两个概念是简略的说法,完整确切的说应该是 block-level elements (块级元素) 和 inline elements (内联元素).block元素通常被现 ...

  6. (sklearn)机器学习模型的保存与加载

    需求: 一直写的代码都是从加载数据,模型训练,模型预测,模型评估走出来的,但是实际业务线上咱们肯定不能每次都来训练模型,而是应该将训练好的模型保存下来 ,如果有新数据直接套用模型就行了吧?现在问题就是 ...

  7. Django模板变量的使用

    在views.py中进行逻辑控制,编写向跳转页面传递内容的代码.可以看出,对类.字典.列表中的数据均可操作.views.py的内容如下: from django.shortcuts import re ...

  8. php安装redis扩展'checking for igbinary includes... configure: error: Cannot find igbinary.h'解决方法

    今天准备给yii2安装redis扩展,先安装了redis服务,然后安装redis php官方扩展,在make的时候提示' checking for igbinary includes... confi ...

  9. Linux 虚拟串口及 Qt 串口通信实例

    Linux 虚拟串口及 Qt 串口通信实例 2011-06-22 17:49 佚名 互联网 字号:T | T Linux 虚拟串口及 Qt 串口通信实例是本文所要介绍的内容,在实现过程中,打开了两个伪 ...

  10. function &w(){}

    CodeIgniter 3.1.0 <?php //\system\core\Common.php function &load_class($class, $directory = ' ...