2424import org .apache .commons .lang3 .StringUtils ;
2525
2626import java .util .ArrayList ;
27+ import java .util .Iterator ;
2728import java .util .List ;
2829import java .util .Map ;
2930
@@ -94,7 +95,7 @@ protected List<String> keyColList(Map<String, List<String>> updateKey) {
9495 for (Map .Entry <String , List <String >> entry : updateKey .entrySet ()) {
9596 List <String > list = entry .getValue ();
9697 for (String col : list ) {
97- if (!keyCols . contains ( col )) {
98+ if (!containsIgnoreCase ( keyCols , col )) {
9899 keyCols .add (col );
99100 }
100101 }
@@ -107,10 +108,10 @@ public String getUpdateSql(List<String> column, List<String> fullColumn, String
107108 String prefixRight = StringUtils .isBlank (rightTable ) ? "" : quoteTable (rightTable ) + "." ;
108109 List <String > list = new ArrayList <>();
109110 for (String col : fullColumn ) {
110- if (keyCols == null || keyCols .size () == 0 || keyCols . contains ( col )) {
111+ if (keyCols == null || keyCols .size () == 0 || containsIgnoreCase ( keyCols , col )) {
111112 continue ;
112113 }
113- if (fullColumn == null || column . contains ( col )) {
114+ if (fullColumn == null ||containsIgnoreCase ( column , col )) {
114115 list .add (prefixLeft + col + "=" + prefixRight + col );
115116 } else {
116117 list .add (prefixLeft + col + "=null" );
@@ -157,6 +158,15 @@ public String makeValues(List<String> column) {
157158 return sb .toString ();
158159 }
159160
161+ public boolean containsIgnoreCase (List <String > l , String s ) {
162+ Iterator <String > it = l .iterator ();
163+ while (it .hasNext ()) {
164+ if (it .next ().equalsIgnoreCase (s ))
165+ return true ;
166+ }
167+ return false ;
168+ }
169+
160170 public String quoteColumn (String column ) {
161171 return getStartQuote () + column + getEndQuote ();
162172 }
0 commit comments