List<BizRecordDetailDO> bizRecordDetailDOs = bizRecordDetailDao.getBizRecordDetailByBizId(bizId); Collections.sort(bizRecordDetailDOs, new Comparator<BizRecordDetailDO>(){ public int compare(BizRecordDetailDO bizRecord1, BizRecordDetailDO bizRecord2) { //按照callDirection進行升序排列 if(bizRecord1.getCallDirection() > bizRecord2.getCallDirection()){ return 1; } if(bizRecord1.getCallDirection() > bizRecord2.getCallDirection()){ return 0; } return -1; } }); return bizRecordDetailDOs;