package com.yanzhu.jh.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.jh.project.mapper.SurProjectInvestMapper;
import com.yanzhu.jh.project.domain.SurProjectInvest;
import com.yanzhu.jh.project.service.ISurProjectInvestService;

/**
 * 项目投资Service业务层处理
 * 
 * @author JiangYuQi
 * @date 2023-07-29
 */
@Service
public class SurProjectInvestServiceImpl implements ISurProjectInvestService 
{
    @Autowired
    private SurProjectInvestMapper surProjectInvestMapper;

    /**
     * 查询项目投资
     * 
     * @param id 项目投资主键
     * @return 项目投资
     */
    @Override
    public SurProjectInvest selectSurProjectInvestById(Long id)
    {
        return surProjectInvestMapper.selectSurProjectInvestById(id);
    }

    /**
     * 查询项目投资列表
     * 
     * @param surProjectInvest 项目投资
     * @return 项目投资
     */
    @Override
    public List<SurProjectInvest> selectSurProjectInvestList(SurProjectInvest surProjectInvest)
    {
        return surProjectInvestMapper.selectSurProjectInvestList(surProjectInvest);
    }

    /**
     * 新增项目投资
     * 
     * @param surProjectInvest 项目投资
     * @return 结果
     */
    @Override
    public int insertSurProjectInvest(SurProjectInvest surProjectInvest)
    {
        surProjectInvest.setCreateTime(DateUtils.getNowDate());
        surProjectInvest.setIsDel(0l);
        return surProjectInvestMapper.insertSurProjectInvest(surProjectInvest);
    }

    /**
     * 修改项目投资
     * 
     * @param surProjectInvest 项目投资
     * @return 结果
     */
    @Override
    public int updateSurProjectInvest(SurProjectInvest surProjectInvest)
    {
        surProjectInvest.setUpdateTime(DateUtils.getNowDate());
        return surProjectInvestMapper.updateSurProjectInvest(surProjectInvest);
    }

    /**
     * 批量删除项目投资
     * 
     * @param ids 需要删除的项目投资主键
     * @return 结果
     */
    @Override
    public int deleteSurProjectInvestByIds(Long[] ids)
    {
        return surProjectInvestMapper.deleteSurProjectInvestByIds(ids);
    }

    /**
     * 删除项目投资信息
     * 
     * @param id 项目投资主键
     * @return 结果
     */
    @Override
    public int deleteSurProjectInvestById(Long id)
    {
        return surProjectInvestMapper.deleteSurProjectInvestById(id);
    }
}
