47 lines
1.4 KiB
Java
47 lines
1.4 KiB
Java
package com.example.sso.dao;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.example.sso.util.APIUtils;
|
|
|
|
public class SelectPerson {
|
|
public static JSONArray array(Integer xuhao) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
|
JSONArray jsonArray = new JSONArray();
|
|
jsonArray.add("yxname");
|
|
jsonArray.add("yxzd");
|
|
jsonArray.add("xuhao");
|
|
|
|
|
|
|
|
|
|
jsonObject.put("fields", jsonArray);
|
|
JSONObject filter = new JSONObject();
|
|
JSONObject rel = new JSONObject();
|
|
rel.put("rel", "and");
|
|
JSONArray cond = new JSONArray();
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
jsonObject1.put("field", "xuhao");
|
|
jsonObject1.put("method", "eq");
|
|
JSONArray jsonArray1 = new JSONArray();
|
|
jsonArray1.add(xuhao);
|
|
jsonObject1.put("value", jsonArray1);
|
|
cond.add(jsonObject1);
|
|
filter.put("rel", rel);
|
|
filter.put("cond", cond);
|
|
jsonObject.put("filter", filter);
|
|
|
|
String jsonString = jsonObject.toJSONString();
|
|
String select = APIUtils.select(jsonString);
|
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
|
return jsonArray2;
|
|
|
|
|
|
|
|
}
|
|
}
|