package com.bonus.sgzb.base.service.impl;

import com.bonus.sgzb.base.domain.MaSupplierInfo;
import com.bonus.sgzb.base.mapper.MaSupplierInfoMapper;
import com.bonus.sgzb.base.service.IMaSupplierInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 供应商管理ma_supplier_infoService业务层处理
 * 
 * @author bonus
 * @date 2023-12-10
 */
@Service
public class MaSupplierInfoServiceImpl implements IMaSupplierInfoService
{
    @Autowired
    private MaSupplierInfoMapper maSupplierInfoMapper;

    /**
     * 查询供应商管理ma_supplier_info
     * 
     * @param supplierId 供应商管理ma_supplier_info主键
     * @return 供应商管理ma_supplier_info
     */
    @Override
    public MaSupplierInfo selectMaSupplierInfoBySupplierId(Long supplierId)
    {
        return maSupplierInfoMapper.selectMaSupplierInfoBySupplierId(supplierId);
    }

    /**
     * 查询供应商管理ma_supplier_info列表
     * 
     * @param maSupplierInfo 供应商管理ma_supplier_info
     * @return 供应商管理ma_supplier_info
     */
    @Override
    public List<MaSupplierInfo> selectMaSupplierInfoList(MaSupplierInfo maSupplierInfo)
    {
        return maSupplierInfoMapper.selectMaSupplierInfoList(maSupplierInfo);
    }

    /**
     * 新增供应商管理ma_supplier_info
     * 
     * @param maSupplierInfo 供应商管理ma_supplier_info
     * @return 结果
     */
    @Override
    public int insertMaSupplierInfo(MaSupplierInfo maSupplierInfo)
    {
        maSupplierInfo.setCreateTime(DateUtils.getNowDate());
        return maSupplierInfoMapper.insertMaSupplierInfo(maSupplierInfo);
    }

    /**
     * 修改供应商管理ma_supplier_info
     * 
     * @param maSupplierInfo 供应商管理ma_supplier_info
     * @return 结果
     */
    @Override
    public int updateMaSupplierInfo(MaSupplierInfo maSupplierInfo)
    {
        maSupplierInfo.setUpdateTime(DateUtils.getNowDate());
        return maSupplierInfoMapper.updateMaSupplierInfo(maSupplierInfo);
    }

    /**
     * 批量删除供应商管理ma_supplier_info
     * 
     * @param supplierIds 需要删除的供应商管理ma_supplier_info主键
     * @return 结果
     */
    @Override
    public int deleteMaSupplierInfoBySupplierIds(Long[] supplierIds)
    {
        return maSupplierInfoMapper.deleteMaSupplierInfoBySupplierIds(supplierIds);
    }

    /**
     * 删除供应商管理ma_supplier_info信息
     * 
     * @param supplierId 供应商管理ma_supplier_info主键
     * @return 结果
     */
    @Override
    public int deleteMaSupplierInfoBySupplierId(Long supplierId)
    {
        return maSupplierInfoMapper.deleteMaSupplierInfoBySupplierId(supplierId);
    }
}
