parent
ca831439bb
commit
f8d3cf876c
|
@ -227,7 +227,7 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager {
|
|||
PageHelper.startPage(startPage, pageSize);
|
||||
|
||||
// 获取分页数据
|
||||
List<DisposeDevice> devList = disposeDeviceMapper.selectAll();
|
||||
List<DisposeDevice> devList = disposeDeviceMapper.selectPageAll();
|
||||
|
||||
if (devList == null) {
|
||||
devList = new ArrayList<>();
|
||||
|
@ -236,7 +236,11 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager {
|
|||
// 获取分页信息
|
||||
PageInfo<DisposeDevice> pageInfo = new PageInfo<>(devList);
|
||||
|
||||
return new MulReturnType<>(pageInfo, devList);
|
||||
// 返回实际数据
|
||||
List<Long> idArray = devList.stream().map(DisposeDevice::getId).collect(Collectors.toList());
|
||||
List<DisposeDevice> rspList = disposeDeviceMapper.selectByIdSet(idArray);
|
||||
|
||||
return new MulReturnType<>(pageInfo, rspList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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<DisposeTask> taskList = disposeTaskMapper.selectAll();
|
||||
|
||||
if (taskList == null) {
|
||||
|
@ -129,6 +129,9 @@ public class DisposeTaskManagerImpl implements DisposeTaskManager {
|
|||
|
||||
PageInfo<DisposeTask> pageInfo = new PageInfo<>(taskList);
|
||||
|
||||
return new MulReturnType<>(pageInfo, taskList);
|
||||
List<Long> idArray = taskList.stream().map(DisposeTask::getId).collect(Collectors.toList());
|
||||
List<DisposeTask> rspList = disposeTaskMapper.selectByIdSet(idArray);
|
||||
|
||||
return new MulReturnType<>(pageInfo, rspList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,21 @@ public interface DisposeDeviceMapper {
|
|||
*/
|
||||
List<DisposeDevice> selectAll();
|
||||
|
||||
/**
|
||||
* Select page all list.
|
||||
*
|
||||
* @return the list
|
||||
*/
|
||||
List<DisposeDevice> selectPageAll();
|
||||
|
||||
/**
|
||||
* Select by id set list.
|
||||
*
|
||||
* @param idList the id list
|
||||
* @return the list
|
||||
*/
|
||||
List<DisposeDevice> selectByIdSet(@Param("idList") List<Long> idList);
|
||||
|
||||
/**
|
||||
* Add new dispose device int.
|
||||
*
|
||||
|
|
|
@ -20,6 +20,21 @@ public interface DisposeTaskMapper {
|
|||
*/
|
||||
List<DisposeTask> selectAll();
|
||||
|
||||
/**
|
||||
* Select page all list.
|
||||
*
|
||||
* @return the list
|
||||
*/
|
||||
List<DisposeTask> selectPageAll();
|
||||
|
||||
/**
|
||||
* Select by id set list.
|
||||
*
|
||||
* @param idList the id list
|
||||
* @return the list
|
||||
*/
|
||||
List<DisposeTask> selectByIdSet(@Param("idList") List<Long> idList);
|
||||
|
||||
/**
|
||||
* Gets dispose task by id.
|
||||
*
|
||||
|
|
|
@ -28,6 +28,28 @@
|
|||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPageAll" resultType="com.dispose.pojo.entity.DisposeDevice">
|
||||
SELECT *
|
||||
FROM dispose_device d
|
||||
</select>
|
||||
|
||||
<select id="selectByIdSet" resultMap="dispose_device">
|
||||
SELECT d.*,
|
||||
c.id c_id,
|
||||
c.deviceId deviceId,
|
||||
c.capacityType capacityType,
|
||||
c.objectType objectType,
|
||||
c.ipType ipType,
|
||||
c.protectIp protectIp,
|
||||
c.reserveNetflow reserveNetflow
|
||||
FROM dispose_device d
|
||||
LEFT JOIN dispose_capacity c ON d.id = c.deviceId
|
||||
WHERE d.id IN
|
||||
<foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultMap="dispose_device">
|
||||
SELECT d.*,
|
||||
c.id c_id,
|
||||
|
|
|
@ -31,6 +31,34 @@
|
|||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPageAll" resultType="com.dispose.pojo.entity.DisposeTask">
|
||||
SELECT *
|
||||
FROM dispose_task d
|
||||
</select>
|
||||
|
||||
<select id="selectByIdSet" resultMap="dispose_task">
|
||||
SELECT dt.*,
|
||||
ti.id t_id,
|
||||
ti.taskId taskId,
|
||||
ti.deviceId t_deviceId,
|
||||
ti.beginTime beginTime,
|
||||
ti.endTime t_endTime,
|
||||
ti.taskAttackType taskAttackType,
|
||||
ti.execAttackTypeIn execAttackTypeIn,
|
||||
ti.attackTypeStatusIn attackTypeStatusIn,
|
||||
ti.execAttackTypeOut execAttackTypeOut,
|
||||
ti.attackTypeStatusOut attackTypeStatusOut,
|
||||
ti.externId externId,
|
||||
ti.errRetry errRetry,
|
||||
ti.status status
|
||||
FROM dispose_task dt
|
||||
LEFT JOIN device_task ti on dt.id = ti.taskId
|
||||
WHERE dt.id IN
|
||||
<foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultMap="dispose_task">
|
||||
SELECT dt.*,
|
||||
ti.id t_id,
|
||||
|
|
|
@ -57,10 +57,10 @@ public class P2DeviceQuery {
|
|||
Assert.assertEquals((long)v.getMsgContent().getStatus(), e.getCode());
|
||||
|
||||
Assert.assertEquals((long)v.getMsgContent().getCurPageNumber(), 1);
|
||||
//Assert.assertEquals((long)v.getMsgContent().getPageSize(), 10);
|
||||
Assert.assertEquals((long)v.getMsgContent().getPageSize(), 10);
|
||||
|
||||
Assert.assertNotNull(v.getMsgContent().getItems());
|
||||
//Assert.assertEquals(v.getMsgContent().getItems().size(), 10);
|
||||
Assert.assertEquals(v.getMsgContent().getItems().size(), 10);
|
||||
|
||||
Assert.assertNotEquals(v.getMsgContent().getItems().size(), 0);
|
||||
v.getMsgContent().getItems().forEach(k -> {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class P2TaskList {
|
|||
.build(),
|
||||
|
||||
QATestItem.builder()
|
||||
.id(BASE_P2_TASK_LIST_ID)
|
||||
.id(BASE_P2_TASK_LIST_ID + 1)
|
||||
.name("msgContent为空")
|
||||
.priority(TestPriority.P2_PRIORITY)
|
||||
.urlPath("/task/taskList")
|
||||
|
|
Loading…
Reference in New Issue