|
楼主 |
发表于 2016-8-24 11:25:23
|
显示全部楼层
Java方法:
public static JSONObject getExchangeMoreCount(JSONObject params, ActionContext context) throws SQLException, NamingException {
String searchCondition = params.getString("searchCondition");
Connection conn = context.getConnection(DATASOURCE_CRZD);
try {
String sql = "SELECT sum(cast(StockCount as int)) FROM V_ReceiveSubNewS where " + searchCondition;
JSONObject ret = new JSONObject();
int count = Integer.parseInt(DataUtils.getValueBySQL(conn, sql, null).toString());
ret.put("count", count);
return ret;
} finally {
conn.close();
}
} |
|