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.BasicDeviceTypeMapper;
import com.goomood.phm.domain.BasicDeviceType;
import com.goomood.phm.service.IBasicDeviceTypeService;

/**
 * 设备类型Service业务层处理
 * 
 * @author goomood
 * @date 2024-11-16
 */
@Service
public class BasicDeviceTypeServiceImpl implements IBasicDeviceTypeService 
{
    @Autowired
    private BasicDeviceTypeMapper basicDeviceTypeMapper;

    /**
     * 查询设备类型
     * 
     * @param id 设备类型主键
     * @return 设备类型
     */
    @Override
    public BasicDeviceType selectBasicDeviceTypeById(Long id)
    {
        return basicDeviceTypeMapper.selectBasicDeviceTypeById(id);
    }

    /**
     * 查询设备类型列表
     * 
     * @param basicDeviceType 设备类型
     * @return 设备类型
     */
    @Override
    public List<BasicDeviceType> selectBasicDeviceTypeList(BasicDeviceType basicDeviceType)
    {
        return basicDeviceTypeMapper.selectBasicDeviceTypeList(basicDeviceType);
    }

    /**
     * 新增设备类型
     * 
     * @param basicDeviceType 设备类型
     * @return 结果
     */
    @Override
    public int insertBasicDeviceType(BasicDeviceType basicDeviceType)
    {
        basicDeviceType.setCreateTime(DateUtils.getNowDate());
        return basicDeviceTypeMapper.insertBasicDeviceType(basicDeviceType);
    }

    /**
     * 修改设备类型
     * 
     * @param basicDeviceType 设备类型
     * @return 结果
     */
    @Override
    public int updateBasicDeviceType(BasicDeviceType basicDeviceType)
    {
        basicDeviceType.setUpdateTime(DateUtils.getNowDate());
        return basicDeviceTypeMapper.updateBasicDeviceType(basicDeviceType);
    }

    /**
     * 批量删除设备类型
     * 
     * @param ids 需要删除的设备类型主键
     * @return 结果
     */
    @Override
    public int deleteBasicDeviceTypeByIds(Long[] ids)
    {
        return basicDeviceTypeMapper.deleteBasicDeviceTypeByIds(ids);
    }

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