From c5fe30af6e6d1a72503d65f59532990f8b7fe070 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 26 十一月 2024 16:36:42 +0800
Subject: [PATCH] 预警信息 API

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 1 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 8a475cc..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,11 +1,66 @@
 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;
+import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmMessageDao;
+import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmMessageEntity;
 import com.iailab.module.model.mcs.pre.service.MmPredictAlarmMessageService;
+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;
 
 /**
  * @author PanZhibao
  * @Description
  * @createTime 2024年11月19日
  */
-public class MmPredictAlarmMessageServiceImpl implements MmPredictAlarmMessageService {
+@Service
+public class MmPredictAlarmMessageServiceImpl extends BaseServiceImpl<MmPredictAlarmMessageDao, MmPredictAlarmMessageEntity>
+        implements MmPredictAlarmMessageService {
+
+
+    @Override
+    public PageResult<MmPredictAlarmMessageEntity> page(MmPredictAlarmMessagePageReqVO reqVO) {
+        return baseDao.selectPage(reqVO);
+    }
+
+    @Override
+    public MmPredictAlarmMessageEntity getInfo(String id) {
+        return baseDao.selectById(id);
+    }
+
+    @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());
+        entity.setCreateTime(new Date());
+        baseDao.insert(entity);
+    }
+
+    @Override
+    public void update(MmPredictAlarmMessageSaveReqVO reqVO) {
+        MmPredictAlarmMessageEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmMessageEntity.class);
+        baseDao.updateById(entity);
+    }
+
+    @Override
+    public void delete(String id) {
+        baseDao.deleteById(id);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3