mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-30 03:01:53 +08:00
【优化】角色分类列表 group
This commit is contained in:
parent
78bb2d1dc8
commit
314a015a2e
@ -50,8 +50,9 @@ public interface AiChatRoleMapper extends BaseMapperX<AiChatRoleDO> {
|
|||||||
|
|
||||||
default List<AiChatRoleDO> selectListGroupByCategory(Integer status) {
|
default List<AiChatRoleDO> selectListGroupByCategory(Integer status) {
|
||||||
return selectList(new LambdaQueryWrapperX<AiChatRoleDO>()
|
return selectList(new LambdaQueryWrapperX<AiChatRoleDO>()
|
||||||
|
.select(AiChatRoleDO::getCategory)
|
||||||
.eq(AiChatRoleDO::getStatus, status)
|
.eq(AiChatRoleDO::getStatus, status)
|
||||||
.apply("GROUP BY category"));
|
.groupBy(AiChatRoleDO::getCategory));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> getChatRoleCategoryList() {
|
public List<String> getChatRoleCategoryList() {
|
||||||
List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus());
|
List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus());
|
||||||
return convertList(list, AiChatRoleDO::getName);
|
return convertList(list, AiChatRoleDO::getCategory);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user