OrderMapper.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. package com.caimei.mapper;
  2. import com.caimei.model.po.CmPayShopRecordPo;
  3. import com.caimei.model.po.UserSearchHistoryPo;
  4. import com.caimei.model.vo.*;
  5. import org.apache.ibatis.annotations.Mapper;
  6. import org.apache.ibatis.annotations.Param;
  7. import java.math.BigDecimal;
  8. import java.util.List;
  9. /**
  10. * Description
  11. *
  12. * @author : plf
  13. * @date : 2021/3/26
  14. */
  15. @Mapper
  16. public interface OrderMapper {
  17. /**
  18. * 查询
  19. *
  20. * @param userId
  21. * @param orderState
  22. * @return
  23. */
  24. List<OrderVo> findOrderList(@Param("userId") Integer userId, @Param("orderState") Integer orderState);
  25. /**
  26. * 查询物流详情
  27. *
  28. * @param orderId
  29. * @return
  30. */
  31. List<LogisticsBatchVo> findLogistics(Integer orderId);
  32. /**
  33. * 查询该主订单下所有子订单
  34. *
  35. * @param orderId
  36. * @return
  37. */
  38. List<ShopOrderVo> findAllShopOrder(Integer orderId);
  39. /**
  40. * 查询子订单下所有商品
  41. *
  42. * @param shopOrderId
  43. * @return
  44. */
  45. List<OrderProductVo> findOrderProduct(Integer shopOrderId);
  46. /**
  47. * 查询收款记录
  48. *
  49. * @param orderId
  50. * @return
  51. */
  52. List<DiscernReceiptVo> findDiscernReceipt(Integer orderId);
  53. /**
  54. * 查询订单收货地址
  55. *
  56. * @param orderId
  57. * @return
  58. */
  59. UserInfoVo findUserInfo(Integer orderId);
  60. /**
  61. * 查询订单信息
  62. *
  63. * @param orderId
  64. * @return
  65. */
  66. OrderVo findOrder(Integer orderId);
  67. /**
  68. * 查询已退货数量
  69. *
  70. * @param shopOrderId
  71. * @param productId
  72. * @return
  73. */
  74. Integer returnedPurchase(@Param("shopOrderId") Integer shopOrderId, @Param("productId") Integer productId);
  75. /**
  76. * 查询已取消发货数量
  77. *
  78. * @param shopOrderId
  79. * @param productId
  80. * @return
  81. */
  82. Integer actualCancelNum(@Param("shopOrderId") Integer shopOrderId, @Param("productId") Integer productId);
  83. /**
  84. * 查询退款记录
  85. *
  86. * @param orderId
  87. * @return
  88. */
  89. BigDecimal findReturnedPurchase(Integer orderId);
  90. /**
  91. * 查询批次物流信息
  92. *
  93. * @param shopOrderId
  94. * @param batchId
  95. * @return
  96. */
  97. List<LogisticsRecordVo> findLogisticsRecord(@Param("shopOrderId") Integer shopOrderId, @Param("batchId") Long batchId);
  98. /**
  99. * 物流信息
  100. *
  101. * @param batchId
  102. * @return
  103. */
  104. List<LogisticsInformationVo> findLogisticsInfo(Long batchId);
  105. /**
  106. * 更新物流状态
  107. *
  108. * @param orderId
  109. */
  110. void updateLogisticsBatch(Integer orderId);
  111. /**
  112. * 更新订单状态
  113. *
  114. * @param order
  115. */
  116. void updateOrderStatus(OrderVo order);
  117. /**
  118. * 逻辑删除主订单
  119. *
  120. * @param orderId
  121. */
  122. void deleteOrder(Integer orderId);
  123. /**
  124. * 逻辑删除子订单
  125. *
  126. * @param orderId
  127. */
  128. void deleteShopOrder(Integer orderId);
  129. /**
  130. * 逻辑删除订单收款记录
  131. *
  132. * @param orderId
  133. */
  134. void deleteReceiptOrderRelation(Integer orderId);
  135. /**
  136. * 逻辑删除收款记录
  137. *
  138. * @param id
  139. */
  140. void deleteDiscernReceipt(Integer id);
  141. /**
  142. * 查询付款记录
  143. *
  144. * @param shopOrderId
  145. * @return
  146. */
  147. List<CmPayShopRecordPo> findPayShopRecord(Integer shopOrderId);
  148. /**
  149. * 逻辑删除子订单付款记录
  150. *
  151. * @param shopOrderId
  152. */
  153. void deletePayShopRecord(Integer shopOrderId);
  154. /**
  155. * 逻辑删除付款记录
  156. *
  157. * @param payShopId
  158. */
  159. void updatePayShop(Integer payShopId);
  160. /**
  161. * 取消订单
  162. *
  163. * @param orderId
  164. */
  165. void cancelOrder(Integer orderId);
  166. /**
  167. * 查询相关商品名称订单
  168. *
  169. * @param searchWord
  170. * @param userId
  171. * @return
  172. */
  173. List<OrderVo> searchOrder(@Param("searchWord") String searchWord, @Param("userId") Integer userId);
  174. /**
  175. * 查询组织订单搜索历史记录
  176. *
  177. * @param userId
  178. * @return
  179. */
  180. List<String> getSearchHistoryList(Integer userId);
  181. /**
  182. * 删除订单搜索历史记录
  183. *
  184. * @param userId
  185. */
  186. void deleteSearchHistory(Integer userId);
  187. /**
  188. * 保存订单搜索历史记录
  189. *
  190. * @param searchHistoryPo
  191. */
  192. void insertHistory(UserSearchHistoryPo searchHistoryPo);
  193. /**
  194. * 查询订单关键字历史是否存在
  195. *
  196. * @param userId
  197. * @param searchWord
  198. * @return
  199. */
  200. Long getHistoryIdByWord(@Param("userId") Integer userId, @Param("searchWord") String searchWord);
  201. /**
  202. * 更新订单搜索历史记录
  203. *
  204. * @param historyRecord
  205. */
  206. void updateHistoryById(UserSearchHistoryPo historyRecord);
  207. /**
  208. * 删除10条以上的记录
  209. *
  210. * @param userId
  211. */
  212. void deleteHistoryByUserId(Integer userId);
  213. /**
  214. * 查询订单数量
  215. *
  216. * @param userId 用户id
  217. * @param status
  218. * @return
  219. */
  220. Integer findOrderCount(@Param("userId") Integer userId,@Param("status") int status);
  221. }