We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@SearchBean(tables = "student_course sc", groupBy = "sc.course_id", autoMapTo = "sc") public class ScoreSum { private long courseId; @DbField("sum(sc.score)") private long totalScore; }
beanSearcher.searchList(ScoreSum.class, MapUtils.builder() .field(ScoreSum::getCourseId, 10) .build());
需要执行的 SQL 是:
select sc.course_id c_1, sum(sc.score) c_2 from student_course sc where sc.course_id = 10 group by sc.course_id
beanSearcher.searchList(ScoreSum.class, MapUtils.builder() .field(ScoreSum::getTotalScore, 500) .build());
select sc.course_id c_1, sum(sc.score) c_2 from student_course sc group by sc.course_id having c_2 = 500
The text was updated successfully, but these errors were encountered:
已在 v3.8.0 中实现:https://github.com/ejlchina/bean-searcher/releases/tag/v3.8.0
v3.8.0
Sorry, something went wrong.
No branches or pull requests
实体类:
检索时
分组字段加条件,条件放到 where 子句中:
需要执行的 SQL 是:
聚合字段加条件,条件放到 having 子句中:
需要执行的 SQL 是:
The text was updated successfully, but these errors were encountered: