org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found.
1. 情景重现
1.1 Mapper 代码
public interface DeviceFileInfoVOMapper { List<QueryFileDTO> selectVideoByField(String devId, Long chl, Date startTime, Date endTime, Pagination pagination); }
1.2 XML 代码
<select id="selectVideoByField" resultMap="videoFileMap">
SELECT file_id
FROM t_device_file_info WHERE 1=1
<trim>
<if test="devId != null">
AND dev_id=#{devId,jdbcType=VARCHAR}
</if>
<if test="chl != null">
AND chl=#{chl,jdbcType=BIGINT}
</if>
<if test="startTime != null">
AND start_time >= #{startTime,jdbcType=TIMESTAMP}
</if>
<if test="endTime != null">
AND end_time <= #{endTime,jdbcType=TIMESTAMP}
</if>
</trim>
</select>
1.3 错误详情
2. 解决方法
在 Mapper 中定义的方法参数添加 @Param 注解,@Param 注解的值和xml中引用的参数名一致即可。
@Param("devId"),则在xml中使用 #{devId}
public interface DeviceFileInfoVOMapper { List<QueryFileDTO> selectVideoByField(@Param("devId") String devId, @Param("chl") Long chl, @Param("startTime") Date startTime, @Param("endTime") Date endTime, Pagination pagination); }
org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found.的更多相关文章
- SpringBoot整合Mybatis注解版---update出现org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are [arg1, arg0, param1, param2]
SpringBoot整合Mybatis注解版---update时出现的问题 问题描述: 1.sql建表语句 DROP TABLE IF EXISTS `department`; CREATE TABL ...
- org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available parameters are [arg1, arg0, param1, param2]
这个异常说明参数没有加上@Param注解,加上这个注解就行了. 默认情况下mybatis把参数按顺序转化为[0, 1, param1, param2],也就是说#{0} 和 #{param1} 是一样 ...
- 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 ...
- ### 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 ...
- 怪事年年有,今天特别多!org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'empno' not found. Available parameters are [emp, deptno, param1, param
错误: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Binding ...
- MyBatis 传List参数 nested exception is org.apache.ibatis.binding.BindingException: Parameter 'idList' not found.
在MyBatis传入List参数时,MyBatis报错:nested exception is org.apache.ibatis.binding.BindingException: Paramete ...
- org.apache.ibatis.binding.BindingException: Parameter 'start' not found. Available parameters are [1, 0, param1, param2]
DEBUG 2018-05-30 08:43:26,091 org.springframework.jdbc.datasource.DataSourceTransactionManager: Roll ...
- Springboot-001-解决nested exception is org.apache.ibatis.binding.BindingException: Parameter 'env' not found. Available parameters are [arg1, arg0, param1, param2]
环境:Springboot + Mybatis + MySQL + VUE 场景: 前端发出数据比对请求,在服务后台与数据库交互时,接口提示错误信息如下所示: { "code": ...
- org.apache.ibatis.binding.BindingException: Parameter 'idList' not found解决办法
https://blog.csdn.net/qq_28379809/article/details/83342196 问题描述 使用Mybatis查询数据库报错: org.apache.ibatis. ...
随机推荐
- luogu P4688 [Ynoi2016]掉进兔子洞
luogu 我们要求的答案应该是三个区间长度\(-3*\)在三个区间中都出现过的数个数 先考虑数列中没有相同的数怎么做,那就是对三个区间求交,然后交集大小就是要求的那个个数.现在有相同的数,考虑给区间 ...
- eclipse设置字体
- 读书笔记《Oracle从入门到精通》
目录 一.SQL基础 1.SQL种类 2.常用数据类型 3.DDL 4.约束 5.DML语句 二.SELECT语句 1.结果集'*'与指定列 2.拼接符 || 3.substr函数 4.instr函数 ...
- Boost::pool (1)
POOL 什么是pool 池分配是一种非常快速的内存分配方案,但其使用受到限制.有关池分配的更多信息(也称为简单隔离存储,请参阅 池化概念和简单隔离存储). 我为什么要使用Pool? 使用池可以更好地 ...
- ListView 一维排布 动态滑动添加新item代码
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentV ...
- ad 拼板
随着整个电子产业的不断发展,电子行业的很多产品都已经有完善的上下游配套企业.从一个成熟产品的方案设计,外观设计,加工制造,装配测试,包装,批发商渠道等等,这样的一条产业链在特定的环境就这样自然地生成. ...
- XML刚学会,怎么又出来个YAML!
XML(eXtensible Markup Language)可扩展标记语言,曾经是IT软件开发界,标记数据.定义数据的大哥大. 很多从事Spring的同学,没少花时间在写XML文件上吧? 不过随着时 ...
- Selenium(2)
testing123456peter123456rose123456 一.常见的运行错误: 1.[error] Timed out after 30000ms Timed out:超时 after:之 ...
- golang 系列学习(-) 数据类型
数据类型的出现 在的编程语言中,数据类型用于声明函数和变量,数据类型的出现是为了要把数据分成数据所需要内存大小的不同数据,编程时需要什么样的内存就申请什么样的内存.就可以充分的利用内存,更好的霸控程序 ...
- OpenGL相关文章
OpenGL之glMatrixMode函数的用法 gluOrtho2D和glViewport的作用&窗口与显示的关系 glViewport函数用法 纹理映射