mirror of https://gitee.com/topiam/eiam
更改方法名
parent
7ab61954e2
commit
97c7b7c703
|
@ -117,7 +117,7 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto
|
||||||
public List<AppGroupPO> getAppGroupList(Long userId, AppGroupQuery query) {
|
public List<AppGroupPO> getAppGroupList(Long userId, AppGroupQuery query) {
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
Map<String, Object> paramMap = new HashMap<>(16);
|
Map<String, Object> paramMap = new HashMap<>(16);
|
||||||
paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId));
|
paramMap.put("subjectIds", getSubjectIds(userId));
|
||||||
//@formatter:off
|
//@formatter:off
|
||||||
StringBuilder builder = new StringBuilder("SELECT `group`.id_, `group`.name_, `group`.code_, `group`.type_, `group`.create_time, `group`.remark_, IFNULL( ass.app_count, 0) AS app_count FROM app_group `group` LEFT JOIN(SELECT aga.group_id, COUNT(DISTINCT aga.id_) AS `app_count` FROM app_group_association aga LEFT JOIN app ON aga.app_id = app.id_ AND app.is_deleted = 0 LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id and app_acce.is_deleted = 0 WHERE aga.is_deleted = 0 and (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+ "') GROUP BY aga.group_id ) ass ON `group`.id_ = ass.group_id WHERE is_deleted = '0'");
|
StringBuilder builder = new StringBuilder("SELECT `group`.id_, `group`.name_, `group`.code_, `group`.type_, `group`.create_time, `group`.remark_, IFNULL( ass.app_count, 0) AS app_count FROM app_group `group` LEFT JOIN(SELECT aga.group_id, COUNT(DISTINCT aga.id_) AS `app_count` FROM app_group_association aga LEFT JOIN app ON aga.app_id = app.id_ AND app.is_deleted = 0 LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id and app_acce.is_deleted = 0 WHERE aga.is_deleted = 0 and (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+ "') GROUP BY aga.group_id ) ass ON `group`.id_ = ass.group_id WHERE is_deleted = '0'");
|
||||||
//分组名称
|
//分组名称
|
||||||
|
@ -148,7 +148,7 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto
|
||||||
public Long getAppCount(String groupId, Long userId) {
|
public Long getAppCount(String groupId, Long userId) {
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
Map<String, Object> paramMap = new HashMap<>(16);
|
Map<String, Object> paramMap = new HashMap<>(16);
|
||||||
paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId));
|
paramMap.put("subjectIds", getSubjectIds(userId));
|
||||||
//@formatter:off
|
//@formatter:off
|
||||||
StringBuilder builder = new StringBuilder("SELECT COUNT(DISTINCT app.id_) FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' LEFT JOIN app_group_association ass ON app.id_ = ass.app_id AND ass.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+"')");
|
StringBuilder builder = new StringBuilder("SELECT COUNT(DISTINCT app.id_) FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' LEFT JOIN app_group_association ass ON app.id_ = ass.app_id AND ass.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+"')");
|
||||||
builder.append(" AND ass.group_id = ").append(groupId);
|
builder.append(" AND ass.group_id = ").append(groupId);
|
||||||
|
@ -164,7 +164,7 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto
|
||||||
* @param userId {@link Long}
|
* @param userId {@link Long}
|
||||||
* @return {@link List}
|
* @return {@link List}
|
||||||
*/
|
*/
|
||||||
private List<Object> getAccessPolicysubjectIdsByUserId(Long userId){
|
private List<Object> getSubjectIds(Long userId){
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
List<Object> list = Lists.newArrayList();
|
List<Object> list = Lists.newArrayList();
|
||||||
//当前用户加入的用户组Id
|
//当前用户加入的用户组Id
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized {
|
||||||
@Override
|
@Override
|
||||||
public Page<AppEntity> getAppList(Long userId, GetAppListQuery query, Pageable pageable) {
|
public Page<AppEntity> getAppList(Long userId, GetAppListQuery query, Pageable pageable) {
|
||||||
Map<String, Object> paramMap = new HashMap<>(16);
|
Map<String, Object> paramMap = new HashMap<>(16);
|
||||||
paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId));
|
paramMap.put("subjectIds", getSubjectIds(userId));
|
||||||
//@formatter:off
|
//@formatter:off
|
||||||
StringBuilder builder = new StringBuilder("SELECT DISTINCT app.* FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' LEFT JOIN app_group_association ass ON app.id_ = ass.app_id AND ass.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+"')");
|
StringBuilder builder = new StringBuilder("SELECT DISTINCT app.* FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' LEFT JOIN app_group_association ass ON app.id_ = ass.app_id AND ass.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+"')");
|
||||||
//用户名
|
//用户名
|
||||||
|
@ -139,7 +139,7 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized {
|
||||||
public Long getAppCount(Long userId) {
|
public Long getAppCount(Long userId) {
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
Map<String, Object> paramMap = new HashMap<>(16);
|
Map<String, Object> paramMap = new HashMap<>(16);
|
||||||
paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId));
|
paramMap.put("subjectIds", getSubjectIds(userId));
|
||||||
StringBuilder builder = new StringBuilder(
|
StringBuilder builder = new StringBuilder(
|
||||||
"SELECT COUNT(DISTINCT app.id_) FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"
|
"SELECT COUNT(DISTINCT app.id_) FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"
|
||||||
+ ALL_ACCESS.getCode() + "')");
|
+ ALL_ACCESS.getCode() + "')");
|
||||||
|
@ -154,7 +154,7 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized {
|
||||||
* @param userId {@link Long}
|
* @param userId {@link Long}
|
||||||
* @return {@link List}
|
* @return {@link List}
|
||||||
*/
|
*/
|
||||||
private List<Object> getAccessPolicysubjectIdsByUserId(Long userId){
|
private List<Object> getSubjectIds(Long userId){
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
List<Object> list = Lists.newArrayList();
|
List<Object> list = Lists.newArrayList();
|
||||||
//当前用户加入的用户组Id
|
//当前用户加入的用户组Id
|
||||||
|
|
Loading…
Reference in New Issue