package com.fjs.scenic.mapper.good;

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

import org.apache.ibatis.annotations.Param;

import com.fjs.scenic.entity.good.PriceRule;

public interface PriceRuleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(PriceRule record);

    int insertSelective(PriceRule record);

    PriceRule selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(PriceRule record);

    int updateByPrimaryKey(PriceRule record);

    /**
     * 删除商品下的价格规则
     */
    void deleteByGoodsId(@Param("goodsId") int goodsId);
    
    PriceRule selectPriceRulesByGoodsIdAndNowDate(@Param("goodsId") int goodsId);

    /**
     * 更具商品id查询商品价格规则列表
     */
    List<PriceRule> selectPriceRulesByGoodsId(@Param("goodsId") int goodsId);

    /**
     * 暂停或恢复售票
     *
     * @param startDate
     * @param endDate
     * @param saleTicketType 1恢复售票0暂停售票
     * @return
     */
    int saleOrRecoverSaleTicket(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("saleTicketType") int saleTicketType);

}