mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
!181 feat: QueryWrapper.groupBy 支持 Lambda 表达式。
Merge pull request !181 from 王帅/main
This commit is contained in:
commit
c28d094767
@ -579,6 +579,18 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T> QueryWrapper groupBy(LambdaGetter<T> column) {
|
||||||
|
addGroupByColumns(LambdaUtil.getQueryColumn(column));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> QueryWrapper groupBy(LambdaGetter<T>... columns) {
|
||||||
|
for (LambdaGetter<T> column : columns) {
|
||||||
|
groupBy(LambdaUtil.getQueryColumn(column));
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public QueryWrapper having(QueryCondition queryCondition) {
|
public QueryWrapper having(QueryCondition queryCondition) {
|
||||||
addHavingQueryCondition(queryCondition, SqlConnector.AND);
|
addHavingQueryCondition(queryCondition, SqlConnector.AND);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user