package com.fs.oms.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.oms.vo.OmsSupplierExportVO;
import com.fs.oms.vo.OmsSupplierListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.oms.mapper.OmsSupplierMapper;
import com.fs.oms.domain.OmsSupplier;
import com.fs.oms.service.IOmsSupplierService;

/**
 * 供应商管理Service业务层处理
 *
 * @author fs
 * @date 2023-06-15
 */
@Service
public class OmsSupplierServiceImpl implements IOmsSupplierService
{
    @Autowired
    private OmsSupplierMapper omsSupplierMapper;

    /**
     * 查询供应商管理
     *
     * @param id 供应商管理ID
     * @return 供应商管理
     */
    @Override
    public OmsSupplier selectOmsSupplierById(Long id)
    {
        return omsSupplierMapper.selectOmsSupplierById(id);
    }

    /**
     * 查询供应商管理列表
     *
     * @param omsSupplier 供应商管理
     * @return 供应商管理
     */
    @Override
    public List<OmsSupplierListVO> selectOmsSupplierList(OmsSupplier omsSupplier)
    {
        return omsSupplierMapper.selectOmsSupplierList(omsSupplier);
    }

    /**
     * 新增供应商管理
     *
     * @param omsSupplier 供应商管理
     * @return 结果
     */
    @Override
    public int insertOmsSupplier(OmsSupplier omsSupplier)
    {
        omsSupplier.setCreateTime(DateUtils.getNowDate());
        return omsSupplierMapper.insertOmsSupplier(omsSupplier);
    }

    /**
     * 修改供应商管理
     *
     * @param omsSupplier 供应商管理
     * @return 结果
     */
    @Override
    public int updateOmsSupplier(OmsSupplier omsSupplier)
    {
        omsSupplier.setUpdateTime(DateUtils.getNowDate());
        return omsSupplierMapper.updateOmsSupplier(omsSupplier);
    }

    /**
     * 批量删除供应商管理
     *
     * @param ids 需要删除的供应商管理ID
     * @return 结果
     */
    @Override
    public int deleteOmsSupplierByIds(Long[] ids)
    {
        return omsSupplierMapper.deleteOmsSupplierByIds(ids);
    }

    /**
     * 删除供应商管理信息
     *
     * @param id 供应商管理ID
     * @return 结果
     */
    @Override
    public int deleteOmsSupplierById(Long id)
    {
        return omsSupplierMapper.deleteOmsSupplierById(id);
    }

    @Override
    public List<OmsSupplierExportVO> selectSupplierExport(OmsSupplier omsSupplier) {
        return omsSupplierMapper.selectSupplierExportVO(omsSupplier);
    }

    @Override
    public List<OmsSupplier> selectOmsSupplierByStatus(OmsSupplier omsSupplier) {
        return omsSupplierMapper.selectOmsSupplierByStatus(omsSupplier);
    }
}
