From f8d3cf876cffd577aa368537b291efc434d63784 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 16 Sep 2020 20:14:05 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E4=BF=AE=E6=AD=A3=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DisposeDeviceManagerImpl.java | 8 ++++-- .../manager/impl/DisposeTaskManagerImpl.java | 7 +++-- .../dispose/mapper/DisposeDeviceMapper.java | 15 ++++++++++ .../com/dispose/mapper/DisposeTaskMapper.java | 15 ++++++++++ src/main/resources/mappers/DisposeDevice.xml | 22 +++++++++++++++ src/main/resources/mappers/DisposeTask.xml | 28 +++++++++++++++++++ .../test/testcase/qa/v200/P2DeviceQuery.java | 4 +-- .../test/testcase/qa/v200/P2TaskList.java | 2 +- 8 files changed, 94 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java b/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java index bddd4a5b..a388dce8 100644 --- a/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java +++ b/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java @@ -227,7 +227,7 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager { PageHelper.startPage(startPage, pageSize); // 获取分页数据 - List devList = disposeDeviceMapper.selectAll(); + List devList = disposeDeviceMapper.selectPageAll(); if (devList == null) { devList = new ArrayList<>(); @@ -236,7 +236,11 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager { // 获取分页信息 PageInfo pageInfo = new PageInfo<>(devList); - return new MulReturnType<>(pageInfo, devList); + // 返回实际数据 + List idArray = devList.stream().map(DisposeDevice::getId).collect(Collectors.toList()); + List rspList = disposeDeviceMapper.selectByIdSet(idArray); + + return new MulReturnType<>(pageInfo, rspList); } /** diff --git a/src/main/java/com/dispose/manager/impl/DisposeTaskManagerImpl.java b/src/main/java/com/dispose/manager/impl/DisposeTaskManagerImpl.java index b93e9206..1703f30d 100644 --- a/src/main/java/com/dispose/manager/impl/DisposeTaskManagerImpl.java +++ b/src/main/java/com/dispose/manager/impl/DisposeTaskManagerImpl.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * The type Dispose task manager. @@ -120,7 +121,6 @@ public class DisposeTaskManagerImpl implements DisposeTaskManager { Integer pageSize) { // 设置分页信息 PageHelper.startPage(startPage, pageSize); - List taskList = disposeTaskMapper.selectAll(); if (taskList == null) { @@ -129,6 +129,9 @@ public class DisposeTaskManagerImpl implements DisposeTaskManager { PageInfo pageInfo = new PageInfo<>(taskList); - return new MulReturnType<>(pageInfo, taskList); + List idArray = taskList.stream().map(DisposeTask::getId).collect(Collectors.toList()); + List rspList = disposeTaskMapper.selectByIdSet(idArray); + + return new MulReturnType<>(pageInfo, rspList); } } diff --git a/src/main/java/com/dispose/mapper/DisposeDeviceMapper.java b/src/main/java/com/dispose/mapper/DisposeDeviceMapper.java index d33ea4af..3bde8c33 100644 --- a/src/main/java/com/dispose/mapper/DisposeDeviceMapper.java +++ b/src/main/java/com/dispose/mapper/DisposeDeviceMapper.java @@ -19,6 +19,21 @@ public interface DisposeDeviceMapper { */ List selectAll(); + /** + * Select page all list. + * + * @return the list + */ + List selectPageAll(); + + /** + * Select by id set list. + * + * @param idList the id list + * @return the list + */ + List selectByIdSet(@Param("idList") List idList); + /** * Add new dispose device int. * diff --git a/src/main/java/com/dispose/mapper/DisposeTaskMapper.java b/src/main/java/com/dispose/mapper/DisposeTaskMapper.java index 633a92d0..2dd352bb 100644 --- a/src/main/java/com/dispose/mapper/DisposeTaskMapper.java +++ b/src/main/java/com/dispose/mapper/DisposeTaskMapper.java @@ -20,6 +20,21 @@ public interface DisposeTaskMapper { */ List selectAll(); + /** + * Select page all list. + * + * @return the list + */ + List selectPageAll(); + + /** + * Select by id set list. + * + * @param idList the id list + * @return the list + */ + List selectByIdSet(@Param("idList") List idList); + /** * Gets dispose task by id. * diff --git a/src/main/resources/mappers/DisposeDevice.xml b/src/main/resources/mappers/DisposeDevice.xml index afd4b74d..95a00585 100644 --- a/src/main/resources/mappers/DisposeDevice.xml +++ b/src/main/resources/mappers/DisposeDevice.xml @@ -28,6 +28,28 @@ + + + + + SELECT * + FROM dispose_task d + + + +