mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
SelectFunc 字段别名
This commit is contained in:
parent
f45a807339
commit
db0d197226
@ -0,0 +1,36 @@
|
||||
package com.github.yulichang.wrapper.segments;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 别名func
|
||||
* <p>
|
||||
* 仅对selectFunc有效
|
||||
*
|
||||
* @author yulichang
|
||||
* @since 1.4.11
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class Fun<T, R> implements SFunction<T, R> {
|
||||
|
||||
private final String alias;
|
||||
private final SFunction<T, R> func;
|
||||
|
||||
@Override
|
||||
public R apply(T t) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* 别名func
|
||||
* <p>
|
||||
* 仅对selectFunc有效
|
||||
*/
|
||||
public static <T, R> Fun<T, R> f(String alias, SFunction<T, R> func) {
|
||||
return new Fun<>(alias, func);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user