From 12484e067b49d4ad2e3d77607c9ffad63adf56d8 Mon Sep 17 00:00:00 2001 From: WenG <450292408@qq.com> Date: Tue, 29 Jun 2021 23:06:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=87=E9=95=BF=E6=9F=A5=E8=AF=A2=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CommunityBossServiceImpl.java | 21 +++++++++---------- .../communityboss/communityboss-mapper.xml | 7 +------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java b/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java index 274a951..064e4c3 100755 --- a/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java @@ -293,17 +293,16 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun @Override public List listCommunityBoss(Map params) throws SearchException { if (params.get("keywords") != null && !params.get("keywords").toString().isEmpty()) { - List userResourceBOs = userService.listResourceByKeywords(params.get("keywords").toString()); - Set userIdSet = new HashSet<>(); - userResourceBOs.forEach(userResourceBO -> { - userIdSet.add(userResourceBO.getUserId()); - }); - if (userIdSet.isEmpty()) { - return new ArrayList<>(); - } - params.put("communityBossUserIds", new ArrayList<>(userIdSet)); - params.put("communityBossParentUserIds", new ArrayList<>(userIdSet)); - + List userResourceBOs = userService.listResourceByKeywords(params.get("keywords").toString()); + Set userIdSet = new HashSet<>(); + userResourceBOs.forEach(userResourceBO -> { + userIdSet.add(userResourceBO.getUserId()); + }); + if (userIdSet.isEmpty()) { + return new ArrayList<>(); + } + params.put("communityBossUserIds", new ArrayList<>(userIdSet)); + params.remove("keywords"); } List communityBossDTOs = communityBossDao.listCommunityBoss(params); setUserInfo(communityBossDTOs); diff --git a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml index 98fdbce..b14a3dd 100755 --- a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml +++ b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml @@ -196,17 +196,12 @@ AND t1.community_boss_id = #{communityBossId} - + AND ( t1.community_boss_user_id IN #{communityBossUserIds[${index}]} - OR - t1.community_boss_parent_user_id IN - - #{communityBossParentUserIds[${index}]} - )