From 868942e202aeb967b8ce47b38cc2433a636a128d Mon Sep 17 00:00:00 2001 From: phanes <5411232+phanes@user.noreply.gitee.com> Date: 星期日, 16 一月 2022 17:46:24 +0800 Subject: [PATCH] update 格式化代码结构 统一编码格式 --- ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 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..58bc761 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 @@ -6,15 +6,16 @@ /** * 鏁版嵁鏉冮檺绫诲瀷 - * + * <p> * 璇硶鏀寔 spel 妯℃澘琛ㄨ揪寮� - * + * <p> * 鍐呯疆鏁版嵁 user 褰撳墠鐢ㄦ埛 鍐呭鍙傝�� SysUser - * 濡傞渶鎵╁睍鏁版嵁 闇�寰� SysUser 鍐呮敞鍏� + * 濡傞渶鎵╁睍鏁版嵁 鍙娇鐢� {@link com.ruoyi.common.helper.DataPermissionHelper} 鎿嶄綔 * 鍐呯疆鏈嶅姟 sdss 绯荤粺鏁版嵁鏉冮檺鏈嶅姟 鍐呭鍙傝�� SysDataScopeService * 濡傞渶鎵╁睍鏇村鑷畾涔夋湇鍔� 鍙互鍙傝�� sdss 鑷缂栧啓 * * @author Lion Li + * @version 3.5.0 */ @Getter @AllArgsConstructor @@ -23,34 +24,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