From 6abb21a5eea96a7171a0e1a87da24f729ed9ae78 Mon Sep 17 00:00:00 2001 From: yulichang <570810310@qq.com> Date: Tue, 5 Nov 2024 12:24:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/depoly.yml | 2 +- .github/workflows/snapshot.yml | 2 +- README-zh.md | 12 +- README.md | 11 +- .../wrapper/JoinAbstractWrapper.java | 16 --- .../test/join/unit/CustomWrapperTest.java | 64 ---------- pom.xml | 115 ------------------ 7 files changed, 4 insertions(+), 218 deletions(-) delete mode 100644 mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/unit/CustomWrapperTest.java diff --git a/.github/workflows/depoly.yml b/.github/workflows/depoly.yml index ac8b86f..0988d5c 100644 --- a/.github/workflows/depoly.yml +++ b/.github/workflows/depoly.yml @@ -32,7 +32,7 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - name: Publish to Apache Maven Central - run: mvn com.github.yulichang:pom-maven-plugin:1.1:pom -Prelease && mvn clean deploy -Prelease + run: mvn com.github.yulichang:pom-maven-plugin:1.3:pom -Dprofile=release && mvn clean deploy env: MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 06d4402..607a55d 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -32,7 +32,7 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - name: Publish to Apache Maven Central - run: mvn com.github.yulichang:pom-maven-plugin:1.0:pom -Psnapshot && mvn deploy -Prelease -Psnapshot + run: mvn com.github.yulichang:pom-maven-plugin:1.3:pom -Dprofile=snapshot && mvn clean deploy env: MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} diff --git a/README-zh.md b/README-zh.md index 0b6e997..c65f0ec 100644 --- a/README-zh.md +++ b/README-zh.md @@ -114,17 +114,7 @@ WHERE ( AND t.id > ?) ``` -MPJLambdaWrapper其他功能 - -* - 一对一,一对多使用 -* - 简单的SQL函数使用 -* - ON语句多条件支持 -* 其他全部功能请参考使用文档 - -# 使用文档 wiki +# 完整使用文档 wiki # 用爱发电 diff --git a/README.md b/README.md index f043004..c753b99 100644 --- a/README.md +++ b/README.md @@ -114,16 +114,7 @@ WHERE ( AND t.id > ?) ``` - -MPJLambdaWrapper其他功能 - -* - 一对一,一对多使用 -* 简单的SQL函数使用 -* ON语句多条件支持 -* 其他全部功能请参考使用文档 - -# 使用文档 wiki +# 完整使用文档 wiki # 用爱发电 支持一下mybatis-plus-join diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/JoinAbstractWrapper.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/JoinAbstractWrapper.java index db33dc7..6de10ba 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/JoinAbstractWrapper.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/JoinAbstractWrapper.java @@ -27,7 +27,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiPredicate; import java.util.function.Consumer; import java.util.function.Predicate; -import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -194,21 +193,6 @@ public abstract class JoinAbstractWrapper C toChildren(Ref children) { - return (C) this; - } - - /** - * 转为子类,方便自定义继承扩展 - * 需要子类自定义字段 - */ - public C toChildren(Supplier s) { - return (C) this; - } - /** * 开启检查 SQL 注入 */ diff --git a/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/unit/CustomWrapperTest.java b/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/unit/CustomWrapperTest.java deleted file mode 100644 index e853857..0000000 --- a/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/unit/CustomWrapperTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.github.yulichang.test.join.unit; - -import com.baomidou.mybatisplus.core.toolkit.support.SFunction; -import com.github.yulichang.test.join.entity.UserDO; -import com.github.yulichang.test.join.mapper.UserMapper; -import com.github.yulichang.test.util.Reset; -import com.github.yulichang.test.util.ThreadLocalUtils; -import com.github.yulichang.toolkit.Ref; -import com.github.yulichang.wrapper.MPJLambdaWrapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.List; -import java.util.Objects; - -@SpringBootTest -public class CustomWrapperTest { - - @Autowired - private UserMapper userMapper; - - @BeforeEach - void setUp() { - Reset.reset(); - } - - - //自定义wrapper扩展 - public static class CWrapper extends MPJLambdaWrapper { - - public static CWrapper toCWrapper() { - return null; - } - - @Override - public CWrapper eqIfExists(SFunction column, Object val) { - super.eq(Objects.nonNull(val), column, val); - return this; - } - } - - @Test - void testWrapperCustomer() { - ThreadLocalUtils.set("SELECT t.id, t.pid, t.`name`, t.`json`, t.sex, t.head_img, t.create_time, t.address_id, t.address_id2, t.del, t.create_by, t.update_by FROM `user` t WHERE t.del = false AND (t.id = ?)"); - CWrapper wrapper = new CWrapper() - .selectAll(UserDO.class) -// .toChildren(new Ref>()) - .toChildren(CWrapper::toCWrapper) - .eqIfExists(UserDO::getId, 1); - List dos = userMapper.selectList(wrapper); - dos.forEach(System.out::println); - - ThreadLocalUtils.set("SELECT t.id, t.pid, t.`name`, t.`json`, t.sex, t.head_img, t.create_time, t.address_id, t.address_id2, t.del, t.create_by, t.update_by FROM `user` t WHERE t.del = false"); - CWrapper wrapper1 = new CWrapper() - .selectAll(UserDO.class) - .toChildren(new Ref>()) -// .toChildren(CWrapper::toCWrapper) - .eqIfExists(UserDO::getId, null); - List dos1 = userMapper.selectList(wrapper1); - dos1.forEach(System.out::println); - } -} diff --git a/pom.xml b/pom.xml index c048464..2f4a806 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,6 @@ 17 8 8 - github UTF-8 UTF-8 UTF-8 @@ -70,120 +69,6 @@ - - - snapshot - - - - com.github.yulichang - pom-maven-plugin - 1.0 - - - - project/properties/revision - %s-SNAPSHOT - - - - - - - - - release - - - - com.github.yulichang - pom-maven-plugin - 1.0 - - - - remove - mybatis-plus-join-root - project/modules/module - \S*-test - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - true - - maven - https://oss.sonatype.org/ - true - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - - -Xdoclint:none - - UTF-8 - UTF-8 - UTF-8 - - - - org.apache.maven.plugins - maven-gpg-plugin - - - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - - - - maven - https://oss.sonatype.org/content/repositories/snapshots - - - maven - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - -