Parameter ‘zpspid‘ not found

异常:nested exception is org.apache.ibatis.binding.BindingException: Parameter 'testypid' not found. Available parameters are [ztpsXmjcxx, pageable, param1, param2]

分析:以为是xml文件中没有对应的字段,一细看了几遍是有这个字段的,而且entity也有这个字段。查询xml中的sql语句,定位到是

<if test="testypid != null and testypid != ''">

and testypid = #{testypid}

</if>

 这一段导致的异常,于是打断点,实体类中是传入了字段的值,那么分析可能是因为mapper里面传入了2个实体类的参数,导致筛选的时候   if里面获取不到实体类里面的字,再回到mapper里面的方法

mapper对应的方法

List<ZtpsXmjcxx> queryAllByLimit(mjcxx mjcxx, @Param("pageable") Pageable pageable);

发现 ztpsXmjcxx 实体类前面 没有@Param

mapper文件修改后

List<ZtpsXmjcxx> queryAllByLimit(@Param("mjcxx")mjcxx mjcxx, @Param("pageable") Pageable pageable);

xml文件修改后

<if test="mjcxx.post1 != null and mjcxx.post1 != ''">

and mjcxx.testypid = #{mjcxx.testypid}

</if>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值