Package com.alibaba.cloud.ai.mapper
Interface ChatMessageMapper
- All Superinterfaces:
com.baomidou.mybatisplus.core.mapper.BaseMapper<ChatMessage>,com.baomidou.mybatisplus.core.mapper.Mapper<ChatMessage>
@Mapper
public interface ChatMessageMapper
extends com.baomidou.mybatisplus.core.mapper.BaseMapper<ChatMessage>
聊天消息 Mapper 接口
- Author:
- Alibaba Cloud AI
-
Method Summary
Modifier and TypeMethodDescriptionintcountBySessionId(String sessionId) 根据会话ID查询消息数量selectBySessionId(String sessionId) 根据会话ID查询消息列表selectBySessionIdAndRole(String sessionId, String role) 根据会话ID和角色查询消息列表Methods inherited from interface com.baomidou.mybatisplus.core.mapper.BaseMapper
delete, deleteBatchIds, deleteById, deleteById, deleteById, deleteByIds, deleteByIds, deleteByMap, exists, insert, insert, insert, insertOrUpdate, insertOrUpdate, insertOrUpdate, insertOrUpdate, insertOrUpdate, selectBatchIds, selectBatchIds, selectById, selectByIds, selectByIds, selectByMap, selectByMap, selectCount, selectList, selectList, selectList, selectList, selectMaps, selectMaps, selectMaps, selectMaps, selectMapsPage, selectObjs, selectObjs, selectOne, selectOne, selectPage, update, update, updateById, updateById, updateById
-
Method Details
-
selectBySessionId
@Select("SELECT * FROM chat_message WHERE session_id = #{sessionId} ORDER BY create_time ASC") List<ChatMessage> selectBySessionId(@Param("sessionId") String sessionId) 根据会话ID查询消息列表 -
countBySessionId
@Select("SELECT COUNT(*) FROM chat_message WHERE session_id = #{sessionId}") int countBySessionId(@Param("sessionId") String sessionId) 根据会话ID查询消息数量 -
selectBySessionIdAndRole
@Select("SELECT * FROM chat_message WHERE session_id = #{sessionId} AND role = #{role} ORDER BY create_time ASC") List<ChatMessage> selectBySessionIdAndRole(@Param("sessionId") String sessionId, @Param("role") String role) 根据会话ID和角色查询消息列表
-