日期:2014-05-17 浏览次数:20502 次
String hql = "select c.* from (select process_date,record_id,amount from engine_fp " +
"where legal_entity_id=:leId) s " +
"pivot (max(amount) for process_date in([:dateFOne],[:dateFTwo])) c "+
"where c.record_id in (select id from engine_fp_record " +
"where sectionId <> 3)";
Map<String, Object> map = new HashMap<String, Object>();
map.put("leId", leId);
map.put("dateFOne", dateFOne);
map.put("dateFTwo", dateFTwo);
List<Object[]> objsList = baseHibernateDAO.findByNativeSql(hql,map);