|
52 | 52 | import java.util.concurrent.ScheduledFuture; |
53 | 53 | import java.util.concurrent.ScheduledThreadPoolExecutor; |
54 | 54 | import java.util.concurrent.TimeUnit; |
| 55 | +import java.util.concurrent.atomic.AtomicReference; |
55 | 56 | import java.util.regex.Matcher; |
56 | 57 | import java.util.regex.Pattern; |
57 | 58 | import java.util.stream.Collectors; |
@@ -370,9 +371,11 @@ private String valueConditionAddQuotation(String valueCondition) { |
370 | 371 | String value = matcher.group(1); |
371 | 372 | String type = matcher.group(2); |
372 | 373 |
|
373 | | - if (Arrays.asList(NEED_QUOTE_TYPE).contains(type)) { |
374 | | - if (!"null".equals(value)) { |
375 | | - item = item.replace(value, "'" + value + "'"); |
| 374 | + for (String needQuoteType : NEED_QUOTE_TYPE) { |
| 375 | + if (type.contains(needQuoteType)) { |
| 376 | + if (!"null".equals(value)) { |
| 377 | + item = item.replace(value, "'" + value + "'"); |
| 378 | + } |
376 | 379 | } |
377 | 380 | } |
378 | 381 | } |
@@ -580,8 +583,10 @@ private String buildTableFieldsCondition(List<String> fieldNames, String partiti |
580 | 583 | private String buildValuesCondition(List<String> fieldTypes, Row row) { |
581 | 584 | String valuesCondition = fieldTypes.stream().map( |
582 | 585 | f -> { |
583 | | - if (Arrays.asList(NEED_QUOTE_TYPE).contains(f.toLowerCase())) { |
584 | | - return String.format("cast(? as %s)", f.toLowerCase()); |
| 586 | + for(String item : NEED_QUOTE_TYPE) { |
| 587 | + if (f.toLowerCase().contains(item)) { |
| 588 | + return String.format("cast(? as %s)", f.toLowerCase()); |
| 589 | + } |
585 | 590 | } |
586 | 591 | return "?"; |
587 | 592 | }).collect(Collectors.joining(", ")); |
|
0 commit comments