Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DarMi7 authored Nov 3, 2023
1 parent ebad3a2 commit d1d93db
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,28 @@ a lambda-based object-oriented mongo query plug-in <br>
@Repository
public interface TaskRepository extends MongoRepository<Task, String> {
default Page<Task> search(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.is(Task::getName, taskCriteria.getName())
.is(Task::getType, taskCriteria.getFuzzyName())
.reg(Task::getName, taskCriteria.getName())
.gt(Task::getPoints, taskCriteria.getPoints())
.gt(Task::getCreated, taskCriteria.getBegin())
.lt(Task::getCreated, taskCriteria.getEnd())
.page(taskCriteria.getPagination());
}
default Page<Task> aggregate(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.is(Task::getName, taskCriteria.getName())
.is(Task::getType, taskCriteria.getFuzzyName())
.reg(Task::getName, taskCriteria.getName())
.gt(Task::getPoints, taskCriteria.getPoints())
.gt(Task::getCreated, taskCriteria.getBegin())
.lt(Task::getCreated, taskCriteria.getEnd())
.aggregate(taskCriteria.getPagination());
}
default Page<Task> search(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.is(Task::getName, taskCriteria.getName())
.is(Task::getType, taskCriteria.getFuzzyName())
.reg(Task::getName, taskCriteria.getName())
.gt(Task::getPoints, taskCriteria.getPoints())
.gt(Task::getCreated, taskCriteria.getBegin())
.lt(Task::getCreated, taskCriteria.getEnd())
.page(taskCriteria.getPagination());
}
default Page<Task> aggregate(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.is(Task::getName, taskCriteria.getName())
.is(Task::getType, taskCriteria.getFuzzyName())
.reg(Task::getName, taskCriteria.getName())
.gt(Task::getPoints, taskCriteria.getPoints())
.gt(Task::getCreated, taskCriteria.getBegin())
.lt(Task::getCreated, taskCriteria.getEnd())
.aggregate(taskCriteria.getPagination());
}
}
}
具体使用案例参考demo模块,如有什么问题欢迎留言,如果有用请为我点亮star。<br>
Expand Down

0 comments on commit d1d93db

Please sign in to comment.