@Test public void testIgnoreReplace() { String right = "select * from AA where B=1 and a=true order by C"; String sql = "SELECT * FROM AA WHERE B=1 and a=true ORDER BY C"; Assert.assertEquals(right, innerDealSql(sql)); sql = "Select * frOm AA whEre B=1 and a=true orDer bY C"; Assert.assertEquals(right, innerDealSql(sql)); }
private String innerDealSql(String sql) { if (sql == null) return sql; return sql.replaceAll("(?i)select", "select") .replaceAll("(?i)from", "from") .replaceAll("(?i)where", "where") .replaceAll("(?i)order by", "order by") .replaceAll("(?i)group by", "group by"); }
SqlObject extends PagingQueryConfig { private String innerDealSql(String sql) { if (sql == null) return sql; return sql.replaceAll("(?i)select", "select") .replaceAll("(?i)from", "from") .replaceAll("(?i)where", "where") .replaceAll("(?i)order by", "order by") .replaceAll("(?i)group by", "group by"); } }
SqlObject extends PagingQueryConfig { private String innerDealSql(String sql) { if (sql == null) return sql; return sql.replaceAll("(?i)select", "select") .replaceAll("(?i)from", "from") .replaceAll("(?i)where", "where") .replaceAll("(?i)order by", "order by") .replaceAll("(?i)group by", "group by"); } SqlObject();  SqlObject(String sql, List<Object> args); }
SqlObject extends PagingQueryConfig { private String innerDealSql(String sql) { if (sql == null) return sql; return sql.replaceAll("(?i)select", "select") .replaceAll("(?i)from", "from") .replaceAll("(?i)where", "where") .replaceAll("(?i)order by", "order by") .replaceAll("(?i)group by", "group by"); } SqlObject();  SqlObject(String sql, List<Object> args); String getNativeSql(Condition condition); String getNativeSql(); String getSql(Condition condition); String getSql(); SqlObject<T> setSql(String sql); RowMapper<T> getRowMapper(); SqlObject<T> setRowMapper(RowMapper<T> rowMapper); SqlObject<T> setSelect(String select); String getSelect(); String getFrom(); SqlObject<T> setFrom(String from); SqlObject<T> setWhere(String where); void setGroupBy(String groupBy); SqlObject<T> setOrderBy(String orderBy); String getCountSql(Condition condition); String getFromWhereSql(Condition condition); String getFromWhereSql(); static String removeOrderBy(String queryString); static String removeSelect(String queryString); List<Object> getArgs(); SqlObject<T> setArgs(List<Object> args); @Override List<Object> getTotalnumQueryParams(Condition condition); @Override String getQueryString(Condition condition); @Override String getTotalnumQueryString(Condition condition); }
SqlObject extends PagingQueryConfig { private String innerDealSql(String sql) { if (sql == null) return sql; return sql.replaceAll("(?i)select", "select") .replaceAll("(?i)from", "from") .replaceAll("(?i)where", "where") .replaceAll("(?i)order by", "order by") .replaceAll("(?i)group by", "group by"); } SqlObject();  SqlObject(String sql, List<Object> args); String getNativeSql(Condition condition); String getNativeSql(); String getSql(Condition condition); String getSql(); SqlObject<T> setSql(String sql); RowMapper<T> getRowMapper(); SqlObject<T> setRowMapper(RowMapper<T> rowMapper); SqlObject<T> setSelect(String select); String getSelect(); String getFrom(); SqlObject<T> setFrom(String from); SqlObject<T> setWhere(String where); void setGroupBy(String groupBy); SqlObject<T> setOrderBy(String orderBy); String getCountSql(Condition condition); String getFromWhereSql(Condition condition); String getFromWhereSql(); static String removeOrderBy(String queryString); static String removeSelect(String queryString); List<Object> getArgs(); SqlObject<T> setArgs(List<Object> args); @Override List<Object> getTotalnumQueryParams(Condition condition); @Override String getQueryString(Condition condition); @Override String getTotalnumQueryString(Condition condition);  }