在spring 的jdbc sql中使用in 语句

来源:互联网 发布:淘宝销量排行榜 编辑:程序博客网 时间:2024/06/06 08:42

1.

<property name="sqlSelectPricesForHoldAssetByDate">
   <value>
   select A.ASSETPRICEID, A.ASSETID, A.SOURCE, A.ASOFDATE, A.CURRENCY, A.BID, A.ASK
   from assetprice A INNER JOIN loanfacility lf ON A.assetid = lf.assetid
   where lf.loanfacilityid in (select loanfacilityid from ptrsfacility where ptrsid in (select pvtrsid from pvtrs where trsstatus = ''Active'' ))
   and A.source in {0}
   and A.asofdate = ?
   </value>
   </property>

2.

MessageFormat.format(
     this.sqlSelectPricesForHoldAssetByDate,
     DAOUtil.toInClause(sources)
     );