parent
37393c35ca
commit
75c6448f57
|
@ -124,22 +124,22 @@ public class DisposeTaskManagerImpl implements DisposeTaskManager {
|
|||
Integer startPage,
|
||||
Integer pageSize) {
|
||||
PageInfo<DisposeTask> pageInfo;
|
||||
List<DisposeTask> taskList = new ArrayList<>();
|
||||
List<DisposeTask> preList;
|
||||
|
||||
// 设置分页信息
|
||||
PageHelper.startPage(startPage, pageSize);
|
||||
|
||||
if(taskId.size() > 0) {
|
||||
taskList.addAll(disposeTaskMapper.selectByIdSet(taskId));
|
||||
pageInfo = new PageInfo<>(taskList);
|
||||
preList = disposeTaskMapper.selectPageById(taskId);
|
||||
} else {
|
||||
List<DisposeTask> preList = disposeTaskMapper.selectPageAll();
|
||||
pageInfo = new PageInfo<>(preList);
|
||||
|
||||
preList = disposeTaskMapper.selectPageAll();
|
||||
preList.forEach(k -> taskId.add(k.getId()));
|
||||
taskList.addAll(disposeTaskMapper.selectByIdSet(taskId));
|
||||
}
|
||||
|
||||
pageInfo = new PageInfo<>(preList);
|
||||
|
||||
List<DisposeTask> taskList = new ArrayList<>(disposeTaskMapper.selectByIdSet(taskId));
|
||||
|
||||
return new MulReturnType<>(pageInfo, taskList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,14 @@ public interface DisposeTaskMapper {
|
|||
*/
|
||||
List<DisposeTask> selectPageAll();
|
||||
|
||||
/**
|
||||
* Select page by id list.
|
||||
*
|
||||
* @param idList the id list
|
||||
* @return the list
|
||||
*/
|
||||
List<DisposeTask> selectPageById(@Param("idList") List<Long> idList);
|
||||
|
||||
/**
|
||||
* Select by id set list.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dispose.mapper.DisposeTaskMapper">
|
||||
<resultMap id="dispose_task" type="com.dispose.pojo.entity.DisposeTask">
|
||||
<resultMap id="dispose_task_map" type="com.dispose.pojo.entity.DisposeTask">
|
||||
<id column="id" property="id"/>
|
||||
<id column="deviceId" property="deviceId"/>
|
||||
<id column="accountId" property="accountId"/>
|
||||
|
@ -37,7 +37,16 @@
|
|||
FROM dispose_task d
|
||||
</select>
|
||||
|
||||
<select id="selectByIdSet" resultMap="dispose_task">
|
||||
<select id="selectPageById" resultType="com.dispose.pojo.entity.DisposeTask">
|
||||
SELECT *
|
||||
FROM dispose_task d
|
||||
WHERE id IN
|
||||
<foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectByIdSet" resultMap="dispose_task_map">
|
||||
SELECT dt.*,
|
||||
ti.id t_id,
|
||||
ti.taskId taskId,
|
||||
|
@ -60,7 +69,7 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultMap="dispose_task">
|
||||
<select id="selectAll" resultMap="dispose_task_map">
|
||||
SELECT dt.*,
|
||||
ti.id t_id,
|
||||
ti.taskId taskId,
|
||||
|
@ -79,7 +88,7 @@
|
|||
LEFT JOIN device_task ti on dt.id = ti.taskId
|
||||
</select>
|
||||
|
||||
<select id="getDisposeTaskById" resultMap="dispose_task">
|
||||
<select id="getDisposeTaskById" resultMap="dispose_task_map">
|
||||
SELECT dt.*,
|
||||
ti.id t_id,
|
||||
ti.taskId taskId,
|
||||
|
@ -99,7 +108,7 @@
|
|||
WHERE dt.id = #{taskId}
|
||||
</select>
|
||||
|
||||
<select id="getRunningTask" resultMap="dispose_task">
|
||||
<select id="getRunningTask" resultMap="dispose_task_map">
|
||||
SELECT dt.*, ti.*
|
||||
FROM dispose_task dt LEFT JOIN device_task ti on dt.id = ti.taskId
|
||||
WHERE
|
||||
|
|
Loading…
Reference in New Issue