add FIND_IN_SET 条件查询

pull/745/head
Aborn Jiang 2022-06-01 14:50:58 +08:00
parent f5381d9fef
commit 64ef258cf9
2 changed files with 7 additions and 1 deletions

View File

@ -74,7 +74,9 @@ public @interface Query {
// 不为空
,NOT_NULL
// 为空
,IS_NULL
,IS_NULL,
// Aborn Jiang 2022/06/01, 对应SQL: SELECT * FROM table WHERE FIND_IN_SET('querytag', md_markdown_meta.tags);
FIND_IN_SET
}
/**

View File

@ -164,6 +164,10 @@ public class QueryHelp {
list.add(cb.between(getExpression(attributeName, join, root).as((Class<? extends Comparable>) between.get(0).getClass()),
(Comparable) between.get(0), (Comparable) between.get(1)));
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;
}
}