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

    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;
    }

posted @ 2015-01-12 14:04  紫发少年  阅读(129)  评论(0编辑  收藏  举报