Interface ChatSessionMapper

All Superinterfaces:
com.baomidou.mybatisplus.core.mapper.BaseMapper<ChatSession>, com.baomidou.mybatisplus.core.mapper.Mapper<ChatSession>

@Mapper public interface ChatSessionMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<ChatSession>
聊天会话 Mapper 接口
Author:
Alibaba Cloud AI
  • Method Summary

    Modifier and Type
    Method
    Description
    根据智能体ID查询会话列表
    根据会话ID查询会话详情
    int
    软删除智能体的所有会话
    int
    softDeleteById(String sessionId, LocalDateTime updateTime)
    软删除会话
    int
    updatePinStatus(String sessionId, boolean isPinned, LocalDateTime updateTime)
    更新会话置顶状态
    int
    updateSessionTime(String sessionId, LocalDateTime updateTime)
    更新会话时间
    int
    updateTitle(String sessionId, String title, LocalDateTime updateTime)
    更新会话标题

    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

    • selectByAgentId

      @Select("SELECT * FROM chat_session WHERE agent_id = #{agentId} AND status != \'deleted\' ORDER BY is_pinned DESC, update_time DESC") List<ChatSession> selectByAgentId(@Param("agentId") Integer agentId)
      根据智能体ID查询会话列表
    • selectBySessionId

      @Select("SELECT * FROM chat_session WHERE id = #{sessionId} AND status != \'deleted\'") ChatSession selectBySessionId(@Param("sessionId") String sessionId)
      根据会话ID查询会话详情
    • softDeleteByAgentId

      @Update("UPDATE chat_session SET status = \'deleted\', update_time = #{updateTime} WHERE agent_id = #{agentId}") int softDeleteByAgentId(@Param("agentId") Integer agentId, @Param("updateTime") LocalDateTime updateTime)
      软删除智能体的所有会话
    • updateSessionTime

      @Update("UPDATE chat_session SET update_time = #{updateTime} WHERE id = #{sessionId}") int updateSessionTime(@Param("sessionId") String sessionId, @Param("updateTime") LocalDateTime updateTime)
      更新会话时间
    • updatePinStatus

      @Update("UPDATE chat_session SET is_pinned = #{isPinned}, update_time = #{updateTime} WHERE id = #{sessionId}") int updatePinStatus(@Param("sessionId") String sessionId, @Param("isPinned") boolean isPinned, @Param("updateTime") LocalDateTime updateTime)
      更新会话置顶状态
    • updateTitle

      @Update("UPDATE chat_session SET title = #{title}, update_time = #{updateTime} WHERE id = #{sessionId}") int updateTitle(@Param("sessionId") String sessionId, @Param("title") String title, @Param("updateTime") LocalDateTime updateTime)
      更新会话标题
    • softDeleteById

      @Update("UPDATE chat_session SET status = \'deleted\', update_time = #{updateTime} WHERE id = #{sessionId}") int softDeleteById(@Param("sessionId") String sessionId, @Param("updateTime") LocalDateTime updateTime)
      软删除会话