package com.ruoyi.ems.base.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ems.base.mapper.EmsBaseCollectDeviceInfoMapper;
import com.ruoyi.ems.base.domain.EmsBaseCollectDeviceInfo;
import com.ruoyi.ems.base.service.IEmsBaseCollectDeviceInfoService;

/**
 * 采集设备信息Service业务层处理
 *
 * @author Yinq
 * @date 2024-05-20
 */
@Service
public class EmsBaseCollectDeviceInfoServiceImpl implements IEmsBaseCollectDeviceInfoService {
    @Autowired
    private EmsBaseCollectDeviceInfoMapper emsBaseCollectDeviceInfoMapper;

    /**
     * 查询采集设备信息
     *
     * @param objId 采集设备信息主键
     * @return 采集设备信息
     */
    @Override
    public EmsBaseCollectDeviceInfo selectEmsBaseCollectDeviceInfoByObjId(Long objId) {
        return emsBaseCollectDeviceInfoMapper.selectEmsBaseCollectDeviceInfoByObjId(objId);
    }

    /**
     * 查询采集设备信息列表
     *
     * @param emsBaseCollectDeviceInfo 采集设备信息
     * @return 采集设备信息
     */
    @Override
    public List<EmsBaseCollectDeviceInfo> selectEmsBaseCollectDeviceInfoList(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
        return emsBaseCollectDeviceInfoMapper.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo);
    }

    /**
     * 新增采集设备信息
     *
     * @param emsBaseCollectDeviceInfo 采集设备信息
     * @return 结果
     */
    @Override
    public int insertEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
        emsBaseCollectDeviceInfo.setCreateTime(DateUtils.getNowDate());
        return emsBaseCollectDeviceInfoMapper.insertEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo);
    }

    /**
     * 修改采集设备信息
     *
     * @param emsBaseCollectDeviceInfo 采集设备信息
     * @return 结果
     */
    @Override
    public int updateEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
        emsBaseCollectDeviceInfo.setUpdateTime(DateUtils.getNowDate());
        return emsBaseCollectDeviceInfoMapper.updateEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo);
    }

    /**
     * 批量删除采集设备信息
     *
     * @param objIds 需要删除的采集设备信息主键
     * @return 结果
     */
    @Override
    public int deleteEmsBaseCollectDeviceInfoByObjIds(Long[] objIds) {
        return emsBaseCollectDeviceInfoMapper.deleteEmsBaseCollectDeviceInfoByObjIds(objIds);
    }

    /**
     * 删除采集设备信息信息
     *
     * @param objId 采集设备信息主键
     * @return 结果
     */
    @Override
    public int deleteEmsBaseCollectDeviceInfoByObjId(Long objId) {
        return emsBaseCollectDeviceInfoMapper.deleteEmsBaseCollectDeviceInfoByObjId(objId);
    }
}
