package org.jeecg.modules.sensor.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.sensor.entity.BuSensorData;
import org.jeecg.modules.sensor.mapper.BuSensorDataMapper;
import org.jeecg.modules.sensor.model.BuSensorModel;
import org.jeecg.modules.sensor.service.IBuSensorDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 传感器数据表
 * @Author: jeecg-boot
 * @Date:   2020-12-23
 * @Version: V1.0
 */
@Service
public class BuSensorDataServiceImpl extends ServiceImpl<BuSensorDataMapper, BuSensorData> implements IBuSensorDataService {

	@Autowired
	private BuSensorDataMapper buSensorDataMapper;

	@Override
	public List<BuSensorData> getSensorData() {
		return buSensorDataMapper.getSensorData();
	}
	@Override
	public BuSensorData selectByMainId(String mainId) {
		return buSensorDataMapper.selectByMainId(mainId);
	}

	@Override
	public BuSensorData getDataByDeviceId(String deviceId){
		return buSensorDataMapper.getDataByDeviceId(deviceId);
	}

	@Override
	public IPage<BuSensorModel> getRealTimeSensorDataByDeviceId(Page page, String deviceId) {
		return buSensorDataMapper.getRealTimeSensorDataByDeviceId(page,deviceId);
	}

}
