SearchMapper.java 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. package com.caimei365.commodity.mapper;
  2. import com.caimei365.commodity.model.po.SearchHistoryPo;
  3. import com.caimei365.commodity.model.search.*;
  4. import org.apache.ibatis.annotations.Mapper;
  5. import org.apache.ibatis.annotations.Param;
  6. import java.util.Date;
  7. import java.util.List;
  8. /**
  9. * Description
  10. *
  11. * @author : Charles
  12. * @date : 2020/5/13
  13. */
  14. @Mapper
  15. public interface SearchMapper {
  16. /**
  17. * 根据商品id查找文档数据
  18. *
  19. * @param productId
  20. */
  21. ProductDO searchProductById(Integer productId);
  22. /**
  23. * 获取商品数量
  24. */
  25. Integer findProductCount();
  26. /**
  27. * 获取商品列表
  28. */
  29. List<ProductDO> searchProductList();
  30. /**
  31. * 根据商品id查找 星范商品数量
  32. */
  33. Integer countMallProduct(Integer productId);
  34. /**
  35. * 根据商品id查找 星范商品
  36. */
  37. MallProductDO searchMallProductByProductId(Integer productId);
  38. /**
  39. * 根据商品id查找 星范阶梯价标志
  40. */
  41. Integer getMallLadderPriceFlag(Integer productId);
  42. /**
  43. * 根据商品id查找 星范最小阶梯价
  44. */
  45. Double getMallLowerLadderPrice(Integer productId);
  46. /**
  47. * 获取供应商数量
  48. */
  49. Integer findSupplierCount();
  50. /**
  51. * 获取供应商列表
  52. */
  53. List<SupplierDO> searchSupplierList();
  54. /**
  55. * 根据供应商Id查找文档数据
  56. */
  57. SupplierDO searchSupplierById(Integer shopId);
  58. /**
  59. * 获取项目仪器数量
  60. */
  61. Integer findEquipmentCount();
  62. /**
  63. * 获取项目仪器列表
  64. */
  65. List<EquipmentDO> searchEquipmentList();
  66. /**
  67. * 根据项目仪器Id查找文档数据
  68. */
  69. EquipmentDO searchEquipmentById(Integer equipmentId);
  70. /**
  71. * 获取文章数量
  72. */
  73. Integer findArticleCount();
  74. /**
  75. * 获取文章列表
  76. */
  77. List<ArticleDO> searchArticleList();
  78. /**
  79. * 根据文章Id查找文档数据
  80. */
  81. ArticleDO searchArticleById(Integer articleId);
  82. /**
  83. * 根据文章标签查找标签Id
  84. */
  85. List<Integer> findLabelIdsByName(@Param("labelTexts") String[] labelTexts);
  86. /**
  87. * 根据文章Id查找标签文本
  88. */
  89. String findLabelNameById(@Param("labelId") Integer labelId);
  90. /**
  91. * 获取所有失效商品数量
  92. */
  93. Integer findProductInvalidCount();
  94. /**
  95. * 获取失效商品IDs
  96. */
  97. List<Integer> findProductInvalidIds();
  98. /**
  99. * 根据商品ID获取星范ID
  100. */
  101. Integer findMallIdByProductId(Integer productId);
  102. /**
  103. * 根据商品IDs获取星范IDs
  104. */
  105. List<Integer> findMallInvalidIdsByProductIds(@Param("invalidIds") List<Integer> invalidIds);
  106. /**
  107. * 获取所有失效供应商数量
  108. */
  109. Integer findSupplierInvalidCount();
  110. /**
  111. * 获取失效供应商IDs
  112. */
  113. List<Integer> findSupplierInvalidIds();
  114. /**
  115. * 获取所有失效项目仪器数量
  116. */
  117. Integer findEquipmentInvalidCount();
  118. /**
  119. * 获取失效项目仪器IDs
  120. */
  121. List<Integer> findEquipmentInvalidIds();
  122. /**
  123. * 获取所有失效文章数量
  124. */
  125. Integer findArticleInvalidCount();
  126. /**
  127. * 获取失效文章IDs
  128. */
  129. List<Integer> findArticleInvalidIds();
  130. /**
  131. * 获取数据库商品
  132. *
  133. * @param identity 用户身份
  134. * @param keyword 关键词
  135. * @param shopId 供应商id
  136. * @param bigTypeId 一级分类id
  137. * @param smallTypeId 二级分类id
  138. * @param tinyTypeId 三级分类id
  139. * @param classifyId 运营分类id
  140. * @param sortField 排序类型
  141. * @param sortType 排序顺序
  142. * @return list
  143. */
  144. List<ProductListVo> queryProduct(@Param("identity") Integer identity,
  145. @Param("keyword") String keyword,
  146. @Param("shopId") Integer shopId,
  147. @Param("bigTypeId") Integer bigTypeId,
  148. @Param("smallTypeId") Integer smallTypeId,
  149. @Param("tinyTypeId") Integer tinyTypeId,
  150. @Param("classifyId") Integer classifyId,
  151. @Param("sortField") String sortField,
  152. @Param("sortType") Integer sortType);
  153. /**
  154. * 获取数据库供应商
  155. *
  156. * @param keyword 关键词
  157. * @return list
  158. */
  159. List<ShopListVo> querySupplier(@Param("keyword") String keyword);
  160. /**
  161. * 获取数据库项目仪器
  162. *
  163. * @param keyword 关键词
  164. * @return list
  165. */
  166. List<EquipmentListVo> queryEquipment(@Param("keyword") String keyword);
  167. /**
  168. * 获取数据库文章
  169. *
  170. * @param keyword 关键词
  171. * @return list
  172. */
  173. List<ArticleListVo> queryArticle(@Param("keyword") String keyword, @Param("articleId") Integer articleId, @Param("typeId") Integer typeId, @Param("labelText") String labelText);
  174. /**
  175. * 根据用户ID查找历史记录
  176. */
  177. List<SearchHistoryPo> getHistoryList(Integer userId);
  178. /**
  179. * 根据关键字获取历史记录Id
  180. *
  181. * @param keyword 关键词
  182. */
  183. Integer getHistoryIdByWord(String keyword,Integer userId);
  184. /**
  185. * 更新历史记录
  186. */
  187. void updateSearchHistoryById(SearchHistoryPo historyRecord);
  188. /**
  189. * 新增取历史记录
  190. */
  191. void insertSearchHistory(SearchHistoryPo historyRecord);
  192. /**
  193. * 历史记录数量
  194. */
  195. int getHistoryCount(Integer userId);
  196. /**
  197. * 删除大于10条的历史记录
  198. */
  199. void deleteSearchHistory(Integer userId);
  200. /**
  201. * 删除用户所有历史记录
  202. */
  203. void deleteAllSearchHistory(Integer userId);
  204. List<Integer> findNew(@Param("productIds") List<Integer> productIds, @Param("n") String n);
  205. List<Integer> findPromotion(List<Integer> productIds);
  206. List<Integer> findPromotionId(Integer p_id);
  207. /**
  208. * 统计月销量与月访问量
  209. */
  210. int countViewsByDate(Integer productId, Date date);
  211. int countSalesByDate(Integer productId, Date date);
  212. }