(mybatis)There is no getter for property named 'isEffective' in 'class java.lang.String

原来代码:

  <select id="findSpecialOffer" resultType="com.lizard.back.model.SpecialOffer" parameterType="java.lang.String">
        SELECT
        taso.id,
        taso.product_id as productId ,
        taso.table_name as tableName,
        taso.start_time_special_off as startTimeSpecialOff,
        taso.end_time_special as endTimeSpecial,
        taso.create_time as createTime,
        taso.operator,
        tau.mobile as mobile,
        taso.is_effective as isEffective,
        taso.type
        FROM
        `t_admin_special_offer` taso
        INNER JOIN t_admin_user tau ON tau.uid = taso.operator
        <if test="isEffective!=null">
            where taso.is_effective = #{isEffective,jdbcType=VARCHAR}
        </if>
    </select>

  

解决方法:    不管你的参数是什么,都要改成"_parameter"

<select id="findSpecialOffer" resultType="com.lizard.back.model.SpecialOffer" parameterType="java.lang.String">
        SELECT
        taso.id,
        taso.product_id as productId ,
        taso.table_name as tableName,
        taso.start_time_special_off as startTimeSpecialOff,
        taso.end_time_special as endTimeSpecial,
        taso.create_time as createTime,
        taso.operator,
        tau.mobile as mobile,
        taso.is_effective as isEffective,
        taso.type
        FROM
        `t_admin_special_offer` taso
        INNER JOIN t_admin_user tau ON tau.uid = taso.operator
        <if test="_parameter !=null and _parameter !=‘‘">
            where taso.is_effective = #{isEffective,jdbcType=VARCHAR}
        </if>
    </select>

  

(mybatis)There is no getter for property named 'isEffective' in 'class java.lang.String

原文地址:https://www.cnblogs.com/EveningWind/p/10025968.html

时间: 2024-08-28 13:25:24

(mybatis)There is no getter for property named 'isEffective' in 'class java.lang.String的相关文章

mybaits错误解决:There is no getter for property named &#39;id&#39; in class &#39;java.lang.String&#39;(转)

在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter来代替参数名. 正确的写法: [html] view plain <span style="font-size:18px;">    <!-- 用于查询运单号是否存在 --> <select id="isCargoBillNoExist" resultType="java.lang.Integer&quo

Mybatis问题:There is no getter for property named &#39;unitId&#39; in &#39;class java.lang.String&#39;

Mybatis遇到的问题 问题: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'unitId' in 'class java.lang.String' at org.mybatis.spring.MyBatisExceptionTransla

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;bizId&#39; in &#39;class java.lang.Long&#39;

mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long' 当使用mybatis进行传参的时候,参数只有一个时会出现这种类似的错误. 解决: 1.接口定义出,指定参数名 2.在xml 中指定类型 mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long'

mybatis There is no getter for property named &#39;xx&#39; in &#39;class java.lang.String

用mybatis查询时,传入一个字符串传参数,且进行判断时,会报 There is no getter for property named 'moduleCode' in 'class java.lang.String 错误写法: <select id="queryAllParentModule" resultType="jobModule" parameterType="jobModule"> select modulecode,

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之org.apache.ibatis.reflection.ReflectionException: There is no getter for property named &#39;time&#39; in &#39;class java.lang.String&#39;

mybatis接口 List<String> getUsedCate(String time); 配置文件 <select id="getUsedCate" parameterType="java.lang.String" resultType="java.lang.String"> select distinct(cate.cate_name) from account as acc left join conCateg

org.apache.ibatis.reflection.ReflectionException: There is no getter for property named &#39;parentId&#39; in &#39;class java.lang.String&#39;

Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'parentId' in 'class java.lang.String' at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:333) at org.apache.ibatis.reflection.Meta

There is no getter for property named &#39;userId&#39; in &#39;class java.lang.String&#39;

[ERROR] 2017-01-18 04:37:06:231 cn.dataenergy.common.CenterHandlerExceptionResolver (CenterHandlerExceptionResolver.java:44) - 统一捕获异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Th