1.治理暂态事件、波形文件记录解析功能;日志记录功能
2.设备上线、掉线日志记录
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.njcn.access.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.access.pojo.po.CsDeviceOnlineLogs;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备状态日志表,记录设备掉线上线的情况 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-09-08
|
||||
*/
|
||||
public interface ICsDeviceOnlineLogsService extends IService<CsDeviceOnlineLogs> {
|
||||
|
||||
/**
|
||||
* 根据nDid查询最新的一条记录
|
||||
* @param nDid
|
||||
* @return
|
||||
*/
|
||||
CsDeviceOnlineLogs findLastData(String nDid);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.access.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.access.mapper.CsDeviceOnlineLogsMapper;
|
||||
import com.njcn.access.pojo.po.CsDeviceOnlineLogs;
|
||||
import com.njcn.access.service.ICsDeviceOnlineLogsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备状态日志表,记录设备掉线上线的情况 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-09-08
|
||||
*/
|
||||
@Service
|
||||
public class CsDeviceOnlineLogsServiceImpl extends ServiceImpl<CsDeviceOnlineLogsMapper, CsDeviceOnlineLogs> implements ICsDeviceOnlineLogsService {
|
||||
|
||||
@Override
|
||||
public CsDeviceOnlineLogs findLastData(String nDid) {
|
||||
return this.lambdaQuery().eq(CsDeviceOnlineLogs::getNdid,nDid).orderByDesc(CsDeviceOnlineLogs::getOnlineTime).last("LIMIT 1").one();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user