From 314a015a2ef2dccc69607cbe8b1367653b227d0d Mon Sep 17 00:00:00 2001 From: cherishsince Date: Wed, 15 May 2024 18:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=88=86=E7=B1=BB=E5=88=97=E8=A1=A8=20group?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/yudao/module/ai/dal/mysql/AiChatRoleMapper.java | 3 ++- .../yudao/module/ai/service/model/AiChatRoleServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/AiChatRoleMapper.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/AiChatRoleMapper.java index c0eeb549e..c2a9631dc 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/AiChatRoleMapper.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/AiChatRoleMapper.java @@ -50,8 +50,9 @@ public interface AiChatRoleMapper extends BaseMapperX { default List selectListGroupByCategory(Integer status) { return selectList(new LambdaQueryWrapperX() + .select(AiChatRoleDO::getCategory) .eq(AiChatRoleDO::getStatus, status) - .apply("GROUP BY category")); + .groupBy(AiChatRoleDO::getCategory)); } } diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleServiceImpl.java index e039c4113..196f1a6ac 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleServiceImpl.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleServiceImpl.java @@ -132,7 +132,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService { @Override public List getChatRoleCategoryList() { List list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus()); - return convertList(list, AiChatRoleDO::getName); + return convertList(list, AiChatRoleDO::getCategory); } }