mybatis遇到的问题

作者: H_Man | 来源:发表于2017-11-29 15:32 被阅读20次

org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'paymentType' in 'class java.lang.Integer'

我的代码是这么写的,调用的时候之传入了这一个参数,这个参数的非空判断是在mapper里面做的(业务需求)

<select id="listQueryRechargeProduct" parameterType="java.lang.Integer" resultMap="rechargeEntity">
    SELECT * FROM recharge_product
    <if test="_parameter!=null">
      WHERE payment_type=#{paymentType}
    </if>
  </select>

最后查证得知


image.png

这里应该使用mybatis的内置对象"_parameter",而且


image.png

要在#传参里面加上类型.

相关文章

网友评论

    本文标题:mybatis遇到的问题

    本文链接:https://www.haomeiwen.com/subject/htzubxtx.html