package com.yeshi.buwan.dao.juhe.funtv;
|
|
import com.yeshi.buwan.dao.base.MongodbBaseDao;
|
import com.yeshi.buwan.videos.funtv.entity.VideoFunTV;
|
import org.springframework.data.mongodb.core.query.Criteria;
|
import org.springframework.data.mongodb.core.query.Query;
|
import org.springframework.stereotype.Repository;
|
|
import java.util.List;
|
|
@Repository
|
public class VideoFunTVNewDao extends MongodbBaseDao<VideoFunTV> {
|
|
/**
|
* 根据视频ID查询列表
|
*
|
* @param videoId
|
* @return
|
*/
|
public List<VideoFunTV> listByVideoId(Long videoId) {
|
Query query = new Query();
|
query.addCriteria(Criteria.where("videoId").is(videoId));
|
return findList(query);
|
}
|
|
public List<VideoFunTV> listByAid(String aid) {
|
Query query = new Query();
|
query.addCriteria(Criteria.where("aid").is(aid));
|
return findList(query);
|
}
|
|
public List<VideoFunTV> listByVid(String vid) {
|
Query query = new Query();
|
query.addCriteria(Criteria.where("vid").is(vid));
|
return findList(query);
|
}
|
|
|
|
/**
|
* 根据VideoId和Aid查找
|
*
|
* @param videoId
|
* @param aid
|
* @return
|
*/
|
public long countByVideoIdAndAid(Long videoId, String aid) {
|
Query query = new Query();
|
query.addCriteria(Criteria.where("videoId").is(videoId).andOperator(Criteria.where("aid").is(aid)));
|
return count(query);
|
}
|
|
|
public long countByVideoIdAndVid(Long videoId, String vid) {
|
Query query = new Query();
|
query.addCriteria(Criteria.where("videoId").is(videoId).andOperator(Criteria.where("vid").is(vid)));
|
return count(query);
|
}
|
|
|
public long countByVideoId(Long videoId){
|
Query query = new Query();
|
query.addCriteria(Criteria.where("videoId").is(videoId));
|
return count(query);
|
}
|
|
|
}
|