12d53b815c8c402182185574bf66b9edf0f5e5ac.svn-base 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. package com.iamberry.app.mapper;
  2. import com.iamberry.app.core.entity.User;
  3. /**
  4. *
  5. * @author Moon Cheng
  6. * @date 2016年1月16日 下午12:25:05
  7. */
  8. public interface UserMapper {
  9. // ================================================================================================
  10. // ------------------------------------------User----------------------------------------------
  11. // ================================================================================================
  12. /**
  13. * 根据id查询user所有信息
  14. *
  15. * @param id
  16. * @return User Information
  17. */
  18. public User selectUserById(Long id);
  19. /**
  20. * 根据username查询user所有信息
  21. *
  22. * @param username
  23. * @return User Information
  24. */
  25. public User selectUserByUsername(String username);
  26. /**
  27. * 通过ext_open_id查询user所有信息
  28. *
  29. * @param extOpenId
  30. * @return User Information
  31. */
  32. public User selectUserByExtOpenId(String extOpenId);
  33. /**
  34. * 添加用户信息到user表中
  35. *
  36. * @param user
  37. */
  38. public void insertUser(User user);
  39. /**
  40. * 根据id修改user表数据
  41. *
  42. * @param user
  43. */
  44. public void updateUser(User user);
  45. /**
  46. * 根据id修改user表的个人头像
  47. *
  48. * @author Moon Cheng
  49. * @param image
  50. * @param id
  51. */
  52. public int updateDisplayPicture(String imageUrl, Long id);
  53. /**
  54. * 根据用户名和密码查询用户表信息
  55. *
  56. * @param username
  57. * @param password
  58. * @return User Information
  59. */
  60. public User validateUser(String username, String password);
  61. /**
  62. * 通过id修改用户表密码
  63. *
  64. * @param id
  65. * @param newPassword
  66. * @return update row count
  67. */
  68. public int changePassword(Long id, String newPassword);
  69. // ================================================================================================
  70. // ------------------------------------------UserToken----------------------------------------------
  71. // ================================================================================================
  72. /**
  73. * 通过token查询user表所有信息
  74. *
  75. * @param userId
  76. * @return
  77. */
  78. public User selectUserByToken(String token);
  79. /**
  80. * 根据id修改token值
  81. *
  82. * @param token
  83. * @param userId
  84. * @return int
  85. */
  86. public int updateUserToken(String token, Long userId);
  87. /**
  88. * 根据id修改user表的用户名
  89. *
  90. * @author Moon Cheng
  91. * @param username
  92. * @param userId
  93. * @return
  94. */
  95. public int updateUserName(String username, Long userId);
  96. /**
  97. * 根据id修改user表的用户名和国家代码
  98. *
  99. * @author Moon Cheng
  100. * @param username
  101. * @param userId
  102. * @param countryCode
  103. * @return
  104. */
  105. public int updateUserNameAndCountry(String username,String countryCode, Long userId);
  106. /**
  107. * 通过key_查询sys_config表数据
  108. *
  109. * @param key
  110. * @return String
  111. */
  112. public String selectConfig(String key);
  113. // ================================================================================================
  114. // ------------------------------------------UserAvator----------------------------------------------
  115. // ================================================================================================
  116. /**
  117. * USER_AVATOR表中添加数据
  118. *
  119. * @param id
  120. * @param avator
  121. * void
  122. */
  123. public void insertUserAvator(Long id, String avator);
  124. /**
  125. * 通过user_id修改USER_AVATOR表数据
  126. *
  127. * @param id
  128. * @param avator
  129. * @return int
  130. */
  131. public int updateUserAvator(Long id, String avator);
  132. /**
  133. * 根据user_id查询USER_AVATOR表数据
  134. *
  135. * @param id
  136. * @return String
  137. */
  138. public String selectUserAvator(Long id);
  139. }