package com.ruoyi.voluntary.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.ruoyi.voluntary.domain.BusiCards;

/**
 * vip卡Mapper接口
 *
 * @author voluntary
 * @date 2022-11-20
 */
public interface BusiCardsMapper {
    /**
     * 查询vip卡
     *
     * @param cardId vip卡主键
     * @return vip卡
     */
    public BusiCards selectBusiCardsByCardId(Long cardId);

    public Integer getMaxCardNo(Integer type);

    public List<BusiCards> selectBusiOutTimeCardsList(BusiCards busiCards);
    public List<BusiCards> selectBusiCardsClosed();

    /**
     * 查询vip卡列表
     *
     * @param busiCards vip卡
     * @return vip卡集合
     */
    public List<BusiCards> selectBusiCardsList(BusiCards busiCards);

    public BusiCards selectBusiCardsByCardNo(String cardNo);

    public BusiCards selectOneECard();

    public List<BusiCards> selectBusiCardsByCardNos(List<String> cardNos);

    /**
     * 新增vip卡
     *
     * @param busiCards vip卡
     * @return 结果
     */
    public int insertBusiCards(BusiCards busiCards);

    public int insertBatchCardList(List<BusiCards> cards);

    /**
     * 修改vip卡
     *
     * @param busiCards vip卡
     * @return 结果
     */
    public int updateBusiCards(BusiCards busiCards);

    public int updateBusiCardsBatch(List<BusiCards> busiCards);

    /**
     * 删除vip卡
     *
     * @param cardId vip卡主键
     * @return 结果
     */
    public int deleteBusiCardsByCardId(Long cardId);

    /**
     * 批量删除vip卡
     *
     * @param cardIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBusiCardsByCardIds(Long[] cardIds);

    List<BusiCards> getIdsByCardAndRole(@Param("startCard") String startCard, @Param("endCard") String endCard,
        @Param("status") Integer status, @Param("againDistributionCard") Integer againDistributionCard);

    /**
     * 批量操作
     *
     * @param cardIds
     * @param update
     * @return
     */
    public Integer batchUpdate(BusiCards update);

    /**
     * 按代理商统计
     *
     * @param card
     * @return
     */
    @SuppressWarnings("rawtypes")
    public List<Map> staticByAgent(BusiCards card);
}
