首页 > 代码库 > 获取最高分数对应的记录信息

获取最高分数对应的记录信息

    public JfAuction getMaxScoreByJfEventId(Integer jfEventId) {
        JfAuction jfAuction=null;
        String hql = "from JfAuction where jfEvent.id =:jfEventId and score = (select max(score) from JfAuction where jfEvent.id =:jfEventId)";
        Finder finder = new Finder(hql);
        finder.setParam("jfEventId", jfEventId);
        List<JfAuction> list=jfAuctionDao.find(finder);
        if(list!=null && list.size()>0){
            jfAuction=list.get(0);
        }
        return jfAuction;
    }

获取最高分数对应的记录信息