From c5dbd04c9c99fc187ef526c0fda188dc30e51825 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期二, 14 十二月 2021 10:11:16 +0800 Subject: [PATCH] fix 修复数据权限 仅自己 相关问题 --- ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java index f99413b..5ae69ec 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java @@ -23,34 +23,39 @@ /** * 鍏ㄩ儴鏁版嵁鏉冮檺 */ - ALL("1", ""), + ALL("1", "", ""), /** * 鑷畾鏁版嵁鏉冮檺 */ - CUSTOM("2", " #{#deptName} IN ( #{@sdss.getRoleCustom( #user.roleId )} ) "), + CUSTOM("2", " #{#deptName} IN ( #{@sdss.getRoleCustom( #user.roleId )} ) ", ""), /** * 閮ㄩ棬鏁版嵁鏉冮檺 */ - DEPT("3", " #{#deptName} = #{#user.deptId} "), + DEPT("3", " #{#deptName} = #{#user.deptId} ", ""), /** * 閮ㄩ棬鍙婁互涓嬫暟鎹潈闄� */ - DEPT_AND_CHILD("4", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} )"), + DEPT_AND_CHILD("4", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} )", ""), /** * 浠呮湰浜烘暟鎹潈闄� */ - SELF("5", " #{#userName?:1} = #{#user.userId} "); + SELF("5", " #{#userName} = #{#user.userId} " , " 1 = 0 "); private final String code; /** * 璇硶 閲囩敤 spel 妯℃澘琛ㄨ揪寮� */ - private final String sql; + private final String sqlTemplate; + + /** + * 涓嶆弧瓒� sqlTemplate 鍒欏~鍏� + */ + private final String elseSql; public static DataScopeType findCode(String code) { if (StringUtils.isBlank(code)) { -- Gitblit v1.9.3