yangys
2024-04-01 14f1953b1944b3e53d8312e151902c4695faa2e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.qianwen.core.datascope.constant;
 
import com.qianwen.core.tool.utils.StringUtil;
 
/* loaded from: blade-starter-datascope-9.3.0.1-SNAPSHOT.jar:org/springblade/core/datascope/constant/DataScopeConstant.class */
public interface DataScopeConstant {
    public static final String DEFAULT_COLUMN = "create_dept";
    public static final String DATA_BY_DEPT = "select id from blade_dept where ancestors like concat(concat('%', ?),'%') and is_deleted = 0";
    public static final String DATA_BY_CODE = "select resource_code, scope_column, scope_field, scope_type, scope_value from blade_scope_data where resource_code\t = ?";
 
    static String dataByMapper(int size) {
        return "select resource_code, scope_column, scope_field, scope_type, scope_value from blade_scope_data where scope_class = ? and id in (select scope_id from blade_dept_scope where scope_category = 1 and dept_id in (" + buildHolder(size) + "))";
    }
 
    static String dataByCode(int size) {
        return "select resource_code, scope_column, scope_field, scope_type, scope_value from blade_scope_data where resource_code = ? and id in (select scope_id from blade_dept_scope where scope_category = 1 and dept_id in (" + buildHolder(size) + "))";
    }
 
    static String buildHolder(int size) {
        StringBuilder builder = StringUtil.builder();
        for (int i = 0; i < size; i++) {
            builder.append("?,");
        }
        return StringUtil.removeSuffix(builder.toString(), ",");
    }
}