admin
2021-08-27 8fee151ffae0c3818694b7318583814bf92663e2
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
package com.yeshi.buwan.dao.juhe.pptv;
 
import com.yeshi.buwan.dao.base.MongodbBaseDao;
import com.yeshi.buwan.videos.pptv.entity.PPTVProgram;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;
 
import java.util.ArrayList;
import java.util.List;
 
@Repository
public class PPTVProgramDao extends MongodbBaseDao<PPTVProgram> {
 
    public List<PPTVProgram> list(List<String> programCodeList) {
 
        Query query = new Query();
        List<Criteria> whereList = new ArrayList<>();
        for (String id : programCodeList) {
            whereList.add(Criteria.where("programCode").is(id));
        }
        Criteria[] wheres = new Criteria[whereList.size()];
        whereList.toArray(wheres);
        query.addCriteria(new Criteria().orOperator(wheres));
        return findList(query);
    }
 
}