【发布时间】:2020-10-25 16:54:21
【问题描述】:
我正在尝试获取 barcode 变量,而 qty 变量为 0 或 !=.Like Selectbarcode Where qty=0 或 Selectbarcode WHERE qty=0。我花了一整天的时间,但我不知道怎么做。请帮帮我
@GetMapping(path = "/barcode/{barcode}")
public List<User> findd(@PathVariable("barcode") String barcode,
@RequestParam Integer qty) {
return repository.findByQty(qty);
}
s
public interface UserRepository extends JpaRepository<User,Integer> {
User findByBarcode(String barcode);
List <User> findByQty(int qty);
}
【问题讨论】:
标签: spring spring-boot spring-data-jpa