package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.business.domain.VO.HwMonitorUnitVo;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.HwMonitorUnitTypeMapper;
import com.ruoyi.business.domain.HwMonitorUnitType;
import com.ruoyi.business.service.IHwMonitorUnitTypeService;

/**
 * 监控单元类型Service业务层处理
 *
 * @author YINQ
 * @date 2023-08-31
 */
@Service
public class HwMonitorUnitTypeServiceImpl implements IHwMonitorUnitTypeService
{
    @Autowired
    private HwMonitorUnitTypeMapper hwMonitorUnitTypeMapper;

    /**
     * 查询监控单元类型
     *
     * @param monitorUnitTypeId 监控单元类型主键
     * @return 监控单元类型
     */
    @Override
    public HwMonitorUnitType selectHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId)
    {
        return hwMonitorUnitTypeMapper.selectHwMonitorUnitTypeByMonitorUnitTypeId(monitorUnitTypeId);
    }

    /**
     * 查询监控单元类型列表
     *
     * @param hwMonitorUnitType 监控单元类型
     * @return 监控单元类型
     */
    @Override
    public List<HwMonitorUnitType> selectHwMonitorUnitTypeList(HwMonitorUnitType hwMonitorUnitType)
    {
        return hwMonitorUnitTypeMapper.selectHwMonitorUnitTypeList(hwMonitorUnitType);
    }


    /**
     * 新增监控单元类型
     *
     * @param hwMonitorUnitType 监控单元类型
     * @return 结果
     */
    @Override
    public int insertHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType)
    {
        hwMonitorUnitType.setCreateTime(DateUtils.getNowDate());
        return hwMonitorUnitTypeMapper.insertHwMonitorUnitType(hwMonitorUnitType);
    }

    /**
     * 修改监控单元类型
     *
     * @param hwMonitorUnitType 监控单元类型
     * @return 结果
     */
    @Override
    public int updateHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType)
    {
        hwMonitorUnitType.setUpdateTime(DateUtils.getNowDate());
        return hwMonitorUnitTypeMapper.updateHwMonitorUnitType(hwMonitorUnitType);
    }

    /**
     * 批量删除监控单元类型
     *
     * @param monitorUnitTypeIds 需要删除的监控单元类型主键
     * @return 结果
     */
    @Override
    public int deleteHwMonitorUnitTypeByMonitorUnitTypeIds(Long[] monitorUnitTypeIds)
    {
        return hwMonitorUnitTypeMapper.deleteHwMonitorUnitTypeByMonitorUnitTypeIds(monitorUnitTypeIds);
    }

    /**
     * 删除监控单元类型信息
     *
     * @param monitorUnitTypeId 监控单元类型主键
     * @return 结果
     */
    @Override
    public int deleteHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId)
    {
        return hwMonitorUnitTypeMapper.deleteHwMonitorUnitTypeByMonitorUnitTypeId(monitorUnitTypeId);
    }
}
