package com.fs.company.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.company.mapper.CompanySalesPlanMapper;
import com.fs.company.domain.CompanySalesPlan;
import com.fs.company.service.ICompanySalesPlanService;

/**
 * 销售计划Service业务层处理
 * 
 * @author fs
 * @date 2025-07-01
 */
@Service
public class CompanySalesPlanServiceImpl implements ICompanySalesPlanService 
{
    @Autowired
    private CompanySalesPlanMapper companySalesPlanMapper;

    /**
     * 查询销售计划
     * 
     * @param id 销售计划主键
     * @return 销售计划
     */
    @Override
    public CompanySalesPlan selectCompanySalesPlanById(Long id)
    {
        return companySalesPlanMapper.selectCompanySalesPlanById(id);
    }

    /**
     * 查询销售计划列表
     * 
     * @param companySalesPlan 销售计划
     * @return 销售计划
     */
    @Override
    public List<CompanySalesPlan> selectCompanySalesPlanList(CompanySalesPlan companySalesPlan)
    {
        return companySalesPlanMapper.selectCompanySalesPlanList(companySalesPlan);
    }

    /**
     * 新增销售计划
     * 
     * @param companySalesPlan 销售计划
     * @return 结果
     */
    @Override
    public int insertCompanySalesPlan(CompanySalesPlan companySalesPlan)
    {
        companySalesPlan.setCreateTime(DateUtils.getNowDate());
        return companySalesPlanMapper.insertCompanySalesPlan(companySalesPlan);
    }

    /**
     * 修改销售计划
     * 
     * @param companySalesPlan 销售计划
     * @return 结果
     */
    @Override
    public int updateCompanySalesPlan(CompanySalesPlan companySalesPlan)
    {
        companySalesPlan.setUpdateTime(DateUtils.getNowDate());
        return companySalesPlanMapper.updateCompanySalesPlan(companySalesPlan);
    }

    /**
     * 批量删除销售计划
     * 
     * @param ids 需要删除的销售计划主键
     * @return 结果
     */
    @Override
    public int deleteCompanySalesPlanByIds(Long[] ids)
    {
        return companySalesPlanMapper.deleteCompanySalesPlanByIds(ids);
    }

    /**
     * 删除销售计划信息
     * 
     * @param id 销售计划主键
     * @return 结果
     */
    @Override
    public int deleteCompanySalesPlanById(Long id)
    {
        return companySalesPlanMapper.deleteCompanySalesPlanById(id);
    }
}
