package com.hai.dao.order;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @className: OrderExtMapper
 * @author: HuRui
 * @date: 2022/8/26
 **/
public interface OrderMapperExt {

    /**
     * 查询用户购买卡券数据
     * @param userId
     * @param couponId
     * @return
     */
    @Select("SELECT count(1) FROM high_child_order where mem_id = #{userId} and child_order_status in (2,3) and goods_type = 1 and goods_id = #{couponId}")
    int userBuyCouponNum(@Param("userId") Long userId,@Param("couponId") Long couponId);

}
