mybaits异常:org.apache.ibatis.binding.BindingException: Parameter 'date' not found.

在使用mybaits遇到了如下错误:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'date' not found. Available parameters are [3, 2, 1, 0, param1, param2, param3, param4]

    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
    at com.sun.proxy.$Proxy9.selectOne(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:95)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
    ......
Caused by: org.apache.ibatis.binding.BindingException: Parameter 'date' not found. Available parameters are [3, 2, 1, 0, param1, param2, param3, param4]
    at org.apache.ibatis.binding.MapperMethod$MapperParamMap.get(MapperMethod.java:258)
    at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:40)
    at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:123)
    ... 21 more
1.首先定位问题发生的具体位置,找到了一个函数中参数写法有问题,有问题的函数:

Integer addlastdaystat(Date date,Integer allcount,Integer activecount,Integer isnewcount);

2.修改问题,修改为了:

Integer addlastdaystat(@Param("date")Date date,@Param("allcount")Integer allcount,@Param("activecount")Integer activecount,@Param("isnewcount")Integer isnewcount);

总结:这是由于没有加@param("数据库表中对应的列名")导致的

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值