提交 bb585386 authored 作者: Whispa's avatar Whispa

commit

上级 09f9da42
......@@ -87,13 +87,9 @@ public class ItemController {
@RequestParam(value = "pageNum", defaultValue = "0") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "6") Integer pageSize) {
try {
Page<TbCfStationItem> list = repository.searchAllItems(name,PageRequest.of(pageNum, pageSize));
List<TbCfStationItem> list = repository.searchAllItems(name);
return new Result<>(list);
}catch (Exception e){
System.out.println(e.getMessage());
return new Result(ResultCodeEnum.VALIDATE_ERROR.getCode(),e.getMessage());
}
}
@GetMapping("/queryHotRecommended")
......
......@@ -21,7 +21,7 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
@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.* 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",nativeQuery = true)
Page<TbCfStationItem> searchAllItems(@Param("name") String name,Pageable pageable);
List<Object[]> searchAllItems(@Param("name") String name);
Page<TbCfStationItem> findAllByItemNameContainingOrItemTagsContaining(String itemName, String itemTags, Pageable pageable);
Page<TbCfStationItem> findByItemCategory(String itemName, Pageable pageable);
List<TbCfStationItem> findAllByItemDescritionId(String id);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论