传的参数是一个数组, Long[] ids

后台错误写法

   <delete id="deleteById">
delete from table
where id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>

正确写法

   <delete id="deleteById">
delete from table
where id in
<foreach collection="array" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>

当mybatis传入参数为list集合的时候;mybatis会自动把其封装为一个map;会以“list”作为key;每个元素的值作为value;格式为 Map<"list",value>

当mybatis传入参数为数组的时候mybatis会自动把其封装为一个map;会以“array”作为key;每个元素的值作为value;格式为Map<"array",value>

Parameter 'ids' not found. Available parameters are [array]的更多相关文章

  1. spring 整合Mybatis 错误:Parameter 'items_id' not found. Available parameters are [array]

    运行环境:jdk1.7.0_17+tomcat 7 + spring:3.2.0 +mybatis:3.2.7+ eclipse 错误:Parameter 'items_id' not found. ...

  2. mybatis 批量更新 Parameter '__frch_item_0' not found. Available parameters are [list]

    一次在做批量更新数据的时候报错 Parameter '__frch_item_0' not found. Available parameters are [list] 记过反复查找,最后才发现是一个 ...

  3. MyBatis批量操作报错:Parameter 'xxxList' not found. Available parameters are [list]

    问题背景: 在Dao中使用MyBatis进行查询操作,参数是传的一个List:studentNameList,但是在执行查询的时候报错,具体日志如下: com.chenzhou.base.mybati ...

  4. mybatis 批量增加 Parameter '__frch_item_0' not found. Available parameters are [list]

    当在mybatis用到foreach的时候,会报这个错误Parameter '__frch_item_0' not found. Available parameters are [list]会出现的 ...

  5. Parameter 'list1' not found. Available parameters are [list] 解析

    在使用foreach语句时会经常报Parameter ‘ordersList’ not found. Available parameters are [list] 解析这个错误,造成这个错误的主要原 ...

  6. 初学Java9:学习Mybatis时报错:Parameter 'name' not found. Available parameters are [1, 0, param1, param2]

    报错-->Parameter 'name' not found. Available parameters are [1, 0, param1, param2] 百度找到这篇文章完成修改 htt ...

  7. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [1, 0, param1, param2]

    Spring+mybatis错误:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.bi ...

  8. Mybatis报错:Parameter 'list' not found. Available parameters are [groupList, param1]

    GroupDao.java 里面定义的方法: void batchInsertLog(@Param("groupList") List<MktPromotionIntegra ...

  9. ### Cause: org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2]

    org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.apache.ib ...

随机推荐

  1. oppo设备怎么样无需root激活XPOSED框架的教程

    在非常多部门的引流或业务操作中,基本上都需要使用安卓的强大XPOSED框架,近期,我们部门购来了一批新的oppo设备,基本上都都是基于7.0以上版本,基本上都不能够获得root的su超级权限,即使一部 ...

  2. Tomcat更新方法

    tomcat更新方法最简单的就是上官网下载最新版的压缩包,然后用新版本的 lib 文件替换掉旧版本的 lib 文件 具体方法(偷懒做个搬运工):https://jingyan.baidu.com/ar ...

  3. kali linux中的yum、rpm常见的问题

    事件起因:今天我在kali里面使用yum命令来部署Linux环境时,出现了错误: bash:yum command not found,然后就百度,找到一片好的文章,链接:http://www.pia ...

  4. Netty1:初识Netty

    为什么使用Netty Netty是业界最流行的NIO框架之一,它的健壮性.功能.性能.可定制性.可扩展性在同类框架中都是首屈一指的,它已经得到了成百上千的商用项目的证明.对于为什么使用Netty这个话 ...

  5. php批量修改文件名称

    <?php//利用PHP目录和文件函数遍历用户给出目录的所有的文件和文件夹,修改文件名称function fRename($dirname){ if(!is_dir($dirname)){ ec ...

  6. #Java学习之路——基础阶段二(第五篇)

    我的学习阶段是跟着CZBK黑马的双源课程,学习目标以及博客是为了审查自己的学习情况,毕竟看一遍,敲一遍,和自己归纳总结一遍有着很大的区别,在此期间我会参杂Java疯狂讲义(第四版)里面的内容. 前言: ...

  7. 5.Flask-Migrate

    1.1.项目结构重构 (1)config.py DB_URI = "mysql+pymysql://root:123456@127.0.0.1:3306/flask_migrate?char ...

  8. 【TCP协议】(1)---TCP协议详解

    TCP协议 本文内容如下:      1)TCP协议概念      2)TCP头部结构和字段介绍      3)TCP流量控制            滑动窗口      4)TCP拥塞控制      ...

  9. RabbitMQ在Windows环境下的安装与使用

    Windows下安装RabbitMQ 环境配置 部署环境 部署环境:windows server 2008 r2 enterprise 官方安装部署文档:http://www.rabbitmq.com ...

  10. PC打开多个微信

    打开记事本 在哪个盘就打开哪个盘 例如我的D盘 输入这一串 D:CD 微信路径start WeChat.exe&WeChat.exe 保存然后改后缀名为.bat 然后运行 运行前要关掉之前开的 ...