最近使用 mybatis 写项目的时候遇到报错:org.apache.ibatis.binding.BindingException: Parameter ‘brOrderNo’ not found. Available parameters are [dataList, param1]

从报错信息来看提示的也很明显,说找不到参数 brOrderNo,dataList 为请求传过来的参数体的命名的name。

旧代码如下:

    public String publicAtionSelective(@Param("dataList") PostCommonRequest po) {
        //拼接 sql 语句
        SQL sql = new SQL();
        //字段
        sql.SELECT("id");
        sql.FROM("`borrow_order`");
        //筛选条件
        sql.WHERE("cbo.`br_order_no` = #{brOrderNo,jdbcType=VARCHAR}");
        //最终SQL
        return sql.toString();
    }

解决方案只需要将 brOrderNo 绑定到对应的参数体即可,不然就提示找不到。

    public String publicAtionSelective(@Param("dataList") PostCommonRequest po) {
        //拼接 sql 语句
        SQL sql = new SQL();
        //字段
        sql.SELECT("id");
        sql.FROM("`borrow_order`");
        //筛选条件
        sql.WHERE("cbo.`br_order_no` = #{dataList.brOrderNo,jdbcType=VARCHAR}");
        //最终SQL
        return sql.toString();
    }

org.apache.ibatis.binding.BindingException: Parameter ‘brOrderNo’ not found. Available parameters ar的更多相关文章

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

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

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

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

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

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

  7. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not found. Available parameters are [arg1, arg0, param1, param2]

    2018-06-27 16:43:45.552  INFO 16932 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : ...

  8. 【Mybatis异常】 org.apache.ibatis.binding.BindingException: Parameter 'storeId' not found. Available parameters are [form, param1]

    一.异常信息 2019-05-31 16:06:25.272 [http-nio-10650-exec-3] WARN o.s.w.s.m.m.a.ExceptionHandlerExceptionR ...

  9. Spring Boot中报错org.apache.ibatis.binding.BindingException: Parameter 'XXXX' not found. Available parameters are [0, 1, param1, param2]的解决办法

    我这里的报错信息显示: org.apache.ibatis.binding.BindingException: Parameter 'reqUsername' not found. Available ...

随机推荐

  1. SQL Server 检测到基于一致性的逻辑 I/O 错误

    背景:新建DB_GZN 恢复数据库备份文件 执行:          select * from VI_MPS_PAPLT 错误提示: 消息 824,级别 24,状态 2,第 2 行 SQL Serv ...

  2. HDU 1176 免费馅饼【动态规划】

    解题思路:用a[i][j]表示在第i秒在地点j的掉落馅饼的数量,设整个馅饼掉落的时间持续为timemax,即为矩阵的高度,一共0到10个地点,为矩阵的长度,如图,即可构成数塔,因为考虑到在地点0的时候 ...

  3. Pyhton学习——Day26

    #多态:多态指的是一类事物有多种形态# import abc# class Animal(metaclass = abc.ABCMeta):# 同一类事物:动物# @abc.abstractclass ...

  4. (1)安装----anaconda3下配置pyspark【单机】

    1.确保已经安装jdk和anaconda3.[我安装的jdk为1.8,anaconda的python为3.6] 2.安装spark,到官网 http://spark.apache.org/downlo ...

  5. sklearn学习8-----GridSearchCV(自动调参)

    一.GridSearchCV介绍: 自动调参,适合小数据集.相当于写一堆循环,自己设定参数列表,一个一个试,找到最合适的参数.数据量大可以使用快速调优的方法-----坐标下降[贪心,拿当前对模型影响最 ...

  6. jQuery中的DatePicker今天按钮不起作用

    转载:http://codego.net/63433/ jquery-ui 日期选择器datepicker我想用 jQueryUI 的 DatePicker ,并显示“今天”按钮, 但它不工作,它也不 ...

  7. jquery 将函数作为参数传递

    等待执行函数 这是自己封装的layui的询问框 //------[询问框](parameter:执行函数的参数,f_name:执行函数,msg:提示,time:自动消失时间,btn_arr:按钮组,o ...

  8. MySQL创建表时加入的约束以及外键约束的的意义

    1,创建表时加入的约束 a) 非空约束,not null b) 唯一约束,unique c) 主键约束,primary key d) 外键约束,foreign key 1,非空约束,针对某个字段设置其 ...

  9. HDU 4309 Contest 1

    最大流建图.开始以为旧桥有1000座,没敢用枚举,后来看看题目发现了只是十二座.枚举桥的状态没问题. 对于隧道的容量W,可以虚拟出第三个结点表示,如u->v.增加一个点p,u->p(INF ...

  10. [ES2018] Two ways to write for-await-of

    // Asynchronous iteration --> Symbol.asyncIterator async function main() { const syncIterable = [ ...