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

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.project.BmProjectReport;
import com.ruoyi.system.mapper.project.BmProjectReportMapper;
import com.ruoyi.system.service.project.IBmProjectReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 项目上报Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-05-31
 */
@Service
public class BmProjectReportServiceImpl implements IBmProjectReportService
{
    @Autowired
    private BmProjectReportMapper bmProjectReportMapper;

    /**
     * 查询项目上报
     * 
     * @param id 项目上报ID
     * @return 项目上报
     */
    @Override
    public BmProjectReport selectBmProjectReportById(Long id)
    {
        return bmProjectReportMapper.selectBmProjectReportById(id);
    }

    /**
     * 查询项目上报列表
     * 
     * @param bmProjectReport 项目上报
     * @return 项目上报
     */
    @Override
    @DataScope(deptAlias = "d")
    public List<BmProjectReport> selectBmProjectReportList(BmProjectReport bmProjectReport)
    {
        return bmProjectReportMapper.selectBmProjectReportList(bmProjectReport);
    }

    /**
     * 新增项目上报
     * 
     * @param bmProjectReport 项目上报
     * @return 结果
     */
    @Override
    public int insertBmProjectReport(BmProjectReport bmProjectReport)
    {
        bmProjectReport.setCreateTime(DateUtils.getNowDate());
        return bmProjectReportMapper.insertBmProjectReport(bmProjectReport);
    }

    /**
     * 修改项目上报
     * 
     * @param bmProjectReport 项目上报
     * @return 结果
     */
    @Override
    public int updateBmProjectReport(BmProjectReport bmProjectReport)
    {
        bmProjectReport.setUpdateTime(DateUtils.getNowDate());
        return bmProjectReportMapper.updateBmProjectReport(bmProjectReport);
    }

    /**
     * 批量删除项目上报
     * 
     * @param ids 需要删除的项目上报ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectReportByIds(Long[] ids)
    {
        return bmProjectReportMapper.deleteBmProjectReportByIds(ids);
    }

    /**
     * 删除项目上报信息
     * 
     * @param id 项目上报ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectReportById(Long id)
    {
        return bmProjectReportMapper.deleteBmProjectReportById(id);
    }
}
