package com.hzs.bonus.achieve.mapper;

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

import java.util.List;

/**
 * Mapper 接口
 */
public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRange> {

    /**
     * 当天的数据更新为0
     */
    void mergeMemberRetailRangeInit(@Param("rangeTableName") String rangeTableName);

    /**
     * 将昨天的业绩信息迁移到今天
     */
    void mergeMemberRetailRangeByYesterday(@Param("rangeTableName") String rangeTableName,
                                           @Param("yesterdayRangeTableName") String yesterdayRangeTableName,
                                           @Param("isSameMonth") Integer isSameMonth);

    /**
     * 根据会员查询会员上的所有网体
     */
    List<CuMemberRetailRangeExt> queryCuMemberRetailRangeParent(@Param("tableName") String tableName, @Param("saOrderExtList") List<?> saOrderExtList);

    /**
     * 批量更新网体
     */
    void mergeCuMemberRetailRangeExt(@Param("rangeTableName") String rangeTableName, @Param("cuMemberRangeExtList") List<?> cuMemberRangeExtList);

}
