package com.hzs.bonus.achieve.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.member.achieve.CuMemberMonthAchieve;
import com.hzs.common.domain.member.ext.CuMemberMonthAchieveExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 会员月数据 Mapper 接口
 */
public interface CuMemberMonthAchieveMapper extends BaseMapper<CuMemberMonthAchieve> {

    /**
     * 根据时间查询月业绩
     */
    List<CuMemberMonthAchieveExt> queryCuMemberMonthAchieveByDate(@Param("startPeriod") Integer startPeriod,
                                                                  @Param("endPeriod") Integer endPeriod,
                                                                  @Param("recommend") Integer recommend,
                                                                  @Param("repurchase") Integer repurchase);

    /**
     * 每天插入会员月表，计算推荐业绩，复购业绩，1-6号计算前7天
     */
    void insertCuMemberMonthAchieve(@Param("tableName") String tableName, @Param("period") Integer period, @Param("month") String month);

}
