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

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.bean.model.OrderItem;
import com.yami.shop.distribution.comment.model.DistributionProdBind;
import org.apache.ibatis.annotations.Param;

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

/**
 * 分销商品绑定表
 *
 * @author xwc
 * @date 2019-04-22 10:01:44
 */
public interface DistributionProdBindMapper extends BaseMapper<DistributionProdBind> {
    Long getDistributionUserIdByUserIdAndProdId(@Param("userId") String userId, @Param("prodId") Long prodId,@Param("state") Integer state);

    void updateStateByUserIdByUserIdAndProdId(@Param("userId") String userId, @Param("prodId") Long prodId,@Param("state") Integer state);

    Long getNewDistributionUserIdByOrderItems(@Param("orderItems")List<OrderItem> orderItems);

    void updateBindTimeByUserIdAndProdId(@Param("userId") String useriId, @Param("prodId") Long prodId,@Param("distributionUserId") Long distributionUserId, @Param("bindTime") Date bindTime);

    void updateStateByDistributionUserId(@Param("distributionUserId") Long distributionUserId,@Param("state") Integer state);
}
