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. java实现spark常用算子之mapPartitionsWithIndex

    import org.apache.spark.SparkConf;import org.apache.spark.api.java.JavaRDD;import org.apache.spark.a ...

  2. promise使用的正确方式

    一开始恨不能理解下面的代码,为什么可以一直then下去,什么时候要直接return  xxx,什么时候return 一个promise,什么时候用Promise.resolve() function ...

  3. vue中优化CheckBox初始状态被选中问题

    <template> <div class="hello"> <h2>我是主界面</h2> <!-- <h2>我是 ...

  4. 分布式之协调服务Zookeeper专题第一讲

    写在前面: 再谈架构演进: 1.单体架构->tomcat(war) 演进:水平拆分(服务拆分,(用户服务,订单服务,商品服务)) 涉及问题:1).服务通信(webservice) 2).三态问题 ...

  5. linux 命令技巧(转)--history

    本文介绍一些关于bash的能够提高效率的技巧,主要是关于历史命令操作和一些快捷键,让你在命令行下工作效率翻倍. 1.history-----最基本的查看历史命令 2.!n-----编号为n的历史命令 ...

  6. C++第五次作业--运算符重载和函数重载

    C++ 运算符重载和函数重载 C++ 允许在同一作用域中的某个函数和运算符指定多个定义,分别称为函数重载和运算符重载. 重载声明是指一个与之前已经在该作用域内声明过的函数或方法具有相同名称的声明,但是 ...

  7. C++第二次作业--函数

    1.为什么要用函数 创建 C++ 函数时,会定义函数做什么,然后通过调用函数来完成已定义的任务.通过函数我们可以实现代码复用,即可以重复使用和在各种适用情况下使用,函数的存在增强了程序的可读性.并且函 ...

  8. Codeforces 1082 毛毛虫图构造&最大权闭合子图

    A #include<bits/stdc++.h> using namespace std; typedef long long ll; , MAXM = ; //int to[MAXM ...

  9. PHP程序员要掌握的技能

    1. Composer 第一点就要提 Composer ,自从 Composer 出现后,PHP 的依赖管理可以变得非常简单.程序内依赖一些类库和框架,直接使用 Composer 引入即可,通过使用 ...

  10. MySQL 8下忘密码后重置密码

    解决方案:1):设置mysql为无密码启动  (修改MySQL的登录设置:vi /etc/my.cnf   在[mysqld]的段中加上一句:skip-grant-table)  2):重新启动mys ...