package com.hzs.bonus.achieve.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.member.achieve.CuMemberRetailRange;
import com.hzs.common.domain.member.achieve.ext.CuMemberRetailRangeExt;
import com.hzs.common.domain.sale.ext.SaOrderExt;

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

/**
 * 服务类
 */
public interface ICuMemberRetailRangeService extends IService<CuMemberRetailRange> {

    /**
     * 将昨天的业绩信息迁移到今天
     */
    void mergeMemberRetailRangeByYesterday(Date settleEndDate, String rangeTableName, String yesterdayRangeTableName, Boolean isSameMonth);

    /**
     * 根据会员查询会员上的所有网体, 按照pkParent作为key
     */
    List<CuMemberRetailRangeExt> queryCuMemberRetailRangeParent(String tableName, List<SaOrderExt> saOrderExtList);

    /**
     * 更新会员树的累计业绩
     *
     * @param settleTableName 结算日期
     * @param cuMemberTreeMap 树
     */
    void updateCuMemberRetailRange(String settleTableName, Map<Long, CuMemberRetailRangeExt> cuMemberTreeMap);

}
