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.BmProjectPersion;
import com.ruoyi.system.mapper.project.BmProjectPersionMapper;
import com.ruoyi.system.service.project.IBmProjectPersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 项目投资方-自然人Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-04
 */
@Service
public class BmProjectPersionServiceImpl implements IBmProjectPersionService
{
    @Autowired
    private BmProjectPersionMapper bmProjectPersionMapper;

    /**
     * 查询项目投资方-自然人
     * 
     * @param id 项目投资方-自然人ID
     * @return 项目投资方-自然人
     */
    @Override
    public BmProjectPersion selectBmProjectPersionById(Long id)
    {
        return bmProjectPersionMapper.selectBmProjectPersionById(id);
    }

    /**
     * 查询项目投资方-自然人列表
     * 
     * @param bmProjectPersion 项目投资方-自然人
     * @return 项目投资方-自然人
     */
    @Override
    public List<BmProjectPersion> selectBmProjectPersionList(BmProjectPersion bmProjectPersion)
    {
        return bmProjectPersionMapper.selectBmProjectPersionList(bmProjectPersion);
    }

    /**
     * 新增项目投资方-自然人
     * 
     * @param bmProjectPersion 项目投资方-自然人
     * @return 结果
     */
    @Override
    public int insertBmProjectPersion(BmProjectPersion bmProjectPersion)
    {
        bmProjectPersion.setCreateTime(DateUtils.getNowDate());
        bmProjectPersion.setCreateBy(SecurityUtils.getUsername());
        return bmProjectPersionMapper.insertBmProjectPersion(bmProjectPersion);
    }

    /**
     * 修改项目投资方-自然人
     * 
     * @param bmProjectPersion 项目投资方-自然人
     * @return 结果
     */
    @Override
    public int updateBmProjectPersion(BmProjectPersion bmProjectPersion)
    {
        bmProjectPersion.setUpdateTime(DateUtils.getNowDate());
        bmProjectPersion.setUpdateBy(SecurityUtils.getUsername());
        return bmProjectPersionMapper.updateBmProjectPersion(bmProjectPersion);
    }

    /**
     * 批量删除项目投资方-自然人
     * 
     * @param ids 需要删除的项目投资方-自然人ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectPersionByIds(Long[] ids)
    {
        return bmProjectPersionMapper.deleteBmProjectPersionByIds(ids);
    }

    /**
     * 删除项目投资方-自然人信息
     * 
     * @param id 项目投资方-自然人ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectPersionById(Long id)
    {
        return bmProjectPersionMapper.deleteBmProjectPersionById(id);
    }
}
