package com.ruoyi.ems.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.ems.domain.EmsFacsFlowRel;
import com.ruoyi.ems.mapper.EmsFacsFlowRelMapper;
import com.ruoyi.ems.service.IEmsFacsFlowRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 能源设施能流关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class EmsFacsFlowRelServiceImpl implements IEmsFacsFlowRelService
{
    @Autowired
    private EmsFacsFlowRelMapper emsFacsFlowRelMapper;

    /**
     * 查询能源设施能流关系
     * 
     * @param id 能源设施能流关系主键
     * @return 能源设施能流关系
     */
    @Override
    public EmsFacsFlowRel selectEmsFacsFlowRelById(Long id)
    {
        return emsFacsFlowRelMapper.selectEmsFacsFlowRelById(id);
    }

    /**
     * 查询能源设施能流关系列表
     * 
     * @param emsFacsFlowRel 能源设施能流关系
     * @return 能源设施能流关系
     */
    @Override
    public List<EmsFacsFlowRel> selectEmsFacsFlowRelList(EmsFacsFlowRel emsFacsFlowRel)
    {
        return emsFacsFlowRelMapper.selectEmsFacsFlowRelList(emsFacsFlowRel);
    }

    /**
     * 新增能源设施能流关系
     * 
     * @param emsFacsFlowRel 能源设施能流关系
     * @return 结果
     */
    @Override
    public int insertEmsFacsFlowRel(EmsFacsFlowRel emsFacsFlowRel)
    {
        emsFacsFlowRel.setCreateTime(DateUtils.getNowDate());
        return emsFacsFlowRelMapper.insertEmsFacsFlowRel(emsFacsFlowRel);
    }

    /**
     * 修改能源设施能流关系
     * 
     * @param emsFacsFlowRel 能源设施能流关系
     * @return 结果
     */
    @Override
    public int updateEmsFacsFlowRel(EmsFacsFlowRel emsFacsFlowRel)
    {
        emsFacsFlowRel.setUpdateTime(DateUtils.getNowDate());
        return emsFacsFlowRelMapper.updateEmsFacsFlowRel(emsFacsFlowRel);
    }

    /**
     * 批量删除能源设施能流关系
     * 
     * @param ids 需要删除的能源设施能流关系主键
     * @return 结果
     */
    @Override
    public int deleteEmsFacsFlowRelByIds(Long[] ids)
    {
        return emsFacsFlowRelMapper.deleteEmsFacsFlowRelByIds(ids);
    }

    /**
     * 删除能源设施能流关系信息
     * 
     * @param id 能源设施能流关系主键
     * @return 结果
     */
    @Override
    public int deleteEmsFacsFlowRelById(Long id)
    {
        return emsFacsFlowRelMapper.deleteEmsFacsFlowRelById(id);
    }
}
