Mybatis错误:Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2]

Mybatis错误:Parameter ‘XXX‘ not found. Available parameters are [1, 0, param1, param2]

原因:传递的参数超过一个

解决办法:

(1)直接把值改成数字

<select id="LoginUser" parameterType="String" resultMap="userMap">
  SELECT * FROM user where emplnumb = #{0} and password=#{1}
</select>

(2)在变量上加注解@Param

Public User selectUser(@param(“userName”) String name,@param (“userpassword”)

  

public List<user> getUserInformation(@Param("user") User user);

  

Mybatis错误:Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2]

原文地址:https://www.cnblogs.com/durui/p/8279117.html

时间: 2024-10-18 05:31:26

Mybatis错误:Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2]的相关文章

初学Java9:学习Mybatis时报错:Parameter &#39;name&#39; not found. Available parameters are [1, 0, param1, param2]

报错-->Parameter 'name' not found. Available parameters are [1, 0, param1, param2] 百度找到这篇文章完成修改 http://blog.csdn.net/w86440044/article/details/29363067 我之前写的操作类是和博主一样,是这样的: 1 // 登录·查询 2 @Select("select * from t_users where uname=#{name} and pswd=#{p

org.apache.ibatis.binding.BindingException: Parameter &#39;xxx&#39; not found. Available parameters are [arg1, arg0, param1, param2]

这个异常说明参数没有加上@Param注解,加上这个注解就行了. org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available parameters are [arg1, arg0, param1, param2] 原文地址:https://www.cnblogs.com/FengZeng666/p/12012727.html

org.apache.ibatis.binding.BindingException: Parameter &#39;start&#39; not found. Available parameters are [1, 0, param1, param2]

DEBUG 2018-05-30 08:43:26,091 org.springframework.jdbc.datasource.DataSourceTransactionManager: Rolling back JDBC transaction on Connection [[email protected]]DEBUG 2018-05-30 08:43:26,091 org.mybatis.spring.SqlSessionUtils$SqlSessionSynchronization:

java 传入多个参数时报&quot;Parameter &#39;XXX&#39; not found. Available parameters are [arg1, arg0, param1,...&quot; 解决方案

@Select("SELECT id FROM ae_post ORDER BY id DESC LIMIT #{page},#{size}") List<Post> getAllForPage(@Param("page") int page, @Param("size")int size); dao层写入,解决方法如上 注:多参数需要添加 @Param("参数名") int 参数名 java 传入多个参数时报&q

Parameter &#39;name&#39; not found. Available parameters are [arg1, arg0, param1, param2]

解决方法: <select id="selectIf" resultType="student"> SELECT id,name,age,score FROM t_student WHERE 1=1 <if test="arg0 != null and arg0 !=''"> AND name LIKE '%' #{arg0} '%' </if> <if test="arg1>=0&quo

Parameter &#39;xxx&#39; not found. Available parameters are [collection, list]

mybatis报错问题: dao层: List<HqjTrade> queryHongbao(ArrayList<String> listType); 映射文件下sql: <select id="queryHongbao" resultType="HqjTrade" > select * from hqj_trade where tradetype in <foreach collection="listType&

mybatis:Parameter &#39;list&#39; not found. Available parameters are [templateId, param1, param2, valueList]

我的EsdTemplateSealMapper.java里面定义的接口是这样的 public List<EsdTemplateSeal> getFilteOutSeal(@Param("filterList")List<String> list,@Param("templateId")String templateId); 然后我的EsdTemplateSealMapper.xml里面的sql是这样的: <select id="

解决mybatis foreach 错误: Parameter &#39;__frch_item_0&#39; not found

解决mybatis foreach 错误: Parameter '__frch_item_0' not found 在遍历对象的属性(是ArrayList对象)时报错: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not found. Available parameters

mybatis中Parameter index out of range (1 &gt; number of parameters, which is 0).

Parameter index out of range (1 > number of parameters, which is 0).(参数索引超出范围) 在mybatis里面写就是应该是 like  '%${name} %' 而不是 '%#{name} %'   ${name} 是不带单引号的,而#{name} 是带单引号的 所以,当你用到 like '%#{name}%' 会报这种错误 版权声明:本文为不会代码的小白原创文章,未经允许不得转载.