类似这样的语句如何用 Spring data JPA 去实现?
select cm.club_id as clubId, SUM(bt.wait_account) AS tenderTotal,
cm.user_id as userId, c.club_number as clubNumber, u.username AS userName
FROM club_member cm
LEFT JOIN club c ON cm.club_id = c.id
LEFT JOIN user u ON cm.user_id = u.user_id
INNER JOIN borrow_tender bt ON cm.user_id = bt.user_id
WHERE c. STATUS = 1 AND cm. STATUS = 0
GROUP BY cm.club_id
ORDER BY tenderTotal DESC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论