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


/**
 * 项目施工进度Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-08
 */
@Service
public class BmConstructionRateServiceImpl implements IBmConstructionRateService
{
    @Autowired
    private BmConstructionRateMapper bmConstructionRateMapper;

    /**
     * 查询项目施工进度
     * 
     * @param id 项目施工进度ID
     * @return 项目施工进度
     */
    @Override
    public BmConstructionRate selectBmConstructionRateById(Long id)
    {
        return bmConstructionRateMapper.selectBmConstructionRateById(id);
    }

    /**
     * 查询项目施工进度列表
     * 
     * @param bmConstructionRate 项目施工进度
     * @return 项目施工进度
     */
    @Override
    public List<BmConstructionRate> selectBmConstructionRateList(BmConstructionRate bmConstructionRate)
    {
        return bmConstructionRateMapper.selectBmConstructionRateList(bmConstructionRate);
    }

    /**
     * 新增项目施工进度
     * 
     * @param bmConstructionRate 项目施工进度
     * @return 结果
     */
    @Override
    public int insertBmConstructionRate(BmConstructionRate bmConstructionRate)
    {
        bmConstructionRate.setCreateTime(DateUtils.getNowDate());
        bmConstructionRate.setCreateBy(SecurityUtils.getUsername());
        return bmConstructionRateMapper.insertBmConstructionRate(bmConstructionRate);
    }

    /**
     * 修改项目施工进度
     * 
     * @param bmConstructionRate 项目施工进度
     * @return 结果
     */
    @Override
    public int updateBmConstructionRate(BmConstructionRate bmConstructionRate)
    {
        bmConstructionRate.setUpdateTime(DateUtils.getNowDate());
        bmConstructionRate.setUpdateBy(SecurityUtils.getUsername());
        return bmConstructionRateMapper.updateBmConstructionRate(bmConstructionRate);
    }

    /**
     * 批量删除项目施工进度
     * 
     * @param ids 需要删除的项目施工进度ID
     * @return 结果
     */
    @Override
    public int deleteBmConstructionRateByIds(Long[] ids)
    {
        return bmConstructionRateMapper.deleteBmConstructionRateByIds(ids);
    }

    /**
     * 删除项目施工进度信息
     * 
     * @param id 项目施工进度ID
     * @return 结果
     */
    @Override
    public int deleteBmConstructionRateById(Long id)
    {
        return bmConstructionRateMapper.deleteBmConstructionRateById(id);
    }
}
