LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
WHERE i.DEL_FLAG = '0'
WHERE i.DEL_FLAG = '0'
AND i.CUSTOMER_ID = #{customerId}
AND i.CUSTOMER_ID = #{customerId}
<iftest="agencyId != null and agencyId != ''">
AND i.SPONSOR_ID = #{agencyId}
</if>
AND i.ACT_STATUS != 'finished' AND i.ACT_STATUS != 'canceled'
AND i.ACT_STATUS != 'finished' AND i.ACT_STATUS != 'canceled'