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