mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-13 05:59:01 +08:00
♻️ Refactoring code. 数据权限 DataScope.java 增加链式操作方便使用
This commit is contained in:
1 parent
73c6fa415d
commit
c5f291943e
7 files changed
+36
-14
No files matched your search
+27
@@ -56,4 +56,31 @@ public class DataScope extends HashMap {
|
||||
*/
|
||||
private DataScopeFuncEnum func = DataScopeFuncEnum.ALL;
|
||||
|
||||
/**
|
||||
* of 获取实例
|
||||
*/
|
||||
public static DataScope of() {
|
||||
return new DataScope();
|
||||
}
|
||||
|
||||
public DataScope scopeName(String scopeName) {
|
||||
this.scopeName = scopeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataScope deptIds(List<Long> deptIds) {
|
||||
this.deptIds = deptIds;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataScope only(boolean isOnly) {
|
||||
this.isOnly = isOnly;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataScope func(DataScopeFuncEnum func) {
|
||||
this.func = func;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class SelectCountByScope extends AbstractMethod {
|
||||
this.sqlComment());
|
||||
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
|
||||
|
||||
return this.addSelectMappedStatementForOther(mapperClass, sqlSource, Integer.class);
|
||||
return this.addSelectMappedStatementForOther(mapperClass, sqlSource, Long.class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user