/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.coupon.comment.dao;

import java.util.Date;
import java.util.List;

import com.yami.shop.coupon.comment.model.CouponUser;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

public interface CouponUserMapper extends BaseMapper<CouponUser> {

    List<CouponUser> getCouponAndCouponUserByUserId(@Param("userId") String userId);

    List<CouponUser> getCouponAndCouponUserByCouponUserIds(@Param("couponUserIds") List<Long> couponUserIds);

    void deleteUnValidTimeCoupons(@Param("date") Date date);

    void updateStatusByTime(@Param("now") Date now);

    void deleteUserCoupon(@Param("userId") String userId, @Param("couponId") Long couponId);

    void updateUseStatusByCouponUserId(@Param("status") Integer status, @Param("couponUserId") Long couponUserId);

    void batchUpdateUserCouponStatus(@Param("status") int status, @Param("couponUserIds") List<Long> couponUserIds);

    void updateStatusByOrderNumber(@Param("status") int status, @Param("orderNumber") String orderNumber);

}
