package com.goomood.phm.service.impl;

import java.util.List;
import com.goomood.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.goomood.phm.mapper.BasicDeviceInfoMapper;
import com.goomood.phm.domain.BasicDeviceInfo;
import com.goomood.phm.service.IBasicDeviceInfoService;

/**
 * 设备信息Service业务层处理
 * 
 * @author goomood
 * @date 2024-11-16
 */
@Service
public class BasicDeviceInfoServiceImpl implements IBasicDeviceInfoService 
{
    @Autowired
    private BasicDeviceInfoMapper basicDeviceInfoMapper;

    /**
     * 查询设备信息
     * 
     * @param id 设备信息主键
     * @return 设备信息
     */
    @Override
    public BasicDeviceInfo selectBasicDeviceInfoById(Long id)
    {
        return basicDeviceInfoMapper.selectBasicDeviceInfoById(id);
    }

    /**
     * 查询设备信息列表
     * 
     * @param basicDeviceInfo 设备信息
     * @return 设备信息
     */
    @Override
    public List<BasicDeviceInfo> selectBasicDeviceInfoList(BasicDeviceInfo basicDeviceInfo)
    {
        return basicDeviceInfoMapper.selectBasicDeviceInfoList(basicDeviceInfo);
    }

    /**
     * 新增设备信息
     * 
     * @param basicDeviceInfo 设备信息
     * @return 结果
     */
    @Override
    public int insertBasicDeviceInfo(BasicDeviceInfo basicDeviceInfo)
    {
        basicDeviceInfo.setCreateTime(DateUtils.getNowDate());
        return basicDeviceInfoMapper.insertBasicDeviceInfo(basicDeviceInfo);
    }

    /**
     * 修改设备信息
     * 
     * @param basicDeviceInfo 设备信息
     * @return 结果
     */
    @Override
    public int updateBasicDeviceInfo(BasicDeviceInfo basicDeviceInfo)
    {
        basicDeviceInfo.setUpdateTime(DateUtils.getNowDate());
        return basicDeviceInfoMapper.updateBasicDeviceInfo(basicDeviceInfo);
    }

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

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