Parameter 'name' 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">
AND age >= #{arg1}
</if>

</select>

出现异常情况:

如果用where就不用写1=1操作了

Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2]

原文地址:https://www.cnblogs.com/Koma-vv/p/10358566.html

时间: 2024-10-07 23:26:25

Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2]的相关文章

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

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;offset&#39; not found. Available parameters are [0, 1, param1, param2]的方法

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'offset' not found. Available parameters are [0, 1, param1, param2] at org.mybatis.spring.MyBatisExceptionTranslator.translateExcepti

初学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

Mybatis错误:Parameter &#39;XXX&#39; 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

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:

Parameter &#39;email&#39; not found. Available parameters are [0, 1, param1, param2]解决方案

转自:https://blog.csdn.net/wdehxiang/article/details/77619569 原因: 传入多个值时,mybatis会自动将这些值转成类似map形式的值,以0,1,2…的序列为keyName. 这里我们需要先简单了解一下mybatis的传值机制.Mybatis现在可以使用的parameterType有基本类型和Java负责类型 基本数据类型:包含int,String,Date等.基本数据类型作为传参,只能传入一个.通过#{参数名}获取. 复杂数据类型:包含

MyBatis批量操作报错:Parameter &#39;xxxList&#39; not found. Available parameters are [list]

需求: 根据传入的参数批量 删除数据: DAO: List ll = new ArrayList<Integer>(); for(int i=10;i<25;i++){ ll.add(i); } int res = userMapper.delUser(li); System.out.println(res); xml: <delete id="delUser" parameterType="list" > delete from us

Mybatis报错:Parameter &#39;list&#39; not found. Available parameters are [groupList, param1]

GroupDao.java 里面定义的方法: void batchInsertLog(@Param("groupList") List<MktPromotionIntegralLog> groupList); 修改前的GroupMapper.xml <insert id="batchInsertLog" parameterType="java.util.List"> INSERT INTO table (ps_id,goo