package com.fs.company.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.company.domain.CompanyTcmConsume;
import com.fs.company.mapper.CompanyTcmConsumeMapper;
import com.fs.company.service.ICompanyTcmConsumeService;
import com.fs.company.vo.CompanyTcmConsumeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 公司档期汇总Service业务层处理
 *
 * @author fs
 * @date 2023-09-15
 */
@Service
public class CompanyTcmConsumeServiceImpl implements ICompanyTcmConsumeService
{
    @Autowired
    private CompanyTcmConsumeMapper companyTcmConsumeMapper;

    /**
     * 查询公司档期消费
     *
     * @param id 公司档期消费ID
     * @return 公司档期消费
     */
    @Override
    public CompanyTcmConsume selectCompanyTcmConsumeById(Long id)
    {
        return companyTcmConsumeMapper.selectCompanyTcmConsumeById(id);
    }

    /**
     * 查询公司档期消费列表
     *
     * @param companyTcmConsume 公司档期消费
     * @return 公司档期消费
     */
    @Override
    public List<CompanyTcmConsume> selectCompanyTcmConsumeList(CompanyTcmConsume companyTcmConsume)
    {
        return companyTcmConsumeMapper.selectCompanyTcmConsumeList(companyTcmConsume);
    }

    @Override
    public List<CompanyTcmConsumeVO> selectCompanyTcmConsumeListVO(CompanyTcmConsume companyTcmConsume) {
        return companyTcmConsumeMapper.selectCompanyTcmConsumeListVO(companyTcmConsume);
    }

    /**
     * 新增公司档期消费
     *
     * @param companyTcmConsume 公司档期消费
     * @return 结果
     */
    @Override
    public int insertCompanyTcmConsume(CompanyTcmConsume companyTcmConsume)
    {
        companyTcmConsume.setCreateTime(DateUtils.getNowDate());
        return companyTcmConsumeMapper.insertCompanyTcmConsume(companyTcmConsume);
    }

    /**
     * 修改公司档期消费
     *
     * @param companyTcmConsume 公司档期消费
     * @return 结果
     */
    @Override
    public int updateCompanyTcmConsume(CompanyTcmConsume companyTcmConsume)
    {
        companyTcmConsume.setUpdateTime(DateUtils.getNowDate());
        return companyTcmConsumeMapper.updateCompanyTcmConsume(companyTcmConsume);
    }

    /**
     * 批量删除公司档期消费
     *
     * @param ids 需要删除的公司档期消费ID
     * @return 结果
     */
    @Override
    public int deleteCompanyTcmConsumeByIds(Long[] ids)
    {
        return companyTcmConsumeMapper.deleteCompanyTcmConsumeByIds(ids);
    }

    /**
     * 删除公司档期消费信息
     *
     * @param id 公司档期消费ID
     * @return 结果
     */
    @Override
    public int deleteCompanyTcmConsumeById(Long id)
    {
        return companyTcmConsumeMapper.deleteCompanyTcmConsumeById(id);
    }

    @Override
    public CompanyTcmConsume selectCompanyTcmConsumeBySchedule(Long companyId, Long scheduleId) {
        return companyTcmConsumeMapper.selectCompanyTcmConsumeBySchedule(companyId, scheduleId);
    }
}
