Commit 314a015a2ef2dccc69607cbe8b1367653b227d0d

Authored by cherishsince
1 parent 78bb2d1d

【优化】角色分类列表 group

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<AiChatRoleDO> {
50 50  
51 51 default List<AiChatRoleDO> selectListGroupByCategory(Integer status) {
52 52 return selectList(new LambdaQueryWrapperX<AiChatRoleDO>()
  53 + .select(AiChatRoleDO::getCategory)
53 54 .eq(AiChatRoleDO::getStatus, status)
54   - .apply("GROUP BY category"));
  55 + .groupBy(AiChatRoleDO::getCategory));
55 56 }
56 57  
57 58 }
... ...
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 {
132 132 @Override
133 133 public List<String> getChatRoleCategoryList() {
134 134 List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus());
135   - return convertList(list, AiChatRoleDO::getName);
  135 + return convertList(list, AiChatRoleDO::getCategory);
136 136 }
137 137  
138 138 }
... ...