use real table to join partner to partner rel
This commit is contained in:
parent
802cc3a622
commit
3f1ef1b8e2
@ -88,9 +88,9 @@ public class HsOfficeDebitorEntity implements BaseEntity<HsOfficeDebitorEntity>,
|
|||||||
(
|
(
|
||||||
SELECT DISTINCT partner.uuid
|
SELECT DISTINCT partner.uuid
|
||||||
FROM hs_office.partner_rv partner
|
FROM hs_office.partner_rv partner
|
||||||
JOIN hs_office.relation_rv dRel
|
JOIN hs_office.relation dRel
|
||||||
ON dRel.uuid = debitorreluuid AND dRel.type = 'DEBITOR'
|
ON dRel.uuid = debitorreluuid AND dRel.type = 'DEBITOR'
|
||||||
JOIN hs_office.relation_rv pRel
|
JOIN hs_office.relation pRel
|
||||||
ON pRel.uuid = partner.partnerRelUuid AND pRel.type = 'PARTNER'
|
ON pRel.uuid = partner.partnerRelUuid AND pRel.type = 'PARTNER'
|
||||||
WHERE pRel.holderUuid = dRel.anchorUuid
|
WHERE pRel.holderUuid = dRel.anchorUuid
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user