package com.zioinfo.mall.promotion.mapper;

import com.zioinfo.mall.promotion.MallCoupon;
import com.zioinfo.mall.promotion.MallPromotion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PromotionMapper {
    // 쿠폰
    List<MallCoupon> findCoupons(@Param("activeOnly") Boolean activeOnly);
    MallCoupon findCouponById(@Param("id") Long id);
    MallCoupon findCouponByCode(@Param("code") String code);
    int insertCoupon(MallCoupon c);
    int updateCoupon(MallCoupon c);
    int incCouponIssued(@Param("id") Long id);
    int deleteCoupon(@Param("id") Long id);

    // 기획전
    List<MallPromotion> findPromotions(@Param("activeOnly") Boolean activeOnly);
    MallPromotion findPromotionById(@Param("id") Long id);
    int insertPromotion(MallPromotion p);
    int updatePromotion(MallPromotion p);
    int deletePromotion(@Param("id") Long id);
}
