yulichang / mybatis-plus-join

支持连表查询的mybatis-plus,mybatis-plus风格的连表操作提供wrapper.leftJoin(),wrapper.rightJoin()等操作
https://yulichang.github.io/mybatis-plus-join-doc/
Apache License 2.0
971 stars 113 forks source link

这段SQL怎么用 MPJLambdaWrapper 实现? #107

Closed qichhhhh closed 3 months ago

qichhhhh commented 3 months ago
SELECT a.*, v.sealSum
FROM A a
LEFT JOIN (
    SELECT aa.id AS aaId, COUNT(b.id) AS sealSum
    FROM A aa
    LEFT JOIN B b ON aa.id = b.business_id
    GROUP BY aa.id
) v ON a.id = v.aaId

好像 LEFT JOIN 方法中没有办法生成临时表?

yulichang commented 3 months ago

不支持