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

/**
 * 项目投产Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-08
 */
@Service
public class BmProjectProductServiceImpl implements IBmProjectProductService
{
    @Autowired
    private BmProjectProductMapper bmProjectProductMapper;

    /**
     * 查询项目投产
     * 
     * @param id 项目投产ID
     * @return 项目投产
     */
    @Override
    public BmProjectProduct selectBmProjectProductById(Long id)
    {
        return bmProjectProductMapper.selectBmProjectProductById(id);
    }

    /**
     * 查询项目投产列表
     * 
     * @param bmProjectProduct 项目投产
     * @return 项目投产
     */
    @Override
    public List<BmProjectProduct> selectBmProjectProductList(BmProjectProduct bmProjectProduct)
    {
        return bmProjectProductMapper.selectBmProjectProductList(bmProjectProduct);
    }

    /**
     * 新增项目投产
     * 
     * @param bmProjectProduct 项目投产
     * @return 结果
     */
    @Override
    public int insertBmProjectProduct(BmProjectProduct bmProjectProduct)
    {
        bmProjectProduct.setCreateTime(DateUtils.getNowDate());
        bmProjectProduct.setCreateBy(SecurityUtils.getUsername());
        return bmProjectProductMapper.insertBmProjectProduct(bmProjectProduct);
    }

    /**
     * 修改项目投产
     * 
     * @param bmProjectProduct 项目投产
     * @return 结果
     */
    @Override
    public int updateBmProjectProduct(BmProjectProduct bmProjectProduct)
    {
        bmProjectProduct.setUpdateTime(DateUtils.getNowDate());
        bmProjectProduct.setUpdateBy(SecurityUtils.getUsername());
        return bmProjectProductMapper.updateBmProjectProduct(bmProjectProduct);
    }

    /**
     * 批量删除项目投产
     * 
     * @param ids 需要删除的项目投产ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectProductByIds(Long[] ids)
    {
        return bmProjectProductMapper.deleteBmProjectProductByIds(ids);
    }

    /**
     * 删除项目投产信息
     * 
     * @param id 项目投产ID
     * @return 结果
     */
    @Override
    public int deleteBmProjectProductById(Long id)
    {
        return bmProjectProductMapper.deleteBmProjectProductById(id);
    }
}
