package com.yfd.platform.modules.auxcontrol.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmParameter;
import com.yfd.platform.modules.auxcontrol.mapper.DeviceAlarmParameterMapper;
import com.yfd.platform.modules.auxcontrol.service.IDeviceAlarmParameterService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 变电站-辅控设备-告警参数设置 服务实现类
 * </p>
 *
 * @author zhengsl
 * @since 2025-04-23
 */
@Service
public class DeviceAlarmParameterServiceImpl extends ServiceImpl<DeviceAlarmParameterMapper, DeviceAlarmParameter> implements IDeviceAlarmParameterService {

    @Resource
    private DeviceAlarmParameterMapper deviceAlarmParameterMapper;

    /**********************************
     * 用途说明: 新增辅控设备告警参数
     * 参数说明 deviceAlarmParameter 告警参数对象
     * 返回值说明: boolean
     ***********************************/
    @Override
    public boolean addDeviceAlarmParameter(DeviceAlarmParameter deviceAlarmParameter) {
        return this.saveOrUpdate(deviceAlarmParameter);
    }

    /**********************************
     * 用途说明: 修改辅控设备告警参数
     * 参数说明 deviceAlarmParameter 告警参数对象
     * 返回值说明: boolean
     ***********************************/
    @Override
    public boolean updateDeviceAlarmParameter(DeviceAlarmParameter deviceAlarmParameter) {
        return this.saveOrUpdate(deviceAlarmParameter);
    }

    @Override
    public Page<DeviceAlarmParameter> getDeviceAlarmParameterPage(String meterDeviceId, String signalId,
                                                                  String alarmType, String alarmLevel,
                                                                  Page<DeviceAlarmParameter> page) {
        Page<DeviceAlarmParameter> deviceAlarmParameterPage = deviceAlarmParameterMapper.getDeviceAlarmParameterPage(meterDeviceId, signalId, alarmType, alarmLevel
                        , page);
        return deviceAlarmParameterPage;
    }
}
