package com.sooka.sponest.monitor.device.service.impl;

import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.sooka.sponest.monitor.base.service.impl.BaseService;
import com.sooka.sponest.monitor.device.domain.CentermonitorTMonitoringThresholdAtmosphere;
import com.sooka.sponest.monitor.device.mapper.CentermonitorTMonitoringDeviceAtmosphereThresholdMapper;
import com.sooka.sponest.monitor.device.service.ICentermonitorTMonitoringDeviceAtmosphereThresholdService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CentermonitorTMonitoringDeviceAtmosphereThresholdServiceImpl extends BaseService implements ICentermonitorTMonitoringDeviceAtmosphereThresholdService {
    @Resource
    private CentermonitorTMonitoringDeviceAtmosphereThresholdMapper deviceAtmosphereThresholdMapper;

    /**
     * 通过设备编码查询大气传感器阈值
     * */
    @Override
    public CentermonitorTMonitoringThresholdAtmosphere selectAtmosphereThresholdByCode(String deviceCode) {
        return deviceAtmosphereThresholdMapper.selectAtmosphereThresholdByCode(deviceCode);
    }

    /**
     * 通过设备编码组查询大气传感器阈值
     * */
    @Override
    public List<CentermonitorTMonitoringThresholdAtmosphere> selectAtmosphereThresholdByCodes(String[] deviceCodes){
        return deviceAtmosphereThresholdMapper.selectAtmosphereThresholdByCodes(deviceCodes);
    }

    /**
     * 新增大气监测设备阈值
     */
    @Override
    public int insertAtmosphereThreshold(CentermonitorTMonitoringThresholdAtmosphere thresholdAtmosphere){
        thresholdAtmosphere.setId(IdUtils.simpleUUID());
        return deviceAtmosphereThresholdMapper.insertAtmosphereThreshold(thresholdAtmosphere);
    }

    /**
     * 修改大气监测设备阈值
     */
    @Override
    public int updateAtmosphereThreshold(CentermonitorTMonitoringThresholdAtmosphere thresholdAtmosphere){
        return deviceAtmosphereThresholdMapper.updateAtmosphereThreshold(thresholdAtmosphere);
    }
}
