package com.hzs.member.achieve.mapper;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.member.achieve.CuMemberMonthAchieve;
import com.hzs.common.domain.member.ext.CuMemberMonthAchieveExt;
import com.hzs.member.achieve.controller.vo.ParentAchieveVO;
import com.hzs.member.achieve.controller.vo.RealPerformanceVo;
import com.hzs.member.achieve.vo.CuMemberMonthVo;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 会员月数据 Mapper 接口
 * </p>
 *
 * @author hzs
 * @since 2023-06-06
 */
public interface CuMemberMonthAchieveMapper extends BaseMapper<CuMemberMonthAchieve> {

    /*
     * @description: 根据时间查询月业绩
     * @author: sui q
     * @date: 2023/6/7 14:37
     * @param: null null
     **/
    List<CuMemberMonthAchieveExt> queryCuMemberMonthAchieveByDate(@Param("startPeriod") Integer startPeriod, @Param("endPeriod") Integer endPeriod,
                                                                  @Param("recommend") Integer recommend);

    /*
     * @description: 根据条件查询会员月业绩 推荐达人
     * @author: sui q
     * @date: 2023/6/7 16:00
     * @param: null null
     **/
    List<CuMemberMonthAchieveExt> queryCuMemberMonthAchieveRecommend(ParentAchieveVO parentAchieveVO);

    /*
     * @description: 根据条件查询会员月业绩 推荐达人
     * @author: sui q
     * @date: 2023/6/7 16:00
     * @param: null null
     **/
    List<CuMemberMonthAchieveExt> queryCuMemberMonthAchieveRepurchase(ParentAchieveVO parentAchieveVO);

    /*
     * @description: 每天插入会员月表，计算推荐业绩，复购业绩，1-6号计算前7天
     * @author: sui q
     * @date: 2023/6/6 14:15
     * @param: null null
     **/
    void insertCuMemberMonthAchieve(@Param("tableName") String tableName, @Param("period") Integer period, @Param("month") String month);
    /**
     *
     * @param pkMember 会员主键
     * @param achieveTable 表名
     * @return
     */
    CuMemberMonthVo queryCuMemberMonthInfo(@Param("pkMember") Long pkMember,@Param("achieveTable") String achieveTable);
    /**
     * 查询会员真实业绩
     * @param pkMember
     * @param achieveTable
     * @return
     */
    RealPerformanceVo queryCuMemberMonthAchieveInfo(@Param("pkMember") Long pkMember,@Param("achieveTable") String achieveTable);
}
