package com.gyee.runeconomy.service.auto.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gyee.runeconomy.model.ProEconAlarmRule;
import com.gyee.runeconomy.mapper.ProEconAlarmRuleMapper;
import com.gyee.runeconomy.service.auto.ProEconAlarmRuleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 自定义报警配置 服务实现类
 * </p>
 *
 * @author wang
 * @since 2024-11-27
 */
@Service
public class ProEconAlarmRuleServiceImpl extends ServiceImpl<ProEconAlarmRuleMapper, ProEconAlarmRule> implements ProEconAlarmRuleService {
    @Override
    public List<ProEconAlarmRule> getProEconAlarmRuleList(String name, String modelId) {
        QueryWrapper<ProEconAlarmRule> qw = new QueryWrapper<>();
        qw.lambda().eq(ProEconAlarmRule::getName, name);
        qw.lambda().eq(ProEconAlarmRule::getModelId, modelId);
        List<ProEconAlarmRule> proEconAlarmRules = baseMapper.selectList(qw);
        return proEconAlarmRules;
    }
}
