mirror of https://github.com/elunez/eladmin
add FIND_IN_SET 条件查询
parent
f5381d9fef
commit
64ef258cf9
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue