pull/59/head
shao1121353141 2023-09-26 21:34:28 +08:00
parent fd3827e3f3
commit afd373f8a0
2 changed files with 4 additions and 6 deletions

View File

@ -161,7 +161,7 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("subjectIds", paramList);
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() + "')");
return namedParameterJdbcTemplate.queryForObject(builder.toString(), paramMap, Long.class);
//@formatter:off

View File

@ -58,13 +58,11 @@ public class AppController {
*/
@Operation(summary = "获取应用数量")
@GetMapping(value = "/count")
public ApiRestResult<String> getAppCount(String groupId) {
public ApiRestResult<String> getAppCount() {
Long count;
if (StringUtils.isEmpty(groupId)) {
count = appService.getAppCount();
} else {
count = appService.getAppCount(groupId);
}
return ApiRestResult.ok(count.toString());
}