/*
 * 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.model.DistributionUserBind;
import com.yami.shop.distribution.comment.param.RangeTimeParam;

/**
 *
 * @author lgh on 2019/04/01.
 */
public interface DistributionUserBindService extends IService<DistributionUserBind> {
    IPage<DistributionUserBind> distributionMsgsAndUserPage(Page page, DistributionUserBind distributionUserBind, RangeTimeParam bindTime, RangeTimeParam invalidTime, String userName, String  parentName);

    /**
     * 获取绑定人id
     * @param shopId
     * @param userId
     * @param state
     * @return
     */
    Long getParentDistributionIdByShopIdAndUserId(Long shopId,String userId,Integer state);

    /**
     * 通过用户id和分销员id 尝试进行绑定,返回绑定结果
     * @param userId
     * @param distributionUserId
     */
    boolean bindingUser(String userId, Long distributionUserId, Long shopId);

}
