package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.EmsObjAbility;
import com.ruoyi.ems.mapper.EmsObjAbilityMapper;
import com.ruoyi.ems.service.IEmsObjAbilityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 能源对象能力Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-23
 */
@Service
public class EmsObjAbilityServiceImpl implements IEmsObjAbilityService {
    @Autowired
    private EmsObjAbilityMapper objAbilityMapper;

    /**
     * 查询能源对象能力
     *
     * @param id 能源对象能力主键
     * @return 能源对象能力
     */
    @Override
    public EmsObjAbility selectObjAbilityById(Long id) {
        return objAbilityMapper.selectObjAbilityById(id);
    }

    /**
     * 查询能源对象能力列表
     *
     * @param objAbility 能源对象能力
     * @return 能源对象能力
     */
    @Override
    public List<EmsObjAbility> selectObjAbilityList(EmsObjAbility objAbility) {
        return objAbilityMapper.selectObjAbilityList(objAbility);
    }

    @Override
    public List<EmsObjAbility> selectByModelCode(String modelCode) {
        return objAbilityMapper.selectByModelCode(modelCode);
    }

    /**
     * 新增能源对象能力
     *
     * @param objAbility 能源对象能力
     * @return 结果
     */
    @Override
    public int insertObjAbility(EmsObjAbility objAbility) {
        return objAbilityMapper.insertObjAbility(objAbility);
    }

    @Override
    public int insertBatch(List<EmsObjAbility> list) {
        return objAbilityMapper.insertBatch(list);
    }

    /**
     * 修改能源对象能力
     *
     * @param objAbility 能源对象能力
     * @return 结果
     */
    @Override
    public int updateObjAbility(EmsObjAbility objAbility) {
        return objAbilityMapper.updateObjAbility(objAbility);
    }

    /**
     * 批量删除能源对象能力
     *
     * @param ids 需要删除的能源对象能力主键
     * @return 结果
     */
    @Override
    public int deleteObjAbilityByIds(Long[] ids) {
        return objAbilityMapper.deleteObjAbilityByIds(ids);
    }

    /**
     * 删除能源对象能力信息
     *
     * @param id 能源对象能力主键
     * @return 结果
     */
    @Override
    public int deleteObjAbilityById(Long id) {
        return objAbilityMapper.deleteObjAbilityById(id);
    }

    @Override
    public int deleteByModelCode(String modelCode) {
        return objAbilityMapper.deleteByModelCode(modelCode);
    }
}
