From e3dde6274f649e1d6430d71769fd42470f982582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E7=8B=BC=E8=93=9D=E5=A4=A9?= Date: Tue, 24 Sep 2024 17:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E6=9D=A1=E4=BB=B6=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/guaiguailang/harmony/domain/entity/SystemRole.java | 1 + .../guaiguailang/harmony/service/impl/UserServiceImpl.java | 4 ++-- src/main/resources/mapper/UserMapper.xml | 4 ++-- .../harmony/HarmonyLifeServerApplicationTests.java | 5 +---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java index d5bb308..61962c3 100644 --- a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java +++ b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java @@ -9,4 +9,5 @@ public class SystemRole { private String roleId; private long status; private String description; + private int level; } diff --git a/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java b/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java index 55a8c42..d8ab549 100644 --- a/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java +++ b/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java @@ -96,9 +96,9 @@ public class UserServiceImpl implements UserService { queryConditions.put("excludeUid", uid); List userInfos; - + log.info("要查询的用户类型是:"+userListParam.getUserType()); if (Objects.equals(userListParam.getUserType(), "activate")) { - // 如果有额外的激活状态条件,也可以加入到queryConditions中,比如限制不能查询身份等级比自己高的 | todo 这个任务涉及到新增字段 + // 如果有额外的激活状态条件,也可以加入到queryConditions中,比如限制不能查询身份等级比自己高的 | todo 这个任务涉及到新增字段 | 已经新增字段level userInfos = userMapper.getUserListActivate(limit, end, merchantCode, queryConditions); } else if (Objects.equals(userListParam.getUserType(), "disabled")) { // 同上,可以加入禁用状态条件 diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml index 68b0124..b01c45f 100644 --- a/src/main/resources/mapper/UserMapper.xml +++ b/src/main/resources/mapper/UserMapper.xml @@ -14,7 +14,7 @@ AND id != #{queryConditions.excludeUid} - LIMIT #{limit} + LIMIT #{limit},#{end} @@ -27,7 +27,7 @@ AND id != #{queryConditions.excludeUid} - LIMIT #{limit} + LIMIT #{limit},#{end} diff --git a/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java b/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java index ff5694f..4f9acfd 100644 --- a/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java +++ b/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java @@ -4,6 +4,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import javax.xml.transform.Result; +import java.util.Scanner; @SpringBootTest class HarmonyLifeServerApplicationTests { @@ -12,8 +13,4 @@ class HarmonyLifeServerApplicationTests { void contextLoads() { } - public void add(int a){ - System.out.println(a); - } - }