/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.distribution.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.distribution.comment.dto.AchievementDataDto;
import com.yami.shop.distribution.comment.dto.DistributionUserAchievementDataDto;
import com.yami.shop.distribution.comment.dto.DistributionUserSimpleDto;
import com.yami.shop.distribution.comment.model.DistributionUser;
import com.yami.shop.distribution.comment.param.RangeTimeParam;
import com.yami.shop.distribution.comment.param.UpdateDistributionUserParam;
import org.apache.ibatis.annotations.Param;

/**
 *
 * @author lgh on 2019/04/01.
 */
public interface DistributionUserService extends IService<DistributionUser> {

    /**
     * 获取分销员用户信息
     * @param userId
     * @param shopId
     * @return
     */
    DistributionUser getByUserIdAndShopId(String userId,Long shopId);

    void removeCacheByUserIdAndShopId(String userId,Long shopId);

    /**
     * 根据分销员Id获取分销员信息
     * @param id
     * @return
     */
    AchievementDataDto getAchievementDataDtoById(Long id);

    /**
     * 获取分销员与等级条件匹配的数据
     * @param distributionUserId
     * @return
     */
    DistributionUserAchievementDataDto getDistributionUserLevelAchievementDataByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

    IPage<DistributionUser> distributionUserPage(Page page, DistributionUser distributionUser, RangeTimeParam rangeTimeParam, String mobile, String parentMobile);


    void updateSelectiveAndInsertDistributionUserBan(UpdateDistributionUserParam param, Long modifier);

    IPage<DistributionUser> getDistributionUserAchievementPage(Page page,DistributionUser distributionUser,String userMobile);

    void registerDistributionUser(DistributionUser distributionUser);


    IPage<DistributionUserSimpleDto> getDistributionUserSimpleDtoByParentUserIdPage(Page page, Long parentDistributionUserId);


    DistributionUser getByCardNo(String cardNo);

    void removeCacheByCardNo(String cardNo);


}
