package com.ruoyi.ems.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.ems.domain.AdmEmsElecBoxIndex;
import com.ruoyi.ems.mapper.AdmEmsElecBoxIndexMapper;
import com.ruoyi.ems.service.IAdmEmsElecBoxIndexService;

/**
 * 动力箱指标Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-03
 */
@Service
public class AdmEmsElecBoxIndexServiceImpl implements IAdmEmsElecBoxIndexService {
    @Autowired
    private AdmEmsElecBoxIndexMapper admEmsElecBoxIndexMapper;

    /**
     * 查询动力箱指标
     *
     * @param id 动力箱指标主键
     * @return 动力箱指标
     */
    @Override
    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexById(Long id) {
        return admEmsElecBoxIndexMapper.selectAdmEmsElecBoxIndexById(id);
    }

    @Override
    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexByBoxCode(String boxCode) {
        return admEmsElecBoxIndexMapper.selectElecBoxLatestIndexByBoxCode(boxCode);
    }

    /**
     * 查询动力箱指标列表
     *
     * @param admEmsElecBoxIndex 动力箱指标
     * @return 动力箱指标
     */
    @Override
    public List<AdmEmsElecBoxIndex> selectAdmEmsElecBoxIndexList(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
        return admEmsElecBoxIndexMapper.selectAdmEmsElecBoxIndexList(admEmsElecBoxIndex);
    }

    /**
     * 新增动力箱指标
     *
     * @param admEmsElecBoxIndex 动力箱指标
     * @return 结果
     */
    @Override
    public int insertAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
        return admEmsElecBoxIndexMapper.insertAdmEmsElecBoxIndex(admEmsElecBoxIndex);
    }

    /**
     * 修改动力箱指标
     *
     * @param admEmsElecBoxIndex 动力箱指标
     * @return 结果
     */
    @Override
    public int updateAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
        return admEmsElecBoxIndexMapper.updateAdmEmsElecBoxIndex(admEmsElecBoxIndex);
    }

    /**
     * 批量删除动力箱指标
     *
     * @param ids 需要删除的动力箱指标主键
     * @return 结果
     */
    @Override
    public int deleteAdmEmsElecBoxIndexByIds(Long[] ids) {
        return admEmsElecBoxIndexMapper.deleteAdmEmsElecBoxIndexByIds(ids);
    }

    /**
     * 删除动力箱指标信息
     *
     * @param id 动力箱指标主键
     * @return 结果
     */
    @Override
    public int deleteAdmEmsElecBoxIndexById(Long id) {
        return admEmsElecBoxIndexMapper.deleteAdmEmsElecBoxIndexById(id);
    }
}
