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. HTML之美化盒子

    1.    美化盒子 1.1.          美化文本 1.1.1.  字体大小[font-size]: 字符框的高度,可继承,默认值medium,16px.基准字号:浏览器设置的默认字体大小,通 ...

  2. Redis总结2

    一.Redis效率高的原因 众所周知,Redis常用来做缓存,从而提高项目QPS(每秒查询率).QPS = 并发量 / 平均响应时间 然而其效率高的原因包含但不仅限于如下几点: 1.Redis基于内存 ...

  3. 【大数据】初识Hadoop

    因为项目日志体量较大,每天有4-7T的日志量,传统的sqlserver已经不能满足,所以现在需要使用到大数据的相关工具进行记录和使用. 虽然公共项目提供了组件和解决方案,但是对于一些名词.概念还是有必 ...

  4. (十)全志R18 Tina平台关闭所有串口打印的方法

    全志R18 Tina平台关闭所有打印输出方法: 有些国外的产品安全认证,如亚马逊Alexa认证,认证机构会不停地点pcb上的点,看有没有东西输出,有的话就通过这些口想办法破解设备,所以安全认证会要求设 ...

  5. 前端入门Js笔记

    T 001 ____________--信息页面展示 需求分析: 有一个页面,在页面上有很多文字信息,且格式不一. 技术分析: html: 文字标签: 字体标签: 标题标签: 其他标签: 排版标签: ...

  6. 小程序UI设计(10)-巧用模板,事半功倍

    工具中为小程序员们准备了符合微信开发规范的模板.之前帖子中介绍的规范都在模板中已经设计好了,可以直接复制粘贴使用.下图中的样式是从模板直接复制过来的.实际使用时只要更换为自己的图片和文字即可.自动生成 ...

  7. PHP代码执行流程

    怎么样?有点了解了么.说实话,单看这个,我本人是有点懵的,不过,不要怕.咱们来慢慢地看下. 首先,在网上找的信息说PHP代码执行的顺序是这样的,第一步是词法分析,第二步是语法分析,第三步是转化为opc ...

  8. 【OI学习注意事项】

    1. 必备知识 普及组必学 1.模拟算法(暴力枚举),按照题目的要求,题目怎么说就怎么做,保证时间和正确性即可. 2.搜索与回溯,主要的是\(DFS\)(深度优先搜索)和\(BFS\)(宽度优先搜索) ...

  9. 多线程(四)wait()、notify()以及notifyAll()

    六.线程的等待和唤醒 1.wait()和notify()的简单示范 public class Wait extends Thread{ public synchronized void run() { ...

  10. 下载Mybatis源码

    百度搜索关键字:Mybatis 点击第二个选项,为啥不是第一个?因为卡. 打开之后,长这个样子: 点击画红圈的位置,进入github源码库: 发现,进入的太深了.点击mybatis-3,进到外层目录, ...