package com.sptg.iot.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.iot.api.entity.IotDevice;
import com.sptg.iot.api.entity.IotSmokeDevice;
import com.sptg.iot.biz.mapper.IotSmokeDeviceMapper;
import com.sptg.iot.biz.service.IotSmokeDeviceServiceInterface;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author zwx
 * @create 2020/11/13 10:43
 */
@Service
@RequiredArgsConstructor
public class IotSmokeDeviceServiceImpl extends ServiceImpl<IotSmokeDeviceMapper, IotSmokeDevice> implements IotSmokeDeviceServiceInterface {

    @Override
    public IotSmokeDevice getIotSmokeDeviceByDeviceId(String deviceId) {
        Wrapper<IotSmokeDevice> wrapper = new EntityWrapper<>();
        wrapper.eq("s_device_id", deviceId);
        return this.baseMapper.getOne(wrapper);
    }
}
