package com.casic.missiles.modular.alarm.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.casic.missiles.modular.system.dao.AlarmRuleMapper;
import com.casic.missiles.core.datascope.DataScope;
import com.casic.missiles.modular.alarm.service.IAlarmRuleService;
import com.casic.missiles.modular.system.dto.AlarmRuleDTO;
import com.casic.missiles.modular.system.model.AlarmRule;
import org.springframework.stereotype.Service;

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

/**
 * <p>
 * 报警规则表 服务实现类
 * </p>
 *
 * @author casic123
 * @since 2019-05-17
 */
@Service
public class AlarmRuleServiceImpl extends ServiceImpl<AlarmRuleMapper, AlarmRule> implements IAlarmRuleService {
    @Resource
    AlarmRuleMapper alarmRuleMapper;

    @Override
    public List<Map<String,Object>> ruleListViaParam(Page<Map<String,Object>> page, String keywords, String deviceType,DataScope dataScope) {
        return this.baseMapper.ruleListViaParam(page,keywords,deviceType,dataScope);
    }

    @Override
    public boolean updateRule(int id, float highValue, float lowValue) {
        return this.baseMapper.updateRule(id,highValue,lowValue);
    }

    @Override
    public List<AlarmRuleDTO> getNoAlarmDevice(DataScope dataScope) {
        return this.baseMapper.getNoAlarmDevice(dataScope);
    }
}
