From 161319d5338fd77ee1a280f05e3fcb785451da14 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Fri, 30 Jun 2023 22:12:34 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E5=88=AB=E5=90=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mybatisflex/test/model/AccountVO2.java | 1 + .../java/com/mybatisflex/test/mapper/AccountMapperTest.java | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/AccountVO2.java b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/AccountVO2.java index 89611509..7365f98a 100644 --- a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/AccountVO2.java +++ b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/AccountVO2.java @@ -26,6 +26,7 @@ public class AccountVO2 extends IdEntity { private Integer age; @As("account_name") + @As("1_account_name") private String userName; private UserVO4 user; diff --git a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/test/java/com/mybatisflex/test/mapper/AccountMapperTest.java b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/test/java/com/mybatisflex/test/mapper/AccountMapperTest.java index f669b0b8..0f5de7a5 100644 --- a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/test/java/com/mybatisflex/test/mapper/AccountMapperTest.java +++ b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/test/java/com/mybatisflex/test/mapper/AccountMapperTest.java @@ -31,6 +31,8 @@ import org.springframework.boot.test.context.SpringBootTest; import java.util.Date; import java.util.List; +import static com.mybatisflex.core.query.QueryMethods.column; +import static com.mybatisflex.core.query.QueryMethods.concat; import static com.mybatisflex.test.model.table.AccountTableDef.ACCOUNT; import static com.mybatisflex.test.model.table.RoleTableDef.ROLE; import static com.mybatisflex.test.model.table.UserRoleTableDef.USER_ROLE; @@ -119,9 +121,9 @@ class AccountMapperTest { QueryWrapper queryWrapper = QueryWrapper.create() .select(ACCOUNT.ID.as("account_id"), ACCOUNT.AGE, - ACCOUNT.USER_NAME.as("account_name"), + concat(column("'account name: '"), ACCOUNT.USER_NAME).as("user_name"), USER.USER_ID, - USER.USER_NAME) + concat(column("'user name: '"), USER.USER_NAME).as("1_account_name")) .from(ACCOUNT.as("a"), USER.as("u")) .where(ACCOUNT.ID.eq(1)) .limit(1);