package com.kmall.api.dao;

import com.kmall.api.entity.UserCouponVo;
import org.apache.ibatis.annotations.Param;
import com.kmall.manager.dao.BaseDao;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author Scott
 * @email
 * @date 2017-08-11 09:16:47
 */
@Component
public interface ApiUserCouponMapper extends BaseDao<UserCouponVo> {
    UserCouponVo queryByCouponNumber(@Param("coupon_number") String coupon_number);
    /**
     * 按条件查询用户优惠券
     *
     * @param params
     * @return
     */
    List<UserCouponVo> queryUserCoupons(Map<String, Object> params);

    UserCouponVo queryByOrderId(@Param("order_id") Long order_id);

    Integer cancelOrder(UserCouponVo couponVo);

    List<UserCouponVo> queryObjectByIdAndUsed(@Param("ticketDiscId")Integer ticketDiscId, @Param("userId")Long userId);

    UserCouponVo queryObjectByStoreTopicIdAndUserId(@Param("storeTopicId")Integer storeTopicId,@Param("userId")Long userId);

    List<UserCouponVo> queryObjectByDiscIdAndUserId(@Param("ticketDiscId")Integer ticketDiscId,@Param("userId")Long userId);

    Map queryStoreTopicByDictId(@Param("ticketDiscId") Integer ticketDiscId);

    Integer queryReceiveNumByStoreTopicId(@Param("storeTopicId") Integer storeTopicId);
}
