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(), ",");
|
}
|
}
|