Unverified Commit f0ed88c5 authored by Aborn Jiang's avatar Aborn Jiang Committed by GitHub
Browse files

support FIND_IN_SET cond (#745)

* fix weird prefixes keys when use RedisUtils.scan

* Column use `` for reserved key

ref: https://stackoverflow.com/questions/2224503/how-to-map-an-entity-field-whose-name-is-a-reserved-word-in-jpa

* add FIND_IN_SET 条件查询

* note
parent f72efb80
...@@ -74,7 +74,9 @@ public @interface Query { ...@@ -74,7 +74,9 @@ public @interface Query {
// 不为空 // 不为空
,NOT_NULL ,NOT_NULL
// 为空 // 为空
,IS_NULL ,IS_NULL,
// Aborn Jiang 2022/06/01, 对应SQL: SELECT * FROM table WHERE FIND_IN_SET('querytag', table.tags);
FIND_IN_SET
} }
/** /**
......
...@@ -166,6 +166,10 @@ public class QueryHelp { ...@@ -166,6 +166,10 @@ public class QueryHelp {
(Comparable) between.get(0), (Comparable) between.get(1))); (Comparable) between.get(0), (Comparable) between.get(1)));
} }
break; break;
case FIND_IN_SET:
list.add(cb.greaterThan(cb.function("FIND_IN_SET", Integer.class,
cb.literal(val.toString()), root.get(attributeName)), 0));
break;
default: break; default: break;
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment