Skip to content

Commit

Permalink
php table ..
Browse files Browse the repository at this point in the history
  • Loading branch information
brucexx committed Jul 23, 2018
1 parent b8a5513 commit 3e162d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/route/com/baidu/hsb/route/util/SqlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ private static String replaceSqlTb(String sql, String tb, String logic) {
String s = sql.substring(eIdx, eIdx + 1);
String s1 = sql.substring(sIdx - 1, sIdx);
if ((s.equals(",") || s.equals(".") || s.equals(" ") || s.equals("\t")
|| s.equals("\r") || s.equals("\n") || s.equals("("))
|| s.equals("\r") || s.equals("\n") || s.equals("(") || s.equals("`"))
&& (s1.equals(",") || s1.equals(".") || s1.equals(" ") || s1.equals("\t")
|| s1.equals("\r") || s1.equals("\n"))) {
|| s1.equals("\r") || s1.equals("\n"))|| s1.equals("`")) {
m.appendReplacement(sb, logic);
}
}
Expand All @@ -168,6 +168,8 @@ public static void main(String args[]) {
// System.out.println(replaceSqlTb(sql, "trans_tb", "trans_tb1") + "-->");
System.out.println(replaceSqlTb("insert into t_crowdfunding_trans(id) values('22')",
"t_crowdfunding_trans", "t_crowdfunding_trans_55_6"));
System.out.println(replaceSqlTb("select count(*) from `keyword`",
"keyword", "keyword_01"));

}
}

0 comments on commit 3e162d5

Please sign in to comment.