From 05576523a8626d34aaa1a47f1dfdcad7710482b4 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 27 十一月 2024 13:35:45 +0800
Subject: [PATCH] 调度建议

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
index 32b7055..46cdb20 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
@@ -1,10 +1,18 @@
 package com.iailab.module.model.mcs.sche.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.sche.dao.StScheduleSuggestDao;
 import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity;
 import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService;
+import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO;
+import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO;
 import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.UUID;
 
 /**
  * @author PanZhibao
@@ -14,4 +22,42 @@
 @Service
 public class StScheduleSuggestServiceImpl extends BaseServiceImpl<StScheduleSuggestDao, StScheduleSuggestEntity>
         implements StScheduleSuggestService {
+
+    @Override
+    public PageResult<StScheduleSuggestEntity> page(StScheduleSuggestPageReqVO reqVO) {
+        return baseDao.selectPage(reqVO);
+    }
+
+    @Override
+    public void create(StScheduleSuggestSaveReqVO createReqVO) {
+        StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class);
+        entity.setId(UUID.randomUUID().toString());
+        baseDao.insert(entity);
+    }
+
+    @Override
+    public void update(StScheduleSuggestSaveReqVO createReqVO) {
+        StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class);
+        baseDao.updateById(entity);
+    }
+
+    @Override
+    public void delete(String id) {
+        baseDao.deleteById(id);
+    }
+
+    @Override
+    public StScheduleSuggestEntity getInfo(String id) {
+        return baseDao.selectById(id);
+    }
+
+    @Override
+    public List<StScheduleSuggestEntity> getList(String scheduleObj, Integer limit) {
+        QueryWrapper<StScheduleSuggestEntity> queryWrapper = new QueryWrapper<>();
+        limit = limit == null ? 1 : limit;
+        queryWrapper.eq("schedule_obj", scheduleObj)
+                .orderByDesc("create_time")
+                .last("limit " + limit);
+        return baseDao.selectList(queryWrapper);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3