From 75f497fd293545da2cf9400b9944fcf452d7e2c7 Mon Sep 17 00:00:00 2001 From: yulichang <570810310@qq.com> Date: Sat, 2 Mar 2024 23:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0around?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yulichang/test/join/m/AroundTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/m/AroundTest.java diff --git a/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/m/AroundTest.java b/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/m/AroundTest.java new file mode 100644 index 0000000..32ac2f8 --- /dev/null +++ b/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/m/AroundTest.java @@ -0,0 +1,30 @@ +package com.github.yulichang.test.join.m; + +import com.github.yulichang.test.join.entity.UserDO; +import com.github.yulichang.test.util.Reset; +import com.github.yulichang.test.util.ThreadLocalUtils; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +public class AroundTest { + + @BeforeEach + void setUp() { + Reset.reset(); + } + + + @Test + void around() { + ThreadLocalUtils.set("SELECT * FROM (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) tmp"); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(UserDO.class) + .around("select * from (", ") tmp"); + wrapper.list().forEach(System.out::println); + } + +}