
com.zhuang.mica.mqtt.module.device.service.SysDeviceFunctionLogService Maven / Gradle / Ivy
The newest version!
package com.zhuang.mica.mqtt.module.device.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhuang.mica.mqtt.module.device.mapper.SysDeviceFunctionLogMapper;
import com.zhuang.mica.mqtt.module.device.entity.SysDeviceFunctionLog;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
*
* 设备指令日志 服务类
*
*
* @author zwb
* @since 2023-06-24
*/
@Service
public class SysDeviceFunctionLogService extends ServiceImpl {
public SysDeviceFunctionLog getByFunctionId(String functionId) {
List list = list(new LambdaQueryWrapper()
.eq(SysDeviceFunctionLog::getFunctionId, functionId)
);
list = list.stream().sorted(Comparator.comparing(SysDeviceFunctionLog::getSendTime).reversed()).collect(Collectors.toList());
return list.size() > 0 ? list.get(0) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy