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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gyee.alarm.model.auto.ProEconAlarmInfo;
import com.gyee.alarm.mapper.auto.ProEconAlarmInfoMapper;
import com.gyee.alarm.model.auto.ProEconAlarmInfo;
import com.gyee.alarm.service.auto.IProEconAlarmInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gyee.alarm.util.StringUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 报警缓存表 服务实现类
 * </p>
 *
 * @author shilin
 * @since 2023-06-19
 */
@Service
public class ProEconAlarmInfoServiceImpl extends ServiceImpl<ProEconAlarmInfoMapper, ProEconAlarmInfo> implements IProEconAlarmInfoService {


    public List<ProEconAlarmInfo> queryAlarmInfo(String wtId,String type)
    {
        List<ProEconAlarmInfo> alarmInfols =new ArrayList<>();

        if(StringUtils.notEmp(wtId) && StringUtils.notEmp(type))
        {
            QueryWrapper<ProEconAlarmInfo> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("alarm_type",type)
                    .eq("device_id",wtId);
           alarmInfols = list(queryWrapper);

        }

        return alarmInfols;
    }
}
