Mysql将SQL查询结果以字符串形式返回

/**
   * 根据房源号查询所有的物品id
   * 
   * @param houseBillBo
   * @return
   */
  @Query(value = "select group_concat(\"'\",id,\"'\") from financial_style_productitem_detailed f where f.house_bill_no=?1", nativeQuery = true)
  String findByHouseBillNoToString(String houseBillBo);

主要使用group_concat()函数

猜你喜欢

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