ChatMsgMapper.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package com.kede.common.dao;
  2. import com.kede.common.model.ChatMsg;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.springframework.data.domain.Pageable;
  5. import java.util.List;
  6. /**
  7. * 微信会话存储(ChatMsg)表数据库访问层
  8. *
  9. * @author makejava
  10. * @since 2025-06-17 11:06:18
  11. */
  12. public interface ChatMsgMapper {
  13. /**
  14. * 通过ID查询单条数据
  15. *
  16. * @param id 主键
  17. * @return 实例对象
  18. */
  19. ChatMsg selectById(Integer id);
  20. /**
  21. * 查询指定行数据
  22. *
  23. * @param chatMsg 查询条件
  24. * @param pageable 分页对象
  25. * @return 对象列表
  26. */
  27. List<ChatMsg> findChatMsgList(ChatMsg chatMsg);
  28. /**
  29. * 统计总行数
  30. *
  31. * @param chatMsg 查询条件
  32. * @return 总行数
  33. */
  34. int findChatMsgCount(ChatMsg chatMsg);
  35. /**
  36. * 新增数据
  37. *
  38. * @param chatMsg 实例对象
  39. * @return 影响行数
  40. */
  41. int insert(ChatMsg chatMsg);
  42. /**
  43. * 批量新增数据(MyBatis原生foreach方法)
  44. *
  45. * @param entities List<ChatMsg> 实例对象列表
  46. * @return 影响行数
  47. */
  48. int insertBatch(@Param("entities") List<ChatMsg> entities);
  49. /**
  50. * 批量新增或按主键更新数据(MyBatis原生foreach方法)
  51. *
  52. * @param entities List<ChatMsg> 实例对象列表
  53. * @return 影响行数
  54. * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
  55. */
  56. int insertOrUpdateBatch(@Param("entities") List<ChatMsg> entities);
  57. /**
  58. * 修改数据
  59. *
  60. * @param chatMsg 实例对象
  61. * @return 影响行数
  62. */
  63. int update(ChatMsg chatMsg);
  64. /**
  65. * 通过主键删除数据
  66. *
  67. * @param id 主键
  68. * @return 影响行数
  69. */
  70. int deleteById(Integer id);
  71. ChatMsg selectByMsgId(String msgid);
  72. }