package com.bonus.material.ma.service.impl;

import java.util.List;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.ma.mapper.DeviceManageMapper;
import com.bonus.material.ma.domain.DeviceManage;
import com.bonus.material.ma.service.IDeviceManageService;

/**
 * 机具设备管理Service业务层处理
 * 
 * @author xsheng
 * @date 2024-09-27
 */
@Service
public class DeviceManageServiceImpl implements IDeviceManageService 
{
    @Autowired
    private DeviceManageMapper deviceManageMapper;

    /**
     * 查询机具设备管理
     * 
     * @param deviceId 机具设备管理主键
     * @return 机具设备管理
     */
    @Override
    public DeviceManage selectDeviceManageByDeviceId(Long deviceId)
    {
        return deviceManageMapper.selectDeviceManageByDeviceId(deviceId);
    }

    /**
     * 查询机具设备管理列表
     * 
     * @param deviceManage 机具设备管理
     * @return 机具设备管理
     */
    @Override
    public List<DeviceManage> selectDeviceManageList(DeviceManage deviceManage)
    {
        return deviceManageMapper.selectDeviceManageList(deviceManage);
    }

    /**
     * 新增机具设备管理
     * 
     * @param deviceManage 机具设备管理
     * @return 结果
     */
    @Override
    public int insertDeviceManage(DeviceManage deviceManage)
    {
        deviceManage.setCreateTime(DateUtils.getNowDate());
        return deviceManageMapper.insertDeviceManage(deviceManage);
    }

    /**
     * 修改机具设备管理
     * 
     * @param deviceManage 机具设备管理
     * @return 结果
     */
    @Override
    public int updateDeviceManage(DeviceManage deviceManage)
    {
        deviceManage.setUpdateTime(DateUtils.getNowDate());
        return deviceManageMapper.updateDeviceManage(deviceManage);
    }

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

    /**
     * 删除机具设备管理信息
     * 
     * @param deviceId 机具设备管理主键
     * @return 结果
     */
    @Override
    public int deleteDeviceManageByDeviceId(Long deviceId)
    {
        return deviceManageMapper.deleteDeviceManageByDeviceId(deviceId);
    }
}
