From f96689bddf69ea3d635116cf1dd98bd5e5e0755a Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期四, 28 十一月 2024 09:23:52 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java index 33da851..1f55917 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java @@ -1,5 +1,6 @@ package com.iailab.module.model.mcs.pre.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; @@ -9,8 +10,10 @@ import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessagePageReqVO; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.Date; +import java.util.List; import java.util.UUID; /** @@ -34,6 +37,15 @@ } @Override + public MmPredictAlarmMessageEntity getLast(String alarmObj) { + QueryWrapper<MmPredictAlarmMessageEntity> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("alarm_obj", alarmObj) + .orderByDesc("alarm_time") + .last("limit 1"); + return baseDao.selectOne(queryWrapper); + } + + @Override public void create(MmPredictAlarmMessageSaveReqVO reqVO) { MmPredictAlarmMessageEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmMessageEntity.class); entity.setId(UUID.randomUUID().toString()); -- Gitblit v1.9.3