@@ -57,11 +57,11 @@ public void buildSql(String tableName, List<String> fields) {
5757
5858 private void buildInsertSql (String tableName , List <String > fields ) {
5959
60- tableName = DtStringUtil .addQuoteForTableName (tableName );
60+ tableName = DtStringUtil .addQuoteForStr (tableName );
6161 String sqlTmp = "insert into " + tableName + " (${fields}) values (${placeholder})" ;
6262
6363 List <String > adaptFields = Lists .newArrayList ();
64- fields .forEach (field -> adaptFields .add (DtStringUtil .addQuoteForColumn (field )));
64+ fields .forEach (field -> adaptFields .add (DtStringUtil .addQuoteForStr (field )));
6565
6666 String fieldsStr = StringUtils .join (adaptFields , "," );
6767 String placeholder = "" ;
@@ -84,7 +84,7 @@ private void buildInsertSql(String tableName, List<String> fields) {
8484 */
8585 @ Override
8686 public String buildUpdateSql (String tableName , List <String > fieldNames , Map <String , List <String >> realIndexes , List <String > fullField ) {
87- tableName = DtStringUtil .addQuoteForTableName (tableName );
87+ tableName = DtStringUtil .addQuoteForStr (tableName );
8888 StringBuilder sb = new StringBuilder ();
8989
9090 sb .append ("MERGE INTO " + tableName + " T1 USING "
@@ -112,10 +112,10 @@ public String quoteColumns(List<String> column) {
112112 }
113113
114114 public String quoteColumns (List <String > column , String table ) {
115- String prefix = StringUtils .isBlank (table ) ? "" : DtStringUtil .addQuoteForTableName (table ) + "." ;
115+ String prefix = StringUtils .isBlank (table ) ? "" : DtStringUtil .addQuoteForStr (table ) + "." ;
116116 List <String > list = new ArrayList <>();
117117 for (String col : column ) {
118- list .add (prefix + DtStringUtil .addQuoteForColumn (col ));
118+ list .add (prefix + DtStringUtil .addQuoteForStr (col ));
119119 }
120120 return StringUtils .join (list , "," );
121121 }
@@ -148,18 +148,18 @@ protected List<String> keyColList(Map<String, List<String>> realIndexes) {
148148 * @return
149149 */
150150 public String getUpdateSql (List <String > updateColumn , List <String > fullColumn , String leftTable , String rightTable , List <String > indexCols ) {
151- String prefixLeft = StringUtils .isBlank (leftTable ) ? "" : DtStringUtil .addQuoteForTableName (leftTable ) + "." ;
152- String prefixRight = StringUtils .isBlank (rightTable ) ? "" : DtStringUtil .addQuoteForTableName (rightTable ) + "." ;
151+ String prefixLeft = StringUtils .isBlank (leftTable ) ? "" : DtStringUtil .addQuoteForStr (leftTable ) + "." ;
152+ String prefixRight = StringUtils .isBlank (rightTable ) ? "" : DtStringUtil .addQuoteForStr (rightTable ) + "." ;
153153 List <String > list = new ArrayList <>();
154154 for (String col : fullColumn ) {
155155 // filter index column
156156 if (indexCols == null || indexCols .size () == 0 || containsIgnoreCase (indexCols ,col )) {
157157 continue ;
158158 }
159159 if (containsIgnoreCase (updateColumn ,col )) {
160- list .add (prefixLeft + DtStringUtil .addQuoteForColumn (col ) + "=" + prefixRight + DtStringUtil .addQuoteForColumn (col ));
160+ list .add (prefixLeft + DtStringUtil .addQuoteForStr (col ) + "=" + prefixRight + DtStringUtil .addQuoteForStr (col ));
161161 } else {
162- list .add (prefixLeft + DtStringUtil .addQuoteForColumn (col ) + "=null" );
162+ list .add (prefixLeft + DtStringUtil .addQuoteForStr (col ) + "=null" );
163163 }
164164 }
165165 return StringUtils .join (list , "," );
@@ -176,7 +176,7 @@ public String updateKeySql(Map<String, List<String>> updateKey) {
176176 for (Map .Entry <String , List <String >> entry : updateKey .entrySet ()) {
177177 List <String > colList = new ArrayList <>();
178178 for (String col : entry .getValue ()) {
179- colList .add ("T1." + DtStringUtil .addQuoteForColumn (col ) + "=T2." + DtStringUtil .addQuoteForColumn (col ));
179+ colList .add ("T1." + DtStringUtil .addQuoteForStr (col ) + "=T2." + DtStringUtil .addQuoteForStr (col ));
180180 }
181181 exprList .add (StringUtils .join (colList , " AND " ));
182182 }
@@ -195,7 +195,7 @@ public String makeValues(List<String> column) {
195195 if (i != 0 ) {
196196 sb .append ("," );
197197 }
198- sb .append ("? " + DtStringUtil .addQuoteForColumn (column .get (i )));
198+ sb .append ("? " + DtStringUtil .addQuoteForStr (column .get (i )));
199199 }
200200 sb .append (" FROM DUAL" );
201201 return sb .toString ();
0 commit comments