|
楼主 |
发表于 2021-11-9 13:14:07
|
显示全部楼层
- //JAVA端
- public static JSONObject getConceptByTableName(String tableName,String COLUMN_NAME){
- // com.justep.model.Concept c = (Concept)ModelUtils.getModelObjectByFullName("/PMS/subContractManage/ontology/" + tableName, Concept.TYPE);
- // com.justep.model.Relation relation = c.getRelation("fProjectItemMemo");
- // String cd1 = relation.getSize();
- // System.out.println("cd1"+cd1);
- // System.out.println("tableName"+tableName);
- JSONObject result = new JSONObject();
- String sql =
- "select Distinct '"+tableName+"' COLUMN_NAME,\n" +
- " a.DATA_TYPE,\n" +
- " DATA_LENGTH,\n" +
- " b.COMMENTS\n" +
- " from user_tab_columns a, user_col_comments b\n" +
- " where a.TABLE_NAME = b.table_name\n" +
- " and a.COLUMN_NAME = b.column_name\n" +
- " and a.table_name = upper('"+tableName+"')\n" +
- " and a.COLUMN_NAME = upper('"+COLUMN_NAME+"')";
- Table table = SQL.select(sql, null, "/PMS/common/data", null);
- result.put("tableData",table);
- return result;
- }
- //前端
- isDataColumnOverlengthByDB : function(dataName,columnName) {
- var params = new biz.Request.ActionParam();
- params.setString("tableName",dataName);
- params.setString("COLUMN_NAME",columnName);
- var options = {};
- options.context = this.getContext();
- options.parameters = params;
- options.action = "getConceptByTableNameAction";
- options.callback = function(ev) {
- if (ev) {
- console.info("ev",ev);
- if (ev.response && ev.response.tableData && ev.response.tableData.rows[0]){
- return ev.response.tableData.rows[0];
- }
- } else {
- biz.Request.errorMessage(options.action, "执行失败", null, null);
- }
- }
- biz.Request.sendBizRequest(options);
- },
复制代码
|
|