ChatMsgMapper.java 2.2 KB

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