package cn.ezhizao.project.business.service.impl;

import cn.ezhizao.project.business.domain.BizSupplierUser;
import cn.ezhizao.project.business.mapper.BizSupplierUserMapper;
import cn.ezhizao.project.business.service.IBizSupplierUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 用户 业务层处理
 *
 * @author ruoyi
 */
@Service
public class BizSupplierUserServiceImpl extends ServiceImpl<BizSupplierUserMapper, BizSupplierUser> implements IBizSupplierUserService {
    private static final Logger log = LoggerFactory.getLogger(BizSupplierUserServiceImpl.class);

    @Resource
    private BizSupplierUserMapper userMapper;

    @Override
    public BizSupplierUser selectUserByUserNameAndSupplierId(String username, String supplierId) {
        QueryWrapper<BizSupplierUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username).eq("supplier_id", supplierId);

        return userMapper.selectOne(queryWrapper);
    }
}
