package com.ruoyi.financeBudget.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.financeBudget.mapper.FinanceBudgetMapper;
import com.ruoyi.financeBudget.domain.FinanceBudget;
import com.ruoyi.financeBudget.service.IFinanceBudgetService;

/**
 * 财务预算Service业务层处理
 * 
 * @author yanxun
 * @date 2023-08-10
 */
@Service
public class FinanceBudgetServiceImpl implements IFinanceBudgetService 
{
    @Autowired
    private FinanceBudgetMapper financeBudgetMapper;

    /**
     * 查询财务预算
     * 
     * @param id 财务预算主键
     * @return 财务预算
     */
    @Override
    public FinanceBudget selectFinanceBudgetById(Long id)
    {
        return financeBudgetMapper.selectFinanceBudgetById(id);
    }

    /**
     * 查询财务预算列表
     * 
     * @param financeBudget 财务预算
     * @return 财务预算
     */
    @Override
    public List<FinanceBudget> selectFinanceBudgetList(FinanceBudget financeBudget)
    {
        return financeBudgetMapper.selectFinanceBudgetList(financeBudget);
    }

    /**
     * 新增财务预算
     * 
     * @param financeBudget 财务预算
     * @return 结果
     */
    @Override
    public int insertFinanceBudget(FinanceBudget financeBudget)
    {
        return financeBudgetMapper.insertFinanceBudget(financeBudget);
    }

    /**
     * 修改财务预算
     * 
     * @param financeBudget 财务预算
     * @return 结果
     */
    @Override
    public int updateFinanceBudget(FinanceBudget financeBudget)
    {
        return financeBudgetMapper.updateFinanceBudget(financeBudget);
    }

    /**
     * 批量删除财务预算
     * 
     * @param ids 需要删除的财务预算主键
     * @return 结果
     */
    @Override
    public int deleteFinanceBudgetByIds(Long[] ids)
    {
        return financeBudgetMapper.deleteFinanceBudgetByIds(ids);
    }

    /**
     * 删除财务预算信息
     * 
     * @param id 财务预算主键
     * @return 结果
     */
    @Override
    public int deleteFinanceBudgetById(Long id)
    {
        return financeBudgetMapper.deleteFinanceBudgetById(id);
    }

    /**
     * 根据科研任务号查询任务的预估价
     *
     * @param taskno 科研任务号
     * @return 结果
     */
    @Override
    public FinanceBudget selectEstimationCoatByTaskno(String taskno) {
        return financeBudgetMapper.selectEstimationCoatByTaskno(taskno);
    }
}
