Skip to content

Commit

Permalink
in不能拼接'' (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-wangyan committed Apr 13, 2022
1 parent 3cb9954 commit ad02afb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ public ConditionBuilder endSub(){
return this.instance;
}


private ConditionBuilder doGle(Op p, String property, Object value) {
if (value == null){
isOr();
Expand Down Expand Up @@ -246,7 +245,7 @@ private ConditionBuilder doIn(Op p, String property, List<? extends Object> list

List<Object> tempList = new ArrayList<>();
for (Object obj : list) {
if (Objects.isNull(obj))
if (SqliStringUtil.isNullOrEmpty(obj))
continue;
if (!tempList.contains(obj)) {
tempList.add(obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ default void buildIn(StringBuilder sb, Class clzz, List<? extends Object> inList

for (int j = 0; j < length; j++) {
Object value = inList.get(j);
if (value == null || SqliStringUtil.isNullOrEmpty(value.toString()))
if (value == null )
continue;
value = filter(value.toString());
sb.append(SqlScript.SINGLE_QUOTES).append(value).append(SqlScript.SINGLE_QUOTES);//'string'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static boolean isNotNull(String str){
}

public static boolean isNullOrEmpty(String str){
return str == null || str.equals("") || str.equals("null") || str.equals("NaN") || str.equals("undefined");
return str == null || str.equals("") || str.trim().equals("");
}

public static boolean isNullOrEmpty(Object obj) {
Expand Down

0 comments on commit ad02afb

Please sign in to comment.