package com.cool.store.dao;

import com.cool.store.entity.HyPartnerUserPlatformBindDO;
import com.cool.store.mapper.HyPartnerUserPlatformBindMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @Author wxp
 * @Date 2023/6/13 19:41
 * @Version 1.0
 */
@Repository
public class HyPartnerUserPlatformBindDAO {


    @Resource
    HyPartnerUserPlatformBindMapper hyPartnerUserPlatformBindMapper;

    public  int insertSelective( HyPartnerUserPlatformBindDO record){
        return hyPartnerUserPlatformBindMapper.insertSelective(record);
    }

    public  int updateByPrimaryKeySelective(HyPartnerUserPlatformBindDO record){
        return hyPartnerUserPlatformBindMapper.updateByPrimaryKeySelective(record);
    }

    public HyPartnerUserPlatformBindDO getByPlatformTypeAndUserId(String platformType, String platformUserId){
        if(StringUtils.isAnyBlank(platformType, platformUserId)){
            return null;
        }
        return hyPartnerUserPlatformBindMapper.getByPlatformTypeAndUserId(platformType, platformUserId);
    }

    public HyPartnerUserPlatformBindDO getByPartnerId(String partnerId){
        if (StringUtils.isEmpty(partnerId)){
            return null;
        }
        return hyPartnerUserPlatformBindMapper.getByPartnerId(partnerId);
    }
}
