Skip to content

Commit 9ad7cf7

Browse files
committed
key<>改用JSON_CONTAINS实现
1 parent d7231b6 commit 9ad7cf7

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server/AbstractSQLConfig.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -836,20 +836,11 @@ public static String getContainString(String key, Object[] childs, int type) thr
836836
childs[i] = "\"" + childs[i] + "\"";
837837
}
838838
condition += (i <= 0 ? "" : (Logic.isAnd(type) ? AND : OR))
839-
+ "(" + getSearchString(
840-
key
841-
, new String[]{
842-
"[" + childs[i] + "]", //全等
843-
"[" + childs[i] + ", %", //开始
844-
"%, " + childs[i] + ", %", //中间
845-
"%, " + childs[i] + "]" //末尾
846-
}
847-
, Logic.TYPE_OR
848-
) + ")";
839+
+ "JSON_CONTAINS(" + key + ", '" + childs[i] + "')";
849840
}
850841
}
851842
if (condition.isEmpty()) {
852-
condition = (SQL.isEmpty(key, true) + OR + getLikeString(key, "[]"));
843+
condition = (SQL.isEmpty(key, true) + OR + (key + "='[]'"));
853844
}
854845
}
855846
if (condition.isEmpty()) {

0 commit comments

Comments
 (0)