From 11ec7a669a4f8cd0d4422205361418adf6030315 Mon Sep 17 00:00:00 2001 From: Sxile <3440626@qq.com> Date: Mon, 20 Jul 2020 18:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=98=E6=96=B9=E4=BB=A3=E7=A0=81=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/framework/aspectj/DataScopeAspect.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java index fea0f4c2..a73ba251 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java @@ -17,7 +17,7 @@ import com.ruoyi.system.domain.SysUser; /** * 数据过滤处理 - * + * * @author ruoyi */ @Aspect @@ -89,7 +89,7 @@ public class DataScopeAspect /** * 数据范围过滤 - * + * * @param joinPoint 切点 * @param user 用户 * @param deptAlias 部门别名 @@ -120,7 +120,7 @@ public class DataScopeAspect else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { sqlString.append(StringUtils.format( - " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", + " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or CHARINDEX(cast( {} as nvarchar),ancestors)>0 )", deptAlias, user.getDeptId(), user.getDeptId())); } else if (DATA_SCOPE_SELF.equals(dataScope))