spring jpa @Query中使用in

jpa @Query中使用in,需要注意参数一定要是List<>,不然无法查询出数据。

@Query(value = "select count(*) from financial_style_productitem_detailed fspd where fspd.id in(:ids)", nativeQuery = true)
  Integer findByStyleIds(@Param(value = "ids") List<String> ids);

猜你喜欢

转载自blog.csdn.net/xiao297328/article/details/82386134