| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | |
| | | public List<T> findList(Query query) {
|
| | | return mongoTemplate.find(query, this.getEntityClass());
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 统计数量
|
| | | * |
| | | * @param query
|
| | | * @return
|
| | | */
|
| | | public long count(Query query) {
|
| | | return mongoTemplate.count(query, this.getEntityClass());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 主键查询
|