Mybatis 传入List类型参数,报错:There is no getter for property named '__frch_item_0' in

错误如下:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘__frch_item_0‘ in ‘class com.asiacloud.core.model.PageModel‘
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:368)
at $Proxy6.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
at com.asiacloud.core.base.dao.impl.BaseDaoImpl.select(BaseDaoImpl.java:74)
at com.asiacloud.syse.unitaccount.dao.impl.TSyseMaintainAccountDaoImpl.queryListByUnitIdPage(TSyseMaintainAccountDaoImpl.java:107)

Mapper

<select id="queryListByUnitIdPage" parameterType="TSyseMaintainAccount" resultMap="TSyseMaintainAccountResultMap">
        select a.*,b.UNIT_NAME linkUnitName from T_SYSE_MAINTAIN_ACCOUNT a
        left JOIN T_SYSE_OPER_UNIT b
        on a.UNIT_ID=b.ID
        where a.STATUS_FLAG in (‘1‘,‘2‘)
        AND a.UNIT_ID in
            <foreach item="item" index="index" collection="params.idList" open="(" separator="," close=")">
                       #{item}
            </foreach>
        AND a.ID != #{params.id}
    </select>

上面写法错误,注意下面foreach中的值取法,如果取的是List,要用索引来取。

<foreach item="item" index="index" collection="params.idList" open="(" separator="," close=")">
    #{params.idList[${index}]}
</foreach> 

Mybatis 传入List类型参数,报错:There is no getter for property named '__frch_item_0' in

时间: 2024-10-13 23:27:29

Mybatis 传入List类型参数,报错:There is no getter for property named '__frch_item_0' in的相关文章

Mybatis 报错 There is no getter for property named &#39;***&#39; in &#39;class java.lang.String&#39;

在mapper.xml中 , 如果单参数是String类型 , 且在sql语句中对参数进行了判断 , 如下 when 中的判断 , 如果出现 if 判断也是一样的.都需要把判断中的参数用 _parameter 来代替 ,. 另外orcal中判断字段是否为空需要使用 is null , 同理,判断不为空使用 is not null . 错误查询: <select id = "select" resultMap="ResultMap" parameterType=

mybatis仅传入一个String类型参数报错

mybatis中仅传入一个String类型参数时,不可以用 以下方式 List<Map<String,Object> selectEmployee(String time) 这种方式传参会报错There is no getter for property named 'id' in class 'java.lang.String' 目前我知道有两种方式解决问题 1.用 _parameter <if test="_parameter !=null and _paramete

MyBatis查询传一个参数时报错:There is no getter for property named &#39;sleevetype&#39; in &#39;class java.lang.Integer

用MyBatis进行查询,传入参数只有一个时(非Map)如int,报错 There is no getter for property named 'sleevetype' in 'class java.lang.Integer 原因在于测试条件写法有误, <if test="sleevetype==0"><!-- 专属 --> exclusive=1 </if> <if test="sleevetype!=0">&l

vue 报错解决:TypeError: Cannot read property &#39;_t&#39; of undefined&quot;

前端报错如下: [Vue warn]: Error in render: "TypeError: Cannot read property '_t' of undefined" 是在项目中用了多语言配置,vue 跟 i18n之间的兼容问题.解决方法如下: Vue.use(iView) 替换成 Vue.use(iView, { i18n: function(path, options) { let value = i18n.t(path, options) if (value !== n

vue 项目报错,提示:Cannot read property &#39;$createElement&#39; of undefined at render ...

vue 项目报错,提示:Cannot read property '$createElement' of undefined at render ... vue 项目报错,提示:Cannot read property '$createElement' of undefined at render ... 原文地址:https://www.cnblogs.com/sylys/p/11956063.html

Mybatis中传参包There is no getter for property named &#39;XXX&#39; in &#39;class java.lang.String&#39;

一.发现问题 <select id="queryStudentByNum" resultType="student" parameterType="string"> select num,name,phone from student <where> <if test = " num!=null and num!='' "> AND num = #{num} </if> <

Mybatis中传参包There is no getter for property named &#39;roomName&#39; in &#39;class java.lang.String&#39;

一.发现问题 <select id="queryStudentByNum" resultType="student" parameterType="string"> select num,name,phone from student  <where> <if test = " num!=null and num!='' ">AND num = #{num}</if></w

Mybatis There is no getter for property named ‘X‘

在尝试使用mybatis的动态sql中遇到这么一个问题, 使用Mybatis查询时,其参数可以是基本数据类型或者像Integer和String这样的简单的数据对象,也可以是复杂对象(一般是指JavaBean)或者map等,当使用基本数据类型的参数时,若这个参数的使用放在了判断条件中, <!-- mybatis 动态sql--> <select id="findFruit" resultType="Fruit">     SELECT * FR

关于myBatis的问题There is no getter for property named &#39;USER_NAME&#39; in &#39;class com.bky.model.实例类&#39;

现在流行的 ssm(spring + struts2 + myBatis)  持久层的mybatis是需要配置映射器的,找了个demo连接的数据库是mysql 于是就修改了一下弄成了连接oracle的 一切就绪之后跑起来 执行插入操作的时候问题来了 ,报了一个这个错我的表是B 字段是id ,user_name ,password  实例类的字段是 id , userName,password, 这里有个user_name 和userName 搞了一下午弄的头疼,后来发现了猫腻, There is