package com.hzs.bonus.bonus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.bonus.bonus.param.CuMemberBonusDelayParam;
import com.hzs.common.domain.member.bonus.CuMemberBonusDelay;
import com.hzs.common.domain.member.bonus.ext.CuMemberBonusDelayExt;
import com.hzs.common.domain.member.ext.CuMemberSettleExt;
import org.apache.ibatis.annotations.Param;

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

/**
 * 会员奖金-拓展收益延缓表 Mapper 接口
 */
public interface CuMemberBonusDelayMapper extends BaseMapper<CuMemberBonusDelay> {

    /**
     * 删除会员延缓发放主表
     *
     * @param period
     */
    void deleteCuMemberBonusDelay(@Param("period") Integer period);

    /**
     * 批量插入会员延缓发放主表
     *
     * @param cuMemberBonusDelayList
     */
    void batchInsertCuMemberBonusDelay(@Param("cuMemberBonusDelayList") List<?> cuMemberBonusDelayList);

    /**
     * 查询当天没有产生过奖金，但是还有延缓发放奖金的列表
     *
     * @param currentSettleTableName
     * @param pkMemberSet
     * @param yesterdayPeriod
     * @return
     */
    List<CuMemberSettleExt> listDelayNotBonus(@Param("currentSettleTableName") String currentSettleTableName,
                                              @Param("pkMemberSet") Set<Long> pkMemberSet,
                                              @Param("yesterdayPeriod") Integer yesterdayPeriod);

    /**
     * 查询延缓奖金列表
     *
     * @param param
     * @return
     */
    List<CuMemberBonusDelayExt> listDelay(@Param("param") CuMemberBonusDelayParam param);

}
