feat: 查询env时 只查询最后一次创建的session

This commit is contained in:
zhangshuai
2024-09-06 16:08:01 +08:00
parent ce1b53a657
commit df01d6a618

View File

@@ -52,7 +52,9 @@ public class EnvironmentServiceImpl extends ServiceImpl<EnvironmentDao, Environm
environment.setCreateUser(createUser);
environment.setUpdateUser(updateUser);
EnvironmentSessionEntity deviceSession = deviceSessionService.getOne(new LambdaQueryWrapper<EnvironmentSessionEntity>().eq(EnvironmentSessionEntity::getEnvId, environment.getId()));
EnvironmentSessionEntity deviceSession = deviceSessionService.getOne(new LambdaQueryWrapper<EnvironmentSessionEntity>()
.eq(EnvironmentSessionEntity::getEnvId, environment.getId())
.orderByDesc(EnvironmentSessionEntity::getStartTimestamp).last("limit 1"));
if (null != deviceSession) {
SysUserEntity useUser = sysUserService.getById(deviceSession.getUserId());