| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.JSONPath; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.java110.core.factory.DataTransactionFactory; |
| | | import com.java110.db.dao.IQueryServiceDAO; |
| | | import com.java110.entity.service.ServiceSql; |
| | |
| | | List<String> columns = new ArrayList<>(); |
| | | Interpreter interpreter = new Interpreter(); |
| | | interpreter.eval(javaCode); |
| | | interpreter.set("params", params.toJSONString()); |
| | | interpreter.set("params", params); |
| | | interpreter.set("queryServiceDAOImpl",queryServiceDAOImpl); |
| | | JSONObject results = JSONObject.parseObject(interpreter.eval("execute(params,queryServiceDAOImpl)").toString()); |
| | | JSONObject results = JSONObject.parseObject(interpreter.eval("execute(params,queryServiceDAOImpl)").toString(), Feature.OrderedField); |
| | | |
| | | JSONArray data = null; |
| | | if (results == null || results.size() < 1) { |
| | |
| | | } |
| | | |
| | | JSONArray th = new JSONArray(); |
| | | for (String key : data.getJSONObject(0).keySet()) { |
| | | th.add(key); |
| | | if(data.size()>0) { |
| | | for (String key : data.getJSONObject(0).keySet()) { |
| | | th.add(key); |
| | | } |
| | | } |
| | | JSONObject paramOut = new JSONObject(); |
| | | paramOut.put("th", th); |