Commit 580d203c authored by W_Y's avatar W_Y

查询待办任务列表修改&查询已办任务列表

parent 86f4cc6b
...@@ -20,11 +20,18 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang ...@@ -20,11 +20,18 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang
List<ReviewSceneChangeTask> findLastChangeByTaskId(@Param("taskId") Long taskId); List<ReviewSceneChangeTask> findLastChangeByTaskId(@Param("taskId") Long taskId);
/** /**
* 根据任务状态和用户ID查询列表 * 根据用户ID查询待办列表
* @param taskStatus * @param userId
* @return * @return
*/ */
List<ReviewSceneChangeTask> findListByUserIdAndStatus(@Param("userId") Long userId, @Param("taskStatus") String taskStatus); List<ReviewSceneChangeTask> findPendingListByUserId(@Param("userId") Long userId);
/**
* 根据用户ID查询已办列表
* @param userId
* @return
*/
List<ReviewSceneChangeTask> findFinishListByUserId(@Param("userId") Long userId);
} }
......
...@@ -46,11 +46,17 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange ...@@ -46,11 +46,17 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
List<ReviewSceneChangeTask> findLastChangeByTaskId(Long taskId); List<ReviewSceneChangeTask> findLastChangeByTaskId(Long taskId);
/** /**
* 根据用户ID和任务状态查询列表 * 根据用户ID查询待办列表
* @param userId * @param userId
* @param taskStatus
* @return * @return
*/ */
List<ReviewSceneChangeTask> findListByUserIdAndStatus(Long userId, String taskStatus); List<ReviewSceneChangeTask> findPendingListByUserId(Long userId);
/**
* 根据用户ID查询已办列表
* @param userId
* @return
*/
List<ReviewSceneChangeTask> findFinishListByUserId(Long userId);
} }
...@@ -185,14 +185,24 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -185,14 +185,24 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
} }
/** /**
* 根据用户ID和任务状态查询列表 * 根据用户ID查询待办列表
* @param userId * @param userId
* @param taskStatus
* @return * @return
*/ */
@Override @Override
public List<ReviewSceneChangeTask> findListByUserIdAndStatus(Long userId, String taskStatus) { public List<ReviewSceneChangeTask> findPendingListByUserId(Long userId) {
List<ReviewSceneChangeTask> reviewSceneChangeTask = reviewSceneChangeTaskMapper.findListByUserIdAndStatus(userId,taskStatus); List<ReviewSceneChangeTask> reviewSceneChangeTask = reviewSceneChangeTaskMapper.findPendingListByUserId(userId);
return reviewSceneChangeTask;
}
/**
* 根据用户ID查询已办列表
* @param userId
* @return
*/
@Override
public List<ReviewSceneChangeTask> findFinishListByUserId(Long userId) {
List<ReviewSceneChangeTask> reviewSceneChangeTask = reviewSceneChangeTaskMapper.findFinishListByUserId(userId);
return reviewSceneChangeTask; return reviewSceneChangeTask;
} }
......
...@@ -39,12 +39,28 @@ public class ReviewSceneChangeTaskController extends BaseController { ...@@ -39,12 +39,28 @@ public class ReviewSceneChangeTaskController extends BaseController {
return success(); return success();
} }
/**
* 根据用户ID查询待办列表
* @return
*/
@Trace @Trace
@Log(title = "待办任务列表") @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findPending") @RequestMapping(method = RequestMethod.POST, value = "/findPending")
public TableDataInfo findPending() { public TableDataInfo findPending() {
startPage(); startPage();
return getDataTable(reviewSceneChangeTaskService.findListByUserIdAndStatus(getUserId(),ReviewSceneChangeTask.STATUS_PENDING)); return getDataTable(reviewSceneChangeTaskService.findPendingListByUserId(getUserId()));
}
/**
* 根据用户ID查询已办列表
* @return
*/
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findFinish")
public TableDataInfo findFinish() {
startPage();
return getDataTable(reviewSceneChangeTaskService.findFinishListByUserId(getUserId()));
} }
} }
...@@ -29,10 +29,15 @@ ...@@ -29,10 +29,15 @@
) )
</select> </select>
<select id="findListByUserIdAndStatus" resultType="com.ruoyi.domain.ReviewSceneChangeTask"> <select id="findPendingListByUserId" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
SELECT sct.* FROM t_review_scene_change_task sct SELECT sct.* FROM t_review_scene_change_task sct
LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id
WHERE sctu.user_id = #{userId} and sct.task_status = #{taskStatus} WHERE sctu.user_id = #{userId} and sctu.decision IS NULL
</select>
<select id="findFinishListByUserId" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
SELECT sct.* FROM t_review_scene_change_task sct
LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id
WHERE sctu.user_id = #{userId} and sctu.decision IS NOT NULL
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment