|
|
@@ -210,10 +210,7 @@ public class RestJdbcTemplate {
|
|
|
* @return
|
|
|
*/
|
|
|
public String generateCode(String sequenceName, int type) {
|
|
|
- Map<String, Object> data = callForMap("{call Sp_GetMaxNumber(?,?,?)}", new Object[]{sequenceName, type},
|
|
|
- new String[]{"code"});
|
|
|
- Object code = null == data ? null : data.get("code");
|
|
|
- return null == code ? null : code.toString();
|
|
|
+ return callForString("{call Sp_GetMaxNumber(?,?,?)}", sequenceName, type);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -268,4 +265,16 @@ public class RestJdbcTemplate {
|
|
|
throw new RuntimeException(result.getMessage());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * call procedure and return string
|
|
|
+ * @param exec
|
|
|
+ * @param args
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String callForString(String exec, Object... args) {
|
|
|
+ Map<String, Object> data = callForMap(exec, args, new String[]{"v_return"});
|
|
|
+ Object code = null == data ? null : data.get("v_return");
|
|
|
+ return null == code ? null : code.toString();
|
|
|
+ }
|
|
|
+
|
|
|
}
|