diff --git a/src/main/resources/mapper/TaskMapper.xml b/src/main/resources/mapper/TaskMapper.xml index 8aefa65..93c5839 100644 --- a/src/main/resources/mapper/TaskMapper.xml +++ b/src/main/resources/mapper/TaskMapper.xml @@ -57,8 +57,11 @@ and IF((SELECT count(*)!=0 FROM taskDepartment WHERE taskId = t1.id)>0, - t1.id in (SELECT taskId from taskDepartment inner JOIN user on user.openid =#{openid} - and user.main_department = taskDepartment.departmentId), + t1.id in + + + (SELECT taskId from taskDepartment WHERE departmentId in + (SELECT departmentId from qywxDepartmentUserLink WHERE openid = #{openid}) GROUP BY taskId), 1=1)