package com.bonus.canteen.core.marketing.coupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.marketing.coupon.model.MktCouponTmplDetlBack;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

@Mapper
public interface MktCouponTmplDetlBackMapper extends BaseMapper<MktCouponTmplDetlBack> {
   @Select({"SELECT canteen_id, shopstall_id, interval_id,area_id FROM mkt_coupon_tmpl_detl_back WHERE back_id = #{backId}"})
   List<MktCouponTmplDetlBack> listByBackId(@Param("backId") Long backId);

   @Select({"SELECT DISTINCT interval_id FROM mkt_coupon_tmpl_detl_back WHERE back_id = #{backId}"})
   Set<Long> getMealtimeTypeSetByBackId(Long backId);
}
