package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.EmsSubsystem;
import com.ruoyi.ems.mapper.EmsSubsystemMapper;
import com.ruoyi.ems.service.IEmsSubsystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 能源子系统Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-16
 */
@Service
public class EmsSubsystemServiceImpl implements IEmsSubsystemService {
    @Autowired
    private EmsSubsystemMapper emsSubsystemMapper;

    /**
     * 查询能源子系统
     *
     * @param id 能源子系统主键
     * @return 能源子系统
     */
    @Override
    public EmsSubsystem selectEmsSubsystemById(Long id) {
        return emsSubsystemMapper.selectEmsSubsystemById(id);
    }

    @Override
    public EmsSubsystem selectEmsSubsystemByCode(String systemCode) {
        return emsSubsystemMapper.selectEmsSubsystemByCode(systemCode);
    }

    /**
     * 查询能源子系统列表
     *
     * @param emsSubsystem 能源子系统
     * @return 能源子系统
     */
    @Override
    public List<EmsSubsystem> selectEmsSubsystemList(EmsSubsystem emsSubsystem) {
        return emsSubsystemMapper.selectEmsSubsystemList(emsSubsystem);
    }

    /**
     * 新增能源子系统
     *
     * @param emsSubsystem 能源子系统
     * @return 结果
     */
    @Override
    public int insertEmsSubsystem(EmsSubsystem emsSubsystem) {
        return emsSubsystemMapper.insertEmsSubsystem(emsSubsystem);
    }

    /**
     * 修改能源子系统
     *
     * @param emsSubsystem 能源子系统
     * @return 结果
     */
    @Override
    public int updateEmsSubsystem(EmsSubsystem emsSubsystem) {
        return emsSubsystemMapper.updateEmsSubsystem(emsSubsystem);
    }

    /**
     * 批量删除能源子系统
     *
     * @param ids 需要删除的能源子系统主键
     * @return 结果
     */
    @Override
    public int deleteEmsSubsystemByIds(Long[] ids) {
        return emsSubsystemMapper.deleteEmsSubsystemByIds(ids);
    }

    /**
     * 删除能源子系统信息
     *
     * @param id 能源子系统主键
     * @return 结果
     */
    @Override
    public int deleteEmsSubsystemById(Long id) {
        return emsSubsystemMapper.deleteEmsSubsystemById(id);
    }
}
