left join (select meet_id,count(id) num from ajh_meeting_send where send_status = 1 GROUP BY meet_id) s1 on s1.meet_id = m.id
left join (select meet_id,count(id) num from ajh_meeting_send GROUP BY meet_id) s2 on s2.meet_id = m.id
left join (select DISTINCT sa.meet_id,ma.num from ajh_meeting_send sa left join (select meets_id,count(id) num from ajh_meeting_attend GROUP BY meets_id) ma on ma.meets_id = sa.id) a on a.meet_id = s2.meet_id
left join (select sa.meet_id,sum(ifnull(ma.num,0)) num from ajh_meeting_send sa
left join (select meets_id,ifnull(count(id),0) num from ajh_meeting_attend GROUP BY meets_id) ma on ma.meets_id = sa.id
where sa.meet_id is not null GROUP BY sa.meet_id
) a on a.meet_id = s2.meet_id
WHERE 1 = 1
<iftest="ajhMeeting.departId !=null and ajhMeeting.departId!=''">