package com.haha.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.haha.entity.CouponShop;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CouponShopMapper extends BaseMapper<CouponShop> {

    @Select("SELECT shop_id FROM t_coupon_shop WHERE template_id = #{templateId}")
    List<Long> selectShopIdsByTemplateId(@Param("templateId") Long templateId);

    @Delete("DELETE FROM t_coupon_shop WHERE template_id = #{templateId}")
    int deleteByTemplateId(@Param("templateId") Long templateId);
}
