QueryWf9Fallback.java 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import java.sql.*;
  2. public class QueryWf9Fallback {
  3. public static void main(String[] args) throws Exception {
  4. String url = "jdbc:mysql://cq-cdb-8fjmemkb.sql.tencentcdb.com:27220/fs_tenant_cs1"
  5. + "?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8";
  6. try (Connection c = DriverManager.getConnection(url, "root", "Ylrz_1q2w3e4r5t6y");
  7. Statement st = c.createStatement()) {
  8. System.out.println("=== workflow 9 meta ===");
  9. try (ResultSet rs = st.executeQuery(
  10. "SELECT id, template_code, template_name, status, LEFT(canvas_data,200) cd "
  11. + "FROM company_workflow_lobster WHERE id=9")) {
  12. while (rs.next()) {
  13. System.out.printf("id=%s code=%s name=%s status=%s%n cd=%s%n",
  14. rs.getString("id"), rs.getString("template_code"),
  15. rs.getString("template_name"), rs.getString("status"), rs.getString("cd"));
  16. }
  17. }
  18. System.out.println("\n=== wf9 nodes ===");
  19. try (ResultSet rs = st.executeQuery(
  20. "SELECT node_code, node_name, node_type, LEFT(message_template,100) mt "
  21. + "FROM company_workflow_lobster_node WHERE workflow_id=9 AND del_flag=0 ORDER BY sort_no")) {
  22. while (rs.next()) {
  23. System.out.printf("%s %s t=%s | %s%n",
  24. rs.getString("node_code"), rs.getString("node_name"),
  25. rs.getString("node_type"), rs.getString("mt"));
  26. }
  27. }
  28. System.out.println("\n=== fallback with confirm text ===");
  29. try (ResultSet rs = st.executeQuery(
  30. "SELECT prompt_key, prompt_content FROM lobster_system_prompt "
  31. + "WHERE prompt_key LIKE '%fallback%' "
  32. + "AND prompt_content LIKE '%确认%' LIMIT 20")) {
  33. while (rs.next()) {
  34. System.out.println(rs.getString("prompt_key") + " => " + rs.getString("prompt_content"));
  35. }
  36. }
  37. System.out.println("\n=== all prompts with shao deng ===");
  38. try (ResultSet rs = st.executeQuery(
  39. "SELECT prompt_key, prompt_content FROM lobster_system_prompt "
  40. + "WHERE prompt_content LIKE '%稍等%' LIMIT 15")) {
  41. while (rs.next()) {
  42. System.out.println(rs.getString("prompt_key") + " => " + rs.getString("prompt_content"));
  43. }
  44. }
  45. System.out.println("\n=== nodes with customerName template ===");
  46. try (ResultSet rs = st.executeQuery(
  47. "SELECT workflow_id, node_code, message_template FROM company_workflow_lobster_node "
  48. + "WHERE message_template LIKE '%customerName%' LIMIT 10")) {
  49. while (rs.next()) {
  50. System.out.printf("wf=%s %s => %s%n",
  51. rs.getString("workflow_id"), rs.getString("node_code"), rs.getString("message_template"));
  52. }
  53. }
  54. }
  55. }
  56. }