From c7f70933adf89a163d0049c907492a6df60cb45f Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期二, 27 八月 2024 17:29:14 +0800
Subject: [PATCH] http modbus data服务代码升级

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java |   74 ++++---------------------------------
 1 files changed, 8 insertions(+), 66 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java
index 824196d..17c6c64 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java
@@ -1,28 +1,26 @@
 package com.iailab.module.data.channel.modbus.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.iailab.module.data.common.utils.PageUtils;
-import com.iailab.module.data.common.utils.Query;
+import com.iailab.framework.common.pojo.PageResult;
 import com.iailab.framework.common.util.object.ConvertUtils;
-import com.iailab.module.data.channel.modbus.dto.ChannelModbusTagDTO;
 import com.iailab.module.data.channel.modbus.dao.ChannelModBusTagDao;
+import com.iailab.module.data.channel.modbus.dto.ChannelModbusTagDTO;
 import com.iailab.module.data.channel.modbus.entity.ChannelModBusTagEntity;
 import com.iailab.module.data.channel.modbus.service.ChannelModbusTagService;
+import com.iailab.module.data.channel.modbus.vo.ModBusTagPageReqVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
- * @author DongYukun
+ * @author lirm
  * @Description
- * @createTime 2023年05月08日 15:04:00
+ * @createTime 2024年08月27日
  */
 @Slf4j
 @Service
@@ -33,65 +31,26 @@
     @Value("${iems.upload-dir}")
     private String uploadDir;
 
-    /**
-     * 分页查询tag
-     *
-     * @param params
-     */
     @Override
-    public PageUtils queryPage(Map<String, Object> params) {
-        String tagName = (String) params.get("tagName");
-        String address = (String) params.get("address");
-        String tagDesc = (String) params.get("tagDesc");
-        String device = (String) params.get("device");
-
-        IPage<ChannelModBusTagEntity> page = this.page(
-                new Query<ChannelModBusTagEntity>().getPage(params),
-                new QueryWrapper<ChannelModBusTagEntity>()
-                        .like(StringUtils.isNotBlank(tagName), "tag_name", tagName)
-                        .like(StringUtils.isNotBlank(address), "address", address)
-                        .like(StringUtils.isNotBlank(tagDesc), "tag_desc", tagDesc)
-                        .eq(StringUtils.isNotBlank(device), "device", device)
-                        .orderByDesc("create_time")
-        );
-        return new PageUtils(page);
+    public PageResult<ChannelModBusTagEntity> queryPage(ModBusTagPageReqVO reqVO) {
+        return channelModBusTagDao.selectPage(reqVO);
     }
 
-    /**
-     * 查询tag详情
-     *
-     * @param id
-     */
     @Override
     public ChannelModBusTagEntity info(String id) {
         return channelModBusTagDao.selectById(id);
     }
 
-    /**
-     * 添加tag
-     *
-     * @param channelModBusTagEntity
-     */
     @Override
     public void add(ChannelModBusTagEntity channelModBusTagEntity) {
         channelModBusTagDao.insert(channelModBusTagEntity);
     }
 
-    /**
-     * 修改tag
-     *
-     * @param channelModBusTagEntity
-     */
     @Override
     public void update(ChannelModBusTagEntity channelModBusTagEntity) {
         channelModBusTagDao.updateById(channelModBusTagEntity);
     }
 
-    /**
-     * 删除tag
-     *
-     * @param id
-     */
     @Override
     public void delete(String id) {
         channelModBusTagDao.deleteById(id);
@@ -105,11 +64,6 @@
         return channelModBusTagDao.selectList(queryWrapper);
     }
 
-    /**
-     * 查询全部
-     *
-     * @return
-     */
     @Override
     public List<ChannelModbusTagDTO> selectAll() {
         List<ChannelModBusTagEntity> entityList = baseMapper.selectList(
@@ -118,28 +72,16 @@
         return ConvertUtils.sourceToTarget(entityList, ChannelModbusTagDTO.class);
     }
 
-    /**
-     * listByIds
-     *
-     * @param ids
-     * @return
-     */
     @Override
     public List<ChannelModBusTagEntity> listByIds(List<String> ids) {
         return baseMapper.selectList(new QueryWrapper<ChannelModBusTagEntity>().in("id", ids));
     }
 
-    /**
-     * deleteByDeviceName
-     *
-     * @param name
-     */
     @Override
     public void deleteByDeviceName(String name) {
         baseMapper.delete(new QueryWrapper<ChannelModBusTagEntity>().eq("device", name));
     }
 
-    //TODO 使用easyExcel重写
 //    /**
 //     * 导入Tag
 //     *

--
Gitblit v1.9.3