SpringDataJpa根据多个id物品清单id查询房源编号

需求:根据多个物品清单id去重查询房源编号

sql语句:

select DISTINCT f.house_bill_no from financial_style_productitem_detailed f where f.id in (117,119)

/**
   * 根据物品id查询房源号
   * 
   * @param houseBillBo
   * @return
   */
  @Query(value = "select DISTINCT f.houseBillNo from StyleProductItemDetailed f" + " where f.id in (:styleIds)")
  String findHouseBillNoByStyleIds(@Param("styleIds") List<Long> styleIds);

猜你喜欢

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