package com.fzm.mall.server.admin.marketing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fzm.mall.server.admin.marketing.entity.dto.PromotionDTO;
import com.fzm.mall.server.admin.marketing.model.Promotion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品促销 Mapper 接口
 * </p>
 *
 * @author wulixian
 * @since 2021-03-10
 */
@Mapper
public interface PromotionMapper extends BaseMapper<Promotion> {

    IPage<PromotionDTO> page(Page<PromotionDTO> page,
                             @Param("promotionId") String promotionId,
                             @Param("name") String name,
                             @Param("status") Integer status,
                             @Param("merchantId") String merchantId);

    Promotion read(@Param("promotionId") String promotionId,
                   @Param("merchantId") String merchantId);

    List<Promotion> listTimeRepetition(@Param("merchantId") String merchantId);
}
