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 &gt;= #{startTime,jdbcType=TIMESTAMP}
</if>
<if test="endTime != null">
AND end_time &lt;= #{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.的更多相关文章

  1. 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 ...

  2. org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available parameters are [arg1, arg0, param1, param2]

    这个异常说明参数没有加上@Param注解,加上这个注解就行了. 默认情况下mybatis把参数按顺序转化为[0, 1, param1, param2],也就是说#{0} 和 #{param1} 是一样 ...

  3. 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 ...

  4. ### 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 ...

  5. 怪事年年有,今天特别多!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 ...

  6. 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 ...

  7. 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 ...

  8. 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": ...

  9. org.apache.ibatis.binding.BindingException: Parameter 'idList' not found解决办法

    https://blog.csdn.net/qq_28379809/article/details/83342196 问题描述 使用Mybatis查询数据库报错: org.apache.ibatis. ...

随机推荐

  1. ZROI-Day2比赛解题报告

    ZROIDay2-比赛解题报告 版权原因不提供题面信息 序 这几天作息有点鬼畜,虽然昨晚很晚睡但是早上精神还不错,看到题发现T1很友好?T2woc这暴力都好难打?T3多项式?!这样下去比赛会不会出现更 ...

  2. shiro学习(三,shiro加密)

    shiro加密 使用MD5加密  认证 //自定义的Realm 域 public class CustomRealmSecret extends AuthorizingRealm { @Overrid ...

  3. 【死磕 Java 集合】— ConcurrentSkipListMap源码分析

    转自:http://cmsblogs.com/?p=4773 [隐藏目录] 前情提要 简介 存储结构 源码分析 主要内部类 构造方法 添加元素 添加元素举例 删除元素 删除元素举例 查找元素 查找元素 ...

  4. 快速导入Excel数据到mysql

    首先利用mysql文件,导出csv文件, 然后,直接修改csv文件,然后导入csv文件  

  5. 一、传统MVC token验证方式

    一.传统MVC验证Token 推荐(https://www.cnblogs.com/xiaobai123/p/9242828.html) 自定义处理Jwt方式 1.新建JWT类 代码如下: using ...

  6. 2019.5.13-5.17知识点:文件管理、目录操作、索引节点、软硬链接,vim文本编辑 知识点

    文件管理 ● cp 复制文件 cp /路径(原文件) /路径(复制文件)/文件重命名(可选)    -i:覆盖前询问    -r:递归复制目录及内部内容   -a:归档,相当于-dr --preser ...

  7. Python Module模块

    模块 https://docs.python.org/zh-cn/3/tutorial/modules.html 模块的概念被高级语言广泛使用. Python的定义 一个包括Python定义和语句的文 ...

  8. TCP_Wrappers访问控制

    一.TCP_Wrappers简介 对有状态连接的特定服务进行安全检测并实现访问控制,它以库文件形式实现,某进程是否接受libwrap的控制取决于发起此进程的程序在编译时是否针对libwrap进行编译的 ...

  9. sysbench运行autogen.sh报错

    ./autogen.sh: 4: autoreconf: not found是在不同版本的 tslib 下执行 autogen.sh 产生.它们产生的原因一样,是因为没有安装automake 工具, ...

  10. win10日历交互效果

    win10日历 早就想试着实现以下win10日历的动态css效果,现在终于有时间试试啦.本篇文章只是实现简单的效果,进阶篇后续会放上来 目标效果 鼠标移入目标元素,周围相关八块元素点亮,点亮高光范围呈 ...