墒情数据接口

This commit is contained in:
zhumeixiao
2024-11-21 10:11:21 +08:00
parent 393c942da2
commit db13870ffe
3 changed files with 16 additions and 5 deletions

View File

@ -64,5 +64,5 @@ public interface IDeviceRealtimedataMoistureService
* 获取最新一条墒情数据
* @return
*/
public List<DeviceProperties> getLatestWeatherRealtimedata();
public List<DeviceProperties> getLatestWeatherRealtimedata(String deviceId);
}

View File

@ -100,10 +100,11 @@ public class DeviceRealtimedataMoistureServiceImpl implements IDeviceRealtimedat
* 获取最新一条墒情数据
* @return
*/
public List<DeviceProperties> getLatestWeatherRealtimedata(){
public List<DeviceProperties> getLatestWeatherRealtimedata(String deviceId){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.orderByDesc("real_time");
queryWrapper.last("limit 1");
queryWrapper.eq("device_id",deviceId);
DeviceRealtimedataMoisture moisture = deviceRealtimedataMoistureMapper.selectOne(queryWrapper);
List<Map<String, String>> mapList = new ArrayList<>();
Map<String, String> map = new HashMap<String, String>();