package com.ruoyi.ems.service.impl;

import java.util.List;

import com.ruoyi.ems.domain.EmsFacsSubtype;
import com.ruoyi.ems.mapper.EmsFacsSubtypeMapper;
import com.ruoyi.ems.service.IEmsFacsSubtypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 能源设施/系统子类Service业务层处理
 *
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class EmsFacsSubtypeServiceImpl implements IEmsFacsSubtypeService {
    @Autowired
    private EmsFacsSubtypeMapper emsFacsSubtypeMapper;

    /**
     * 查询能源设施/系统子类
     *
     * @param id 能源设施/系统子类主键
     * @return 能源设施/系统子类
     */
    @Override
    public EmsFacsSubtype selectFacsSubtypeById(Long id) {
        return emsFacsSubtypeMapper.selectFacsSubtypeById(id);
    }

    /**
     * 查询能源设施/系统子类列表
     *
     * @param emsFacsSubtype 能源设施/系统子类
     * @return 能源设施/系统子类
     */
    @Override
    public List<EmsFacsSubtype> selectFacsSubtypeList(EmsFacsSubtype emsFacsSubtype) {
        return emsFacsSubtypeMapper.selectFacsSubtypeList(emsFacsSubtype);
    }

    /**
     * 新增能源设施/系统子类
     *
     * @param emsFacsSubtype 能源设施/系统子类
     * @return 结果
     */
    @Override
    public int insertFacsSubtype(EmsFacsSubtype emsFacsSubtype) {
        return emsFacsSubtypeMapper.insertFacsSubtype(emsFacsSubtype);
    }

    @Override
    public void insertFacsSubtypeBatch(List<EmsFacsSubtype> emsFacsSubtypes) {
        emsFacsSubtypeMapper.insertFacsSubtypeBatch(emsFacsSubtypes);
    }

    /**
     * 修改能源设施/系统子类
     *
     * @param emsFacsSubtype 能源设施/系统子类
     * @return 结果
     */
    @Override
    public int updateFacsSubtype(EmsFacsSubtype emsFacsSubtype) {
        return emsFacsSubtypeMapper.updateFacsSubtype(emsFacsSubtype);
    }

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

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

    @Override
    public int deleteFacsSubtypeByParentCode(String code) {
        return emsFacsSubtypeMapper.deleteFacsSubtypeByParentCode(code);
    }
}
