package com.ruoyi.ems.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ems.mapper.AdmEmsDeviceRbookMapper;
import com.ruoyi.ems.domain.AdmEmsDeviceRbook;
import com.ruoyi.ems.service.IAdmEmsDeviceRbookService;

/**
 * 设备台账Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-26
 */
@Service
public class AdmEmsDeviceRbookServiceImpl implements IAdmEmsDeviceRbookService 
{
    @Autowired
    private AdmEmsDeviceRbookMapper admEmsDeviceRbookMapper;

    /**
     * 查询设备台账
     * 
     * @param id 设备台账主键
     * @return 设备台账
     */
    @Override
    public AdmEmsDeviceRbook selectAdmEmsDeviceRbookById(Long id)
    {
        return admEmsDeviceRbookMapper.selectAdmEmsDeviceRbookById(id);
    }

    /**
     * 查询设备台账列表
     * 
     * @param admEmsDeviceRbook 设备台账
     * @return 设备台账
     */
    @Override
    public List<AdmEmsDeviceRbook> selectAdmEmsDeviceRbookList(AdmEmsDeviceRbook admEmsDeviceRbook)
    {
        return admEmsDeviceRbookMapper.selectAdmEmsDeviceRbookList(admEmsDeviceRbook);
    }

    /**
     * 新增设备台账
     * 
     * @param admEmsDeviceRbook 设备台账
     * @return 结果
     */
    @Override
    public int insertAdmEmsDeviceRbook(AdmEmsDeviceRbook admEmsDeviceRbook)
    {
        admEmsDeviceRbook.setCreateTime(DateUtils.getNowDate());
        return admEmsDeviceRbookMapper.insertAdmEmsDeviceRbook(admEmsDeviceRbook);
    }

    /**
     * 修改设备台账
     * 
     * @param admEmsDeviceRbook 设备台账
     * @return 结果
     */
    @Override
    public int updateAdmEmsDeviceRbook(AdmEmsDeviceRbook admEmsDeviceRbook)
    {
        admEmsDeviceRbook.setUpdateTime(DateUtils.getNowDate());
        return admEmsDeviceRbookMapper.updateAdmEmsDeviceRbook(admEmsDeviceRbook);
    }

    /**
     * 批量删除设备台账
     * 
     * @param ids 需要删除的设备台账主键
     * @return 结果
     */
    @Override
    public int deleteAdmEmsDeviceRbookByIds(Long[] ids)
    {
        return admEmsDeviceRbookMapper.deleteAdmEmsDeviceRbookByIds(ids);
    }

    /**
     * 删除设备台账信息
     * 
     * @param id 设备台账主键
     * @return 结果
     */
    @Override
    public int deleteAdmEmsDeviceRbookById(Long id)
    {
        return admEmsDeviceRbookMapper.deleteAdmEmsDeviceRbookById(id);
    }
}
