| | |
| | | package com.yeshi.buwan.dao.juhe.funtv; |
| | | |
| | | import com.yeshi.buwan.dao.base.MongodbBaseDao; |
| | | import com.yeshi.buwan.funtv.entity.FunTVVideo2; |
| | | import com.yeshi.buwan.videos.funtv.entity.FunTVVideo2; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | |
| | | * @param mediaId |
| | | * @return |
| | | */ |
| | | public List<FunTVVideo2> listByMediaId(String mediaId) { |
| | | public List<FunTVVideo2> listByMediaId(String mediaId, int start, int count) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("mediaId").is(mediaId)); |
| | | // List<Sort.Order> orders = new ArrayList<>(); |
| | | // orders.add(new Sort.Order(Sort.Direction.ASC, "num")); |
| | | // query.with(new Sort(orders)); |
| | | List<Sort.Order> orders = new ArrayList<>(); |
| | | orders.add(new Sort.Order(Sort.Direction.ASC, "num")); |
| | | query.with(new Sort(orders)); |
| | | query.skip(start); |
| | | query.limit(count); |
| | | return findList(query); |
| | | } |
| | | |