package com.ruoyi.system.service.impl.project;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.project.BmProjectInvestor;
import com.ruoyi.system.mapper.project.BmProjectInvestorMapper;
import com.ruoyi.system.service.project.IBmProjectInvestorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 项目投资方-企业Service业务层处理
 *
 * @author ruoyi
 * @date 2021-03-04
 */
@Service
public class BmProjectInvestorServiceImpl implements IBmProjectInvestorService
{
    @Autowired
    private BmProjectInvestorMapper bmProjectInvestorMapper;

    /**
     * 查询项目投资方-企业
     *
     * @param id 项目投资方-企业ID
     * @return 项目投资方-企业
     */
    @Override
    public BmProjectInvestor selectBmProjectInvestorById(Long id)
    {
        return bmProjectInvestorMapper.selectBmProjectInvestorById(id);
    }

    /**
     * 查询项目投资方-企业列表
     *
     * @param bmProjectInvestor 项目投资方-企业
     * @return 项目投资方-企业
     */
    @Override
    public List<BmProjectInvestor> selectBmProjectInvestorList(BmProjectInvestor bmProjectInvestor)
    {
        return bmProjectInvestorMapper.selectBmProjectInvestorList(bmProjectInvestor);
    }

    /**
     * 新增项目投资方-企业
     *
     * @param bmProjectInvestor 项目投资方-企业
     * @return 结果
     */
    @Override
    public int insertBmProjectInvestor(BmProjectInvestor bmProjectInvestor)
    {
        bmProjectInvestor.setCreateTime(DateUtils.getNowDate());
        bmProjectInvestor.setCreateBy(SecurityUtils.getUsername());
        return bmProjectInvestorMapper.insertBmProjectInvestor(bmProjectInvestor);
    }

    /**
     * 修改项目投资方-企业
     *
     * @param bmProjectInvestor 项目投资方-企业
     * @return 结果
     */
    @Override
    public int updateBmProjectInvestor(BmProjectInvestor bmProjectInvestor)
    {
        bmProjectInvestor.setUpdateTime(DateUtils.getNowDate());
        bmProjectInvestor.setUpdateBy(SecurityUtils.getUsername());
        return bmProjectInvestorMapper.updateBmProjectInvestor(bmProjectInvestor);
    }

    /**
     * 批量删除项目投资方-企业
     *
     * @param ids 需要删除的项目投资方-企业ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectInvestorByIds(Long[] ids)
    {
        return bmProjectInvestorMapper.deleteBmProjectInvestorByIds(ids);
    }

    /**
     * 删除项目投资方-企业信息
     *
     * @param id 项目投资方-企业ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectInvestorById(Long id)
    {
        return bmProjectInvestorMapper.deleteBmProjectInvestorById(id);
    }
}
