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


/**
 * 项目引荐Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-04
 */
@Service
public class BmProjectReferralServiceImpl implements IBmProjectReferralService
{
    @Autowired
    private BmProjectReferralMapper bmProjectReferralMapper;

    /**
     * 查询项目引荐
     * 
     * @param id 项目引荐ID
     * @return 项目引荐
     */
    @Override
    public BmProjectReferral selectBmProjectReferralById(Long id)
    {
        return bmProjectReferralMapper.selectBmProjectReferralById(id);
    }

    /**
     * 查询项目引荐列表
     * 
     * @param bmProjectReferral 项目引荐
     * @return 项目引荐
     */
    @Override
    public List<BmProjectReferral> selectBmProjectReferralList(BmProjectReferral bmProjectReferral)
    {
        return bmProjectReferralMapper.selectBmProjectReferralList(bmProjectReferral);
    }

    /**
     * 新增项目引荐
     * 
     * @param bmProjectReferral 项目引荐
     * @return 结果
     */
    @Override
    public int insertBmProjectReferral(BmProjectReferral bmProjectReferral)
    {
        bmProjectReferral.setCreateTime(DateUtils.getNowDate());
        bmProjectReferral.setCreateBy(SecurityUtils.getUsername());
        return bmProjectReferralMapper.insertBmProjectReferral(bmProjectReferral);
    }

    /**
     * 修改项目引荐
     * 
     * @param bmProjectReferral 项目引荐
     * @return 结果
     */
    @Override
    public int updateBmProjectReferral(BmProjectReferral bmProjectReferral)
    {
        bmProjectReferral.setUpdateTime(DateUtils.getNowDate());
        bmProjectReferral.setUpdateBy(SecurityUtils.getUsername());
        return bmProjectReferralMapper.updateBmProjectReferral(bmProjectReferral);
    }

    /**
     * 批量删除项目引荐
     * 
     * @param ids 需要删除的项目引荐ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectReferralByIds(Long[] ids)
    {
        return bmProjectReferralMapper.deleteBmProjectReferralByIds(ids);
    }

    /**
     * 删除项目引荐信息
     * 
     * @param id 项目引荐ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectReferralById(Long id)
    {
        return bmProjectReferralMapper.deleteBmProjectReferralById(id);
    }
}
