广告
返回顶部
首页 > 资讯 > 数据库 >BindingException: Parameter ‘ids‘ not found. Available parameters are [collection, list]
  • 548
分享到

BindingException: Parameter ‘ids‘ not found. Available parameters are [collection, list]

sql数据库mysqlspring 2023-09-15 18:09:26 548人浏览 薄情痞子
摘要

记录没见过的Bug之BindingException 今天在写一个删除套餐功能时遇到个bug如下图所示: 我们都知道当一个请求参数有多个值接收时可以采用如下方式:                1. 使用数组接收   Long[]

记录没见过的Bug之BindingException

今天在写一个删除套餐功能时遇到个bug如下图所示:

我们都知道当一个请求参数有多个值接收时可以采用如下方式:
               1. 使用数组接收   Long[] ids
               2. 使用集合接收  List ids  注意: 如果使用集合需要添加@RequestParam

这里我采用的是以集合方式来接收。

在Mapper接口中的方法如下

     //动态sql    long findCountByIds(List ids);    //根据ids批量删除的套餐    void deleteByIds(List ids);

xml的sql语句如下:

                            #{id}