package com.fastbee.deviceModel.service.impl;

import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.deviceModel.mapper.DeviceModelMapper;
import com.fastbee.deviceModel.domain.DeviceModel;
import com.fastbee.deviceModel.service.IDeviceModelService;

/**
 * 设备型号Service业务层处理
 * 
 * @author kerwincui
 * @date 2024-12-17
 */
@Service
public class DeviceModelServiceImpl implements IDeviceModelService 
{
    @Autowired
    private DeviceModelMapper deviceModelMapper;

    /**
     * 查询设备型号
     * 
     * @param modelId 设备型号主键
     * @return 设备型号
     */
    @Override
    public DeviceModel selectDeviceModelByModelId(Long modelId)
    {
        return deviceModelMapper.selectDeviceModelByModelId(modelId);
    }

    /**
     * 查询设备型号列表
     * 
     * @param deviceModel 设备型号
     * @return 设备型号
     */
    @Override
    public List<DeviceModel> selectDeviceModelList(DeviceModel deviceModel)
    {
        return deviceModelMapper.selectDeviceModelList(deviceModel);
    }

    /**
     * 新增设备型号
     * 
     * @param deviceModel 设备型号
     * @return 结果
     */
    @Override
    public int insertDeviceModel(DeviceModel deviceModel)
    {
        deviceModel.setCreateTime(DateUtils.getNowDate());
        return deviceModelMapper.insertDeviceModel(deviceModel);
    }

    /**
     * 修改设备型号
     * 
     * @param deviceModel 设备型号
     * @return 结果
     */
    @Override
    public int updateDeviceModel(DeviceModel deviceModel)
    {
        deviceModel.setUpdateTime(DateUtils.getNowDate());
        return deviceModelMapper.updateDeviceModel(deviceModel);
    }

    /**
     * 批量删除设备型号
     * 
     * @param modelIds 需要删除的设备型号主键
     * @return 结果
     */
    @Override
    public int deleteDeviceModelByModelIds(Long[] modelIds)
    {
        return deviceModelMapper.deleteDeviceModelByModelIds(modelIds);
    }

    /**
     * 删除设备型号信息
     * 
     * @param modelId 设备型号主键
     * @return 结果
     */
    @Override
    public int deleteDeviceModelByModelId(Long modelId)
    {
        return deviceModelMapper.deleteDeviceModelByModelId(modelId);
    }
}
