package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.EmsObjEvent;
import com.ruoyi.ems.mapper.EmsObjEventMapper;
import com.ruoyi.ems.service.IEmsObjEventService;
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 EmsObjEventServiceImpl implements IEmsObjEventService {
    @Autowired
    private EmsObjEventMapper objEventMapper;

    /**
     * 查询能源对象事件
     *
     * @param id 能源对象事件主键
     * @return 能源对象事件
     */
    @Override
    public EmsObjEvent selectObjEventById(Long id) {
        return objEventMapper.selectObjEventById(id);
    }

    /**
     * 查询能源对象事件列表
     *
     * @param admEmsObjEvent 能源对象事件
     * @return 能源对象事件
     */
    @Override
    public List<EmsObjEvent> selectObjEventList(EmsObjEvent admEmsObjEvent) {
        return objEventMapper.selectObjEventList(admEmsObjEvent);
    }

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

    /**
     * 新增能源对象事件
     *
     * @param admEmsObjEvent 能源对象事件
     * @return 结果
     */
    @Override
    public int insertObjEvent(EmsObjEvent admEmsObjEvent) {
        return objEventMapper.insertObjEvent(admEmsObjEvent);
    }

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

    /**
     * 修改能源对象事件
     *
     * @param admEmsObjEvent 能源对象事件
     * @return 结果
     */
    @Override
    public int updateObjEvent(EmsObjEvent admEmsObjEvent) {
        return objEventMapper.updateObjEvent(admEmsObjEvent);
    }

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

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