(mybatis)There is no getter for property named 'isEffective' in 'class java.lang.String(
Posted 【一粒大米】洞悉技术的本质,享受科技的乐趣
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(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(的主要内容,如果未能解决你的问题,请参考以下文章
Mybatis单个参数的if判断(针对异常:There is no getter for property..)------mybatis的内置对象
mybatis出现There is no getter for property named ...的原因及解决办法
Mybatis单个参数报错: There is no getter for property named
Mybatis单个参数报错: There is no getter for property named
mybatis之org.apache.ibatis.reflection.ReflectionException: There is no getter for property named '
Mybatis问题:There is no getter for property named 'unitId' in 'class java.lang.String'