---
title: "1. 左侧树（行政维度）统计人员"
docId: "332260490648485888"
source: "https://weapp.eteams.cn/build/techdoc/wdoc/index.html#/public/repository/91f5067f-775e-48f4-93a2-ce84ca0b9c2e/doc/332260490648485888"
---
- 二开标识
  
  ```text
   
  HRM_ORGTREE_002
  
  ```
- 入参说明（Map<String, Object>，从request中获取 params）
  
  | 参数 | 类型 | 说明 |
  | --- | --- | --- |
  | key | string | 固定提供：param |
  | value | bean | 对应的参数信息 |
- param参数说明（bean，自行转map）
  
  | 参数 | 类型 | 说明 |
  | --- | --- | --- |
  | customSqlList | List<String> | 自定义sql; 其中 employee 是 人员表的别名 |
- 返回参数说明（com.weaver.loom.context.domain.WeaHookResponse#setResult）
  
    - 必须提供HashMap，其中需要提供params作为key；value 也是一个hashmap；OA会根据params的内容按照入参支持的key覆盖到标准入参里面，然后进行查询
- 示例
  
  ```java
  public WeaHookResponse handle(WeaHookRequest request, WeaHookResponse response, AppInfo appInfo) throws Exception {
          Map<String, Object> params = request.getParams();
  
          ObjectMapper objectMapper = new ObjectMapper() ;
          Map<String, Object> paramMap = objectMapper.convertValue(
                  params.get("params"), new TypeReference<Map<String, Object>>() {}
          );
          Map<String, Object> param = (Map<String, Object>) paramMap.get("param") ;
          if(param == null) return response ;
  
  
          Map<String,Object> mergeMap = new HashMap<>() ;
  
          List<String> customSqlList = (List<String>) param.computeIfAbsent("customSqlList", k -> new ArrayList<>());
          customSqlList.add(" employee.user_id is not null ") ; // 无账号逻辑
          customSqlList.add(" employee.username !='sysadmin'") ; // 过滤那些账号
  
          mergeMap.put("customSqlList",customSqlList) ; // 添加自定义sql
  
          HashMap<Object, Object> result = new HashMap<>();
          result.put("params",mergeMap) ;
          response.setResult(result);
          return response;
      }
  ```
