package com.yeshi.fanli.dao.user.invite;
|
|
import java.util.List;
|
|
import org.springframework.data.mongodb.core.query.Criteria;
|
import org.springframework.data.mongodb.core.query.Query;
|
import org.springframework.stereotype.Repository;
|
|
import com.yeshi.fanli.dao.MongodbBaseDao;
|
import com.yeshi.fanli.entity.bus.user.ThreeSaleDetail;
|
|
@Repository
|
public class ThreeSaleDetailDao extends MongodbBaseDao<ThreeSaleDetail> {
|
|
/**
|
* 根据上级ID与队员层级查询队员
|
* @Title: listByBossUidAndLevel
|
* @Description:
|
* @param bossUid
|
* @param level
|
* @param start
|
* @param count
|
* @return
|
* List<ThreeSaleDetail> 返回类型
|
* @throws
|
*/
|
public List<ThreeSaleDetail> listByBossUidAndLevel(Long bossUid, int level, int start, int count) {
|
Query query = new Query();
|
query.skip(start);
|
query.limit(count);
|
query.addCriteria(
|
new Criteria().andOperator(Criteria.where("bossUid").is(bossUid), Criteria.where("level").is(level)));
|
return findList(query);
|
}
|
|
public long countByBossUidAndLevel(Long bossUid, int level) {
|
Query query = new Query();
|
query.addCriteria(
|
new Criteria().andOperator(Criteria.where("bossUid").is(bossUid), Criteria.where("level").is(level)));
|
return count(query);
|
}
|
|
/**
|
* 根据上级ID与最小队员层级查询队员
|
* @Title: listByBossUidAndMinLevel
|
* @Description:
|
* @param bossUid
|
* @param minLevel
|
* @param start
|
* @param count
|
* @return
|
* List<ThreeSaleDetail> 返回类型
|
* @throws
|
*/
|
public List<ThreeSaleDetail> listByBossUidAndMinLevel(Long bossUid, int minLevel, int start, int count) {
|
Query query = new Query();
|
query.skip(start);
|
query.limit(count);
|
query.addCriteria(new Criteria().andOperator(Criteria.where("bossUid").is(bossUid),
|
Criteria.where("level").gte(minLevel)));
|
return findList(query);
|
}
|
|
public long countByBossUidAndMinLevel(Long bossUid, int minLevel) {
|
Query query = new Query();
|
query.addCriteria(new Criteria().andOperator(Criteria.where("bossUid").is(bossUid),
|
Criteria.where("level").gte(minLevel)));
|
return count(query);
|
}
|
|
public List<ThreeSaleDetail> listByWorkerUid(Long uid) {
|
Query query = new Query();
|
query.addCriteria(Criteria.where("workerUid").is(uid));
|
return findList(query);
|
}
|
|
}
|