package com.hzs.bonus.bonus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.bonus.bonus.param.BonusExpandParam;
import com.hzs.common.domain.member.bonus.CuBonusExpand;
import com.hzs.common.domain.member.ext.CuBonusExpandExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Mapper 接口
 */
public interface CuBonusExpandMapper extends BaseMapper<CuBonusExpand> {

    /**
     * 查询4-n配置
     *
     * @param bonusExpandParam
     * @return
     */
    List<CuBonusExpandExt> queryBonusExpand(BonusExpandParam bonusExpandParam);

    /*
     * @description: 查询日期是否标红
     **/
    List<CuBonusExpandExt> queryBonusExpandDis(BonusExpandParam bonusExpandParam);

    /*
     * @description: 查询所有零线会员
     **/
    List<CuBonusExpand> queryZeroMemberByVertex();

    /*
     * @description: 时间、期间计算波比 -- 首购
     **/
    List<CuBonusExpand> calculateDayRatioByBonusExpandParam(@Param("bonusExpandParam") BonusExpandParam bonusExpandParam, @Param("tableName") String tableName);

    /*
     * @description: 时间、期间计算波比 -- 复购
     **/
    List<CuBonusExpand> calculateDayRepRatioByBonusExpandParam(@Param("bonusExpandParam") BonusExpandParam bonusExpandParam, @Param("tableName") String tableName);

    /*
     * @description: 删除临时表
     **/
    void truncateTable();

    /*
     * @description: 批量更新4-n配置
     **/
    void mergeBonusExpandByList(@Param("cuBonusExpandList") List<CuBonusExpand> cuBonusExpandList);
}
