一.话不多数,错误如下

  Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userName' not found. Available parameters are [arg1, arg0, param1, param2]

翻译如下:

请求处理失败;嵌套异常为org.mybatis.spring.mybatissSystemException:嵌套异常为org.apache.ibatis.binding.bindingException:未找到参数“username”。可用参数为[arg1、arg0、param1、param2]

二.解决如下

出现上述原因是因为在执行sql的时候无法匹配sql语句的通配符造成的,

第一种:在每个参数前加上@Param()注解

第二种:将通配符改为0,1 匹配(第二种仅供参考,这种方法我没有解决我的问题)

解决问题本人参考的这位大佬

https://blog.csdn.net/crazy_java1234/article/details/53022011

mybatis多个参数查询问题的更多相关文章

  1. 8.mybatis动态SQL模糊查询 (多参数查询,使用parameterType)

    多参数查询,使用parameterType.实例: 用户User[id, name, age] 1.mysql建表并插入数据 2.Java实体类 public class User { public ...

  2. 【转载】Mybatis多参数查询映射

    转载地址:http://www.07net01.com/zhishi/402787.html 最近在做一个Mybatis的项目,由于是接触不久,虽然看了一下资料,但在实际开发中还是暴 露了很多问题,其 ...

  3. mybatis参数查询

    单个参数查询            在mapper.xml配置文件中配置                   <select id= "selectByNu" paramet ...

  4. mybatis按datetime条件查询,参数为时间戳时

    mybatis按datetime条件查询,参数为时间戳时,如果数据库为2018-1-1 20:22:10, 你的时间戳也为2018-1-1 20:22:10,但却没找到数据.可能是时差导致的.百度修正 ...

  5. MyBatis的返回参数类型和查询结果遍历

    MyBatis的返回参数类型分两种 1. 对应的分类为: 1.1.resultMap: 1.2.resultType: 2 .对应返回值类型: 2.1.resultMap:结果集 2.2.result ...

  6. MyBatis学习总结_13_Mybatis查询之resultMap和resultType区别

    MyBatis的每一个查询映射的返回类型都是ResultMap,只是当我们提供的返回类型属性是resultType的时候,MyBatis对自动的给我们把对应的值赋给resultType所指定对象的属性 ...

  7. MyBatis学习总结_Mybatis查询之resultMap和resultType区别

    MyBatis的每一个查询映射的返回类型都是ResultMap,只是当我们提供的返回类型属性是resultType的时候,MyBatis对自动的给我们把对应的值赋给resultType所指定对象的属性 ...

  8. Mybatis使用MySQL模糊查询时输入中文检索不到结果怎么办--转自http://www.jb51.net/article/88236.htm

    这篇文章主要介绍了Mybatis使用MySQL模糊查询时输入中文检索不到结果的解决办法的相关资料,非常不错,具有参考借鉴价值,需要的朋友可以参考下   项目开发中,在做Mybatis动态查询时,遇到了 ...

  9. Eclipse创建一个mybatis工程实现连接数据库查询

    Eclipse上创建第一mybatis工程实现数据库查询 步骤: 1.创建一个java工程 2.创建lib文件夹,加入mybatis核心包.依赖包.数据驱动包.并为jar包添加路径 3.创建resou ...

随机推荐

  1. 利用ajax全局设置实现拦截器

    var token = localStorage.getItem("token"); $.ajaxSetup({ dataType: "json", cache ...

  2. OS X中微信双开

    1.打开系统终端: 2.下载插件,输入命令(不包括括号) git clone https://github.com/Sunnyyoung/WeChatTweak-macOS.git 并回车: 3.进入 ...

  3. Grid Convergence Index-- Post Processing in CFD

    t Grid Convergence Index Table of Contents 1. Grid/mesh independence   GCI 1.1. Richardson extrapola ...

  4. [bzoj 1042][HAOI2008]硬币购物(用容斥原理弄背包)

    题目:http://www.lydsy.com:808/JudgeOnline/problem.php?id=1042 分析: 解法很巧妙,用f[i]表示四种硬币A.B.C.D的数量不考虑的情况下弄成 ...

  5. logout退出功能是怎么实现的?login登陆功能室怎么实现的

    logout退出功能是怎么实现的?login登陆功能室怎么实现的 login就是登陆成功的时候,在session里面创建好用户对应的数据. logout就是登出的时候,在session里面销毁用户对应 ...

  6. MVC WebApi 将返回值改为JSON格式

    新增一个类: public class BrowserJsonFormatter : JsonMediaTypeFormatter { public BrowserJsonFormatter() { ...

  7. CI session 类的用法

    最近使用codeingiter框架,发现默认的session 不是很好用,以下是用法总结:使用的是2.0.2的版本 1.扩展自带的session类:application/libraries/MY_s ...

  8. SVM学习(续)核函数 & 松弛变量和惩罚因子

    SVM的文章可以看:http://www.cnblogs.com/charlesblc/p/6193867.html 有写的最好的文章来自:http://www.blogjava.net/zhenan ...

  9. [Vue @Component] Pass Props Between Components with Vue Slot Scope & renderless component

    Components with slots can expose their data by passing it into the slot and exposing the data using  ...

  10. ios学习之旅---指针也不难

    1.认识指针 #include <stdio.h> //基本数据类型作为函数參数传递是值传递 //void moveFront(int x ,int y) //{ // x = x + 2 ...