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

import cn.ezhizao.project.business.supplier.domain.BizSupplierUser;
import cn.ezhizao.project.business.supplier.mapper.BizSupplierUserMapper;
import cn.ezhizao.project.business.supplier.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 getAdminInfo(Long supplierId) {
        QueryWrapper<BizSupplierUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("supplier_id", supplierId);
        queryWrapper.eq("is_admin", "1");

        return userMapper.selectOne(queryWrapper);
    }
}
