From 25019019f6495696ec1f3b7276ccb78f0f5905e8 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 25 九月 2024 10:29:32 +0800
Subject: [PATCH] point 分页

---
 iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml                                     |    2 +-
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointService.java             |    2 +-
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java    |    6 ++++--
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java |    8 ++++----
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dao/DaPointDao.java                     |    9 +++------
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointPageReqVO.java                |   12 +++++++++++-
 6 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java
index a0fecc4..24e7fc5 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java
@@ -40,9 +40,9 @@
 
     @PreAuthorize("@ss.hasPermission('data:point:query')")
     @GetMapping("page")
-    public CommonResult<PageResult<DaPointRespVO>> page(@Valid DaPointPageReqVO reqVO){
-        PageResult<DaPointEntity> page = daPointService.queryPage(reqVO);
-        return success(BeanUtils.toBean(page, DaPointRespVO.class));
+    public CommonResult<PageResult<DaPointDTO>> page(@Valid DaPointPageReqVO reqVO){
+        PageResult<DaPointDTO> page = daPointService.queryPage(reqVO);
+        return success(page);
     }
 
     @PreAuthorize("@ss.hasPermission('data:point:query')")
@@ -61,7 +61,7 @@
     }
 
     @PreAuthorize("@ss.hasPermission('data:point:create')")
-    @PostMapping("/add")
+    @PostMapping("/data:point")
     public CommonResult<Boolean> create(@RequestBody DaPointDTO daPointDTO){
         String id = UUID.randomUUID().toString();
         daPointDTO.setId(id);
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dao/DaPointDao.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dao/DaPointDao.java
index d977988..ce73d04 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dao/DaPointDao.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dao/DaPointDao.java
@@ -23,7 +23,7 @@
 @Mapper
 public interface DaPointDao extends BaseMapperX<DaPointEntity> {
 
-    IPage<DaPointDTO> getPageList(IPage<DaPointEntity> page, @Param("params") Map<String, Object> params);
+    IPage<DaPointDTO> getPageList(IPage<DaPointEntity> page, @Param("params") DaPointPageReqVO reqVO);
 
     List<DaPointDTO> getConstantPoint(Map<String, Object> params);
 
@@ -31,10 +31,7 @@
 
     List<DaPointDTO> getMathPoint(Map<String, Object> params);
 
-    default PageResult<DaPointEntity> selectPage(DaPointPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<DaPointEntity>()
-                .likeIfPresent(DaPointEntity::getPointNo, reqVO.getPointNo())
-                .likeIfPresent(DaPointEntity::getPointName, reqVO.getPointName())
-                .orderByDesc(DaPointEntity::getCreateTime));
+    default IPage<DaPointDTO> selectPage(DaPointPageReqVO reqVO) {
+        return getPageList(getPage(reqVO), reqVO);
     }
 }
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointService.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointService.java
index f3bec40..b79d034 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointService.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointService.java
@@ -14,7 +14,7 @@
  * @createTime 2024年09月2日
  */
 public interface DaPointService{
-    PageResult<DaPointEntity> queryPage(DaPointPageReqVO reqVO);
+    PageResult<DaPointDTO> queryPage(DaPointPageReqVO reqVO);
 
     DaPointDTO info(String id);
 
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
index 44402c3..ad84b34 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSONArray;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.iailab.framework.common.pojo.PageResult;
 import com.iailab.framework.common.util.object.ConvertUtils;
@@ -48,8 +49,9 @@
 
 
     @Override
-    public PageResult<DaPointEntity> queryPage(DaPointPageReqVO reqVO) {
-        return daPointDao.selectPage(reqVO);
+    public PageResult<DaPointDTO> queryPage(DaPointPageReqVO reqVO) {
+        IPage<DaPointDTO> page = daPointDao.selectPage(reqVO);
+        return new PageResult<DaPointDTO>(page.getRecords(), page.getTotal());
     }
 
     @Override
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointPageReqVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointPageReqVO.java
index b92117e..363b4ca 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointPageReqVO.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointPageReqVO.java
@@ -11,7 +11,7 @@
  * @Description
  * @createTime 2024年09月2日
  */
-@Schema(description = "数据平台 - DaPoint分页 Request VO")
+@Schema(description = "数据平台 - 测点分页 Request VO")
 @Data
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
@@ -20,4 +20,14 @@
     private String pointNo;
 
     private String pointName;
+
+    private String pointType;
+
+    private String dataType;
+
+    private String sourceName;
+
+    private String tagNo;
+
+    private Integer isEnable;
 }
\ No newline at end of file
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/da/DaPointDao.xml b/iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml
similarity index 99%
rename from iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/da/DaPointDao.xml
rename to iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml
index 90b6481..5314c45 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/da/DaPointDao.xml
+++ b/iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml
@@ -64,7 +64,7 @@
                 and t1.is_enable = #{params.isEnable}
             </if>
         </where>
-        order by t1.point_no desc
+        order by t1.create_time desc
     </select>
 
     <select id="getConstantPoint" resultType="com.iailab.module.data.point.dto.DaPointDTO">

--
Gitblit v1.9.3