package com.fs.company.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.company.vo.CompanyDeductExportVO;
import com.fs.company.vo.CompanyDeductVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.company.mapper.CompanyDeductMapper;
import com.fs.company.domain.CompanyDeduct;
import com.fs.company.service.ICompanyDeductService;

/**
 * 扣款Service业务层处理
 *
 * @author fs
 * @date 2023-02-27
 */
@Service
public class CompanyDeductServiceImpl implements ICompanyDeductService
{
    @Autowired
    private CompanyDeductMapper companyDeductMapper;

    /**
     * 查询扣款
     *
     * @param deductId 扣款ID
     * @return 扣款
     */
    @Override
    public CompanyDeduct selectCompanyDeductById(Long deductId)
    {
        return companyDeductMapper.selectCompanyDeductById(deductId);
    }

    /**
     * 查询扣款列表
     *
     * @param companyDeduct 扣款
     * @return 扣款
     */
    @Override
    public List<CompanyDeduct> selectCompanyDeductList(CompanyDeduct companyDeduct)
    {
        return companyDeductMapper.selectCompanyDeductList(companyDeduct);
    }

    /**
     * 新增扣款
     *
     * @param companyDeduct 扣款
     * @return 结果
     */
    @Override
    public int insertCompanyDeduct(CompanyDeduct companyDeduct)
    {
        companyDeduct.setCreateTime(DateUtils.getNowDate());
        return companyDeductMapper.insertCompanyDeduct(companyDeduct);
    }

    /**
     * 修改扣款
     *
     * @param companyDeduct 扣款
     * @return 结果
     */
    @Override
    public int updateCompanyDeduct(CompanyDeduct companyDeduct)
    {
        return companyDeductMapper.updateCompanyDeduct(companyDeduct);
    }

    /**
     * 批量删除扣款
     *
     * @param deductIds 需要删除的扣款ID
     * @return 结果
     */
    @Override
    public int deleteCompanyDeductByIds(Long[] deductIds)
    {
        return companyDeductMapper.deleteCompanyDeductByIds(deductIds);
    }

    /**
     * 删除扣款信息
     *
     * @param deductId 扣款ID
     * @return 结果
     */
    @Override
    public int deleteCompanyDeductById(Long deductId)
    {
        return companyDeductMapper.deleteCompanyDeductById(deductId);
    }

    @Override
    public List<CompanyDeductVO> selectCompanyDeductVOList(CompanyDeduct companyDeduct) {
        return companyDeductMapper.selectCompanyDeductVOList(companyDeduct);
    }

    @Override
    public List<CompanyDeductExportVO> selectCompanyExportDeductList(CompanyDeduct companyDeduct) {
        return companyDeductMapper.selectCompanyExportDeductList(companyDeduct);
    }

    @Override
    public List<CompanyDeductVO> selectCompanyDeductListVO(CompanyDeductVO companyDeduct) {
        return companyDeductMapper.selectCompanyDeductListVO(companyDeduct);
    }
}
