首页 > 编程语言 > 详细

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

时间:2018-11-27 14:21:10      阅读:841      评论:0      收藏:0      [点我收藏+]

原来代码:

  <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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!