| 程序包 | 说明 |
|---|---|
| com.github.yulichang.kt.interfaces | |
| com.github.yulichang.wrapper.enums | |
| com.github.yulichang.wrapper.interfaces | |
| com.github.yulichang.wrapper.segments |
| 限定符和类型 | 方法和说明 |
|---|---|
default Children |
Query.selectFunc(BaseFuncEnum funcEnum,
kotlin.reflect.KProperty<?> column) |
default Children |
Query.selectFunc(BaseFuncEnum funcEnum,
kotlin.reflect.KProperty<?> column,
kotlin.reflect.KProperty<?> alias) |
default Children |
Query.selectFunc(BaseFuncEnum funcEnum,
kotlin.reflect.KProperty<?> column,
String alias) |
default Children |
Query.selectFunc(BaseFuncEnum funcEnum,
Object column,
kotlin.reflect.KProperty<?> alias) |
default Children |
Query.selectFunc(BaseFuncEnum funcEnum,
Object column,
String alias)
聚合函数查询
wrapper.selectFunc(() -> "COUNT(%s)", "t.id", "total");
lambda
wrapper.selectFunc(() -> "COUNT(%s)", UserDO::getId, UserDTO::getTotal);
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
DefaultFuncEnum
常用的sql函数枚举 默认实现
可以自己实现接口
BaseFuncEnum 自定义函数
目前支持一个占位符,不支持多个%s
只例举几个通用的,其他函数 first() last() len() ucase() lcase() 等 或者数据库自定义函数请自行扩展
mpj的初衷是只针对简单的连表查询,而非相对复杂的查询,
建议慎用,复杂的查询还是推荐写sql |
| 限定符和类型 | 方法和说明 |
|---|---|
default <X> Children |
Query.selectFunc(BaseFuncEnum funcEnum,
Object column,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<X,?> alias) |
default Children |
Query.selectFunc(BaseFuncEnum funcEnum,
Object column,
String alias)
聚合函数查询
wrapper.selectFunc(() -> "COUNT(%s)", "t.id", "total");
lambda
wrapper.selectFunc(() -> "COUNT(%s)", UserDO::getId, UserDTO::getTotal);
|
default <S> Children |
Query.selectFunc(BaseFuncEnum funcEnum,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<S,?> column) |
default <S,X> Children |
Query.selectFunc(BaseFuncEnum funcEnum,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<S,?> column,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<X,?> alias) |
default <S> Children |
Query.selectFunc(BaseFuncEnum funcEnum,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<S,?> column,
String alias) |
| 限定符和类型 | 方法和说明 |
|---|---|
BaseFuncEnum |
SelectSub.getFunc() |
BaseFuncEnum |
SelectString.getFunc() |
BaseFuncEnum |
SelectNormal.getFunc() |
BaseFuncEnum |
SelectLabel.getFunc() |
BaseFuncEnum |
SelectAlias.getFunc() |
BaseFuncEnum |
Select.getFunc() |
| 构造器和说明 |
|---|
SelectFunc(SelectCache cache,
Integer index,
String alias,
BaseFuncEnum func,
boolean hasTableAlias,
String tableAlias) |
SelectFunc(String alias,
Integer index,
BaseFuncEnum func,
SelectFunc.Arg[] args,
boolean hasTableAlias,
String tableAlias)
kt
|
SelectFunc(String alias,
Integer index,
BaseFuncEnum func,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>[] args,
boolean hasTableAlias,
String tableAlias) |
SelectFunc(String alias,
Integer index,
BaseFuncEnum func,
String column,
boolean hasTableAlias,
String tableAlias) |
Copyright © 2023. All rights reserved.