package com.ruoyi.projectChbWxf.service.impl;

import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.projectChbWxf.mapper.KzksProjectChbWxfMapper;
import com.ruoyi.projectChbWxf.domain.KzksProjectChbWxf;
import com.ruoyi.projectChbWxf.service.IKzksProjectChbWxfService;

/**
 * 外协费Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-10
 */
@Service
public class KzksProjectChbWxfServiceImpl implements IKzksProjectChbWxfService 
{
    @Autowired
    private KzksProjectChbWxfMapper kzksProjectChbWxfMapper;

    /**
     * 查询外协费
     * 
     * @param id 外协费主键
     * @return 外协费
     */
    @Override
    public KzksProjectChbWxf selectKzksProjectChbWxfById(String id)
    {
        return kzksProjectChbWxfMapper.selectKzksProjectChbWxfById(id);
    }

    /**
     * 查询外协费列表
     * 
     * @param kzksProjectChbWxf 外协费
     * @return 外协费
     */
    @Override
    public List<KzksProjectChbWxf> selectKzksProjectChbWxfList(KzksProjectChbWxf kzksProjectChbWxf)
    {
        return kzksProjectChbWxfMapper.selectKzksProjectChbWxfList(kzksProjectChbWxf);
    }

    /**
     * 新增外协费
     * 
     * @param kzksProjectChbWxf 外协费
     * @return 结果
     */
    @Override
    public int insertKzksProjectChbWxf(KzksProjectChbWxf kzksProjectChbWxf)
    {
        kzksProjectChbWxf.setCreateTime(DateUtils.getNowDate());
        return kzksProjectChbWxfMapper.insertKzksProjectChbWxf(kzksProjectChbWxf);
    }

    /**
     * 修改外协费
     * 
     * @param kzksProjectChbWxf 外协费
     * @return 结果
     */
    @Override
    public int updateKzksProjectChbWxf(KzksProjectChbWxf kzksProjectChbWxf)
    {
        kzksProjectChbWxf.setUpdateTime(DateUtils.getNowDate());
        return kzksProjectChbWxfMapper.updateKzksProjectChbWxf(kzksProjectChbWxf);
    }

    /**
     * 批量删除外协费
     * 
     * @param ids 需要删除的外协费主键
     * @return 结果
     */
    @Override
    public int deleteKzksProjectChbWxfByIds(String[] ids)
    {
        return kzksProjectChbWxfMapper.deleteKzksProjectChbWxfByIds(ids);
    }

    /**
     * 删除外协费信息
     * 
     * @param id 外协费主键
     * @return 结果
     */
    @Override
    public int deleteKzksProjectChbWxfById(String id)
    {
        return kzksProjectChbWxfMapper.deleteKzksProjectChbWxfById(id);
    }

    /**
     * 根据科研任务号获取外协费总和
     *
     * @param taskno 任务号
     * @return 结果
     */
    @Override
    public BigDecimal selectWxfByTaskno(String taskno) {
        return kzksProjectChbWxfMapper.selectWxfByTaskno(taskno);
    }
}
