package com.ruoyi.manage.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manage.domain.EquipmentManage;
import com.ruoyi.manage.mapper.EquipmentManageMapper;
import com.ruoyi.manage.service.IEquipmentManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备管理Service业务层处理
 * 
 * @author boman
 * @date 2025-05-07
 */
@Service
public class EquipmentManageServiceImpl implements IEquipmentManageService
{
    @Autowired
    private EquipmentManageMapper equipmentManageMapper;

    /**
     * 查询设备管理
     * 
     * @param equipmentId 设备管理主键
     * @return 设备管理
     */
    @Override
    public EquipmentManage selectEquipmentManageByEquipmentId(Long equipmentId)
    {
        return equipmentManageMapper.selectEquipmentManageByEquipmentId(equipmentId);
    }

    /**
     * 查询设备管理列表
     * 
     * @param equipmentManage 设备管理
     * @return 设备管理
     */
    @Override
    public List<EquipmentManage> selectEquipmentManageList(EquipmentManage equipmentManage)
    {
        return equipmentManageMapper.selectEquipmentManageList(equipmentManage);
    }

    /**
     * 新增设备管理
     * 
     * @param equipmentManage 设备管理
     * @return 结果
     */
    @Override
    public int insertEquipmentManage(EquipmentManage equipmentManage)
    {
        equipmentManage.setCreateTime(DateUtils.getNowDate());
        return equipmentManageMapper.insertEquipmentManage(equipmentManage);
    }

    /**
     * 修改设备管理
     * 
     * @param equipmentManage 设备管理
     * @return 结果
     */
    @Override
    public int updateEquipmentManage(EquipmentManage equipmentManage)
    {
        equipmentManage.setUpdateTime(DateUtils.getNowDate());
        return equipmentManageMapper.updateEquipmentManage(equipmentManage);
    }

    /**
     * 批量删除设备管理
     * 
     * @param equipmentIds 需要删除的设备管理主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentManageByEquipmentIds(Long[] equipmentIds)
    {
        return equipmentManageMapper.deleteEquipmentManageByEquipmentIds(equipmentIds);
    }

    /**
     * 删除设备管理信息
     * 
     * @param equipmentId 设备管理主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentManageByEquipmentId(Long equipmentId)
    {
        return equipmentManageMapper.deleteEquipmentManageByEquipmentId(equipmentId);
    }
}
