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.CentermonitorTMonitoringThresholdWaterQuality;
import com.sooka.sponest.monitor.device.mapper.CentermonitorTMonitoringDeviceWaterQualityThresholdMapper;
import com.sooka.sponest.monitor.device.service.ICentermonitorTMonitoringDeviceWaterQualityThresholdService;
import org.springframework.stereotype.Service;

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

@Service
public class CentermonitorTMonitoringDeviceWaterQualityThresholdServiceImpl extends BaseService implements ICentermonitorTMonitoringDeviceWaterQualityThresholdService {
    @Resource
    private CentermonitorTMonitoringDeviceWaterQualityThresholdMapper deviceWaterQualityThresholdMapper;

    /**
     * 通过设备编码查询水质传感器阈值
     * */
    @Override
    public CentermonitorTMonitoringThresholdWaterQuality selectWaterQualityThresholdByCode(String deviceCode) {
        return deviceWaterQualityThresholdMapper.selectWaterQualityThresholdByCode(deviceCode);
    }

    /**
     * 通过设备编码组查询水质传感器阈值
     * */
    @Override
    public List<CentermonitorTMonitoringThresholdWaterQuality> selectWaterQualityThresholdByCodes(String[] deviceCodes){
        return deviceWaterQualityThresholdMapper.selectWaterQualityThresholdByCodes(deviceCodes);
    }


    /**
     * 新增水质监测设备阈值
     */
    @Override
    public int insertWaterQualityThreshold(CentermonitorTMonitoringThresholdWaterQuality thresholdWaterQuality){
        thresholdWaterQuality.setId(IdUtils.simpleUUID());
        return deviceWaterQualityThresholdMapper.insertWaterQualityThreshold(thresholdWaterQuality);
    }

    /**
     * 修改水质监测设备阈值
     */
    @Override
    public int updateWaterQualityThreshold(CentermonitorTMonitoringThresholdWaterQuality thresholdWaterQuality){
        return deviceWaterQualityThresholdMapper.updateWaterQualityThreshold(thresholdWaterQuality);
    }
}
