package com.hzs.bonus.base.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.bonus.base.service.*;
import com.hzs.common.domain.member.base.*;
import com.hzs.common.domain.member.detail.CuMemberAwards;
import com.hzs.common.domain.member.detail.CuMemberLevel;
import com.hzs.bonus.base.mapper.CuMemberMapper;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 会员 服务实现类
 */
@Service
public class CuMemberServiceImpl extends ServiceImpl<CuMemberMapper, CuMember> implements ICuMemberService {

    @Override
    public CuMember getMember(Long pkId) {
        if (pkId == null) {
            return null;
        }
        return baseMapper.queryLoginMember(null, pkId);
    }

    @Override
    public void updateCuMemberByPeriod(Integer period) {
        baseMapper.updateCuMemberByPeriod(period);
    }

    @Override
    public void updateCuMemberRangeByPeriod(List<CuMemberAwards> cuMemberAwardsList, Integer period) {
        baseMapper.updateCuMemberRangeByPeriod(period);
    }

    @Override
    public void updateBackCuMemberAward(List<CuMemberAwards> cuMemberAwards, Integer period) {
        baseMapper.updateBackCuMemberAward(period);
    }

    @Override
    public List<CuMember> queryCuMemberShareTotal(Integer pkCountry) {
        return baseMapper.queryCuMemberShareTotal(pkCountry);
    }

    @Override
    public void updateBackCuMemberGrade(List<CuMemberLevel> cuMemberLevelList, Integer period) {
        baseMapper.updateBackCuMemberGrade(period);
    }

    @Override
    public void updateCuMemberLevelByPeriod(Integer period) {
        baseMapper.updateCuMemberLevelByPeriod(period);
    }

}
