修复查询出未发布的任务

This commit is contained in:
2025-11-28 18:17:30 +08:00
parent 8a8059d05b
commit ba0aabdac3
2 changed files with 33 additions and 7 deletions

View File

@@ -435,7 +435,7 @@ public class SCLearningTaskServiceImpl implements LearningTaskService {
// 找出要删除的用户关联
List<String> userIDsToDelete = existingUserMap.values().stream()
.filter(taskUser -> !newUserIDs.contains(taskUser.getUserID()))
.map(TbTaskUser::getID)
.map(TbTaskUser::getId)
.collect(Collectors.toList());
if (!userIDsToDelete.isEmpty()) {

View File

@@ -64,9 +64,22 @@
<!-- selectTaskUsers -->
<select id="selectTaskUsers" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM tb_task_user
<include refid="Where_Clause"/>
ttu.*
FROM tb_task_user ttu
INNER JOIN tb_learning_task tlt ON ttu.task_id = tlt.task_id AND tlt.status = 1
WHERE 1=1
<if test="taskID != null and taskID != ''">
AND ttu.task_id = #{taskID}
</if>
<if test="userID != null and userID != ''">
AND ttu.user_id = #{userID}
</if>
<if test="deptID != null and deptID != ''">
AND ttu.dept_id = #{deptID}
</if>
<if test="status != null">
AND ttu.status = #{status}
</if>
ORDER BY create_time DESC
</select>
@@ -249,9 +262,22 @@
<!-- 分页查询任务用户关联 -->
<select id="selectTaskUsersPage" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM tb_task_user
<include refid="Where_Clause" />
ttu.*
FROM tb_task_user ttu
INNER JOIN tb_learning_task tlt on ttu.task_id = tlt.task_id AND tlt.status=1
WHERE 1=1
<if test="taskID != null and taskID != ''">
AND ttu.task_id = #{taskID}
</if>
<if test="userID != null and userID != ''">
AND ttu.user_id = #{userID}
</if>
<if test="deptID != null and deptID != ''">
AND ttu.dept_id = #{deptID}
</if>
<if test="status != null">
AND ttu.status = #{status}
</if>
ORDER BY create_time DESC
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.offset}
</select>