admin
2021-03-20 ad3ac53da1c3a11a96ae62d790aa61a81b9eab91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.yeshi.buwan.dao;
 
import com.yeshi.buwan.dao.base.BaseDao;
import org.springframework.stereotype.Repository;
 
import com.yeshi.buwan.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});
    }
 
 
}