提交 2b223eec authored 作者: Whispa's avatar Whispa

commit

上级 c0cbcd3c
......@@ -11,19 +11,28 @@ import org.springframework.data.repository.query.Param;
import java.util.List;
public interface TbCfStationItemRepository extends PagingAndSortingRepository<TbCfStationItem,String> {
public interface TbCfStationItemRepository extends PagingAndSortingRepository<TbCfStationItem, String> {
Page<TbCfStationItem> findAllByItemCategorytwo(String category, Pageable pageable);
Page<TbCfStationItem> findAllByItemDescritionId(String description, Pageable pageable);
Page<TbCfStationItem> findAllByItemLabelContaining(String label, Pageable pageable);
@Query(value = "select a from #{#entityName} a WHERE a.itemId <> :itemId and (a.itemDescritionId = :descriptionId or a.itemCategorytwo = :categoryTwo or a.itemCategory = :category )")
Page<TbCfStationItem> getRecommendItems(@Param("itemId") String itemId,@Param("descriptionId") String descriptionId,@Param("categoryTwo") String categoryTwo,@Param("category") String category, Pageable pageable);
Page<TbCfStationItem> getRecommendItems(@Param("itemId") String itemId, @Param("descriptionId") String descriptionId, @Param("categoryTwo") String categoryTwo, @Param("category") String category, Pageable pageable);
@Query(value = "select a from #{#entityName} a WHERE a in (SELECT l.item FROM ItemLabel l WHERE l.description IN :tags) and (SELECT count(x.item) FROM ItemLabel x WHERE x.item = a and x.description IN :tags) >= :num ")
Page<TbCfStationItem> getItemsByImageSearch(@Param("tags") String[] tags,@Param("num") Long num, Pageable pageable);
@Query(value = "select a from #{#entityName} a order by a.itemTop desc,a.sort asc,a.createTime desc")
Page<TbCfStationItem> getItemsByImageSearch(@Param("tags") String[] tags, @Param("num") Long num, Pageable pageable);
@Query(value = "select a from #{#entityName} a order by a.itemTop desc,a.sort asc,a.createTime desc")
Page<TbCfStationItem> findAllItems(Pageable pageable);
@Query(value = "select a.item_id as itemId,a.item_code as itemCode,a.item_name as itemName,a.item_brief as itemBrief,a.item_category as itemCategory,a.item_price as itemPrice,a.discount_price as discountPrice,a.item_url as itemUrl,a.item_img as itemImg,a.item_tags as itemTags,a.item_label as itemLabel,a.item_num as itemNum,a.item_collection_num as itemCollectionNum,a.item_count as itemCount,a.item_sku as itemSku,a.item_top as itemTop,a.supplier as supplier,a.platform_code as platformCode,a.platform_name as platformName,a.enable_flag as enableFlag,a.create_time as createTime,a.item_categorytwo as itemCategorytwo,a.item_descrition_id as itemDescritionId,a.sort,a.template from tb_cf_station_item a where a.item_name LIKE CONCAT('%',?1,'%') or MATCH(a.item_name, a.item_brief) AGAINST(CONCAT(?1,'*') IN BOOLEAN MODE) order by a.item_top desc,a.sort asc,a.create_time desc limit ?2,?3",nativeQuery = true)
List<SearchModel> searchAllItems(@Param("name") String name,int num,int limit);
@Query(value = "select a.item_id as itemId,a.item_code as itemCode,a.item_name as itemName,a.item_brief as itemBrief,a.item_category as itemCategory,a.item_price as itemPrice,a.discount_price as discountPrice,a.item_url as itemUrl,a.item_img as itemImg,a.item_tags as itemTags,a.item_label as itemLabel,a.item_num as itemNum,a.item_collection_num as itemCollectionNum,a.item_count as itemCount,a.item_sku as itemSku,a.item_top as itemTop,a.supplier as supplier,a.platform_code as platformCode,a.platform_name as platformName,a.enable_flag as enableFlag,a.create_time as createTime,a.item_categorytwo as itemCategorytwo,a.item_descrition_id as itemDescritionId,a.sort,a.template from tb_cf_station_item a where a.item_name LIKE CONCAT('%',?1,'%') or MATCH(a.item_name, a.item_brief) AGAINST(CONCAT(?1,'*') IN BOOLEAN MODE) limit ?2,?3", nativeQuery = true)
List<SearchModel> searchAllItems(@Param("name") String name, int num, int limit);
Page<TbCfStationItem> findAllByItemNameContainingOrItemTagsContaining(String itemName, String itemTags, Pageable pageable);
Page<TbCfStationItem> findByItemCategory(String itemName, Pageable pageable);
List<TbCfStationItem> findAllByItemDescritionId(String id);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论