From db0d197226b9a13d423bb4e1fde2f355bf5c7764 Mon Sep 17 00:00:00 2001 From: yulichang <570810310@qq.com> Date: Fri, 19 Jan 2024 22:51:22 +0800 Subject: [PATCH] =?UTF-8?q?SelectFunc=20=E5=AD=97=E6=AE=B5=E5=88=AB?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yulichang/wrapper/segments/Fun.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/Fun.java diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/Fun.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/Fun.java new file mode 100644 index 0000000..b398c56 --- /dev/null +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/Fun.java @@ -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 + *

+ * 仅对selectFunc有效 + * + * @author yulichang + * @since 1.4.11 + */ +@Getter +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class Fun implements SFunction { + + private final String alias; + private final SFunction func; + + @Override + public R apply(T t) { + throw new UnsupportedOperationException(); + } + + /** + * 别名func + *

+ * 仅对selectFunc有效 + */ + public static Fun f(String alias, SFunction func) { + return new Fun<>(alias, func); + } +}