package com.newvideo.dao;
|
|
import org.springframework.stereotype.Repository;
|
|
import com.newvideo.domain.ResourceVideo;
|
|
import java.io.Serializable;
|
import java.util.List;
|
|
@Repository
|
public class ResourceVideoDao extends BaseDao<ResourceVideo> {
|
|
/**
|
* 根据视频ID和来源ID查询
|
*
|
* @param videoId
|
* @param resourceId
|
* @return
|
*/
|
public ResourceVideo selectByVideoIdAndResourceId(String videoId, String resourceId) {
|
List<ResourceVideo> list = list("from ResourceVideo rv where rv.video.id=? and rv.resource.id=?", 0, 1, new Serializable[]{videoId, resourceId});
|
if (list != null && list.size() > 0) {
|
return list.get(0);
|
}
|
return null;
|
}
|
|
|
public long countByVideoIdAndResourceId(String videoId, String resourceId) {
|
return getCount("from ResourceVideo rv where rv.video.id=? and rv.resource.id=?", new Serializable[]{videoId, resourceId});
|
}
|
|
|
}
|