当前位置:网站首页>Parameter ‘courseId‘ not found. Available parameters are [arg1, arg0, param1, para

Parameter ‘courseId‘ not found. Available parameters are [arg1, arg0, param1, para

2022-08-06 07:45:06Youmans_station

Parameter ‘courseId’ not found. Available parameters are [arg1, arg0, param1, para
mybatis 报错

网上说参数化添加@paran(xx)

没有 解决

 @Override  原截取代码
    public Boolean isBuyCourse(Long userId,Long courseId) {
    
        try {
    
            OrderInfo buy = baseMapper.isBuy(userId, courseId);
            return !StringUtils.isEmpty(buy);
        }catch (Exception e){
    
            e.printStackTrace();
            return false ;
        }
    }

最后在 xml文件里面添加,解决

select o1.id
from order_detail o1
left join order_info o2 on o1.id = o1.id
where o1.user_id=#{ param1} and o1.course_id=#{ param2} and o2.order_status=1
group by o1.id

原网站

版权声明
本文为[Youmans_station]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46071647/article/details/126089375

随机推荐