diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatConversationMapper.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatConversationMapper.java index 5d41fb080..181b136ef 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatConversationMapper.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatConversationMapper.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.ai.dal.mysql.chat; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO; -import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatMessageDO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -16,7 +16,11 @@ import java.util.List; public interface AiChatConversationMapper extends BaseMapperX { default List selectListByUserId(Long userId) { - return selectList(AiChatConversationDO::getUserId, userId); + return selectList( + new LambdaQueryWrapperX() + .eq(AiChatConversationDO::getUserId, userId) + .orderByAsc(AiChatConversationDO::getCreateTime) + ); } }