select count(baseuu.realname) as total, 

count(uu3.id)as feinongCount, 
count(uu4.id)as nongyeCount,
count(uu5.id)as chengzhenCount, 
count(uu6.id)as unknownCount, 

dp.glcname as departname
from t_bus_user_personnel pers
LEFT JOIN t_s_base_user baseuu on baseuu.id = pers.userid
left join t_s_user_org uorg on uorg.user_id = pers.userid and uorg.ifpluralism = '0'
left join t_s_user uu on baseuu.id = uu.id
left join t_s_depart dp on dp.ID = uorg.org_id
left join t_s_user uu3 on baseuu.id = uu3.id and uu3.hktype = '1'
left join t_s_user uu4 on baseuu.id = uu4.id and uu4.hktype = '2'
left join t_s_user uu5 on baseuu.id = uu5.id and uu5.hktype = '3'
left join t_s_user uu6 on baseuu.id = uu6.id and uu6.hktype is null
where  pers.leave_date is null and baseuu.delete_flag = '0' and dp.glcname is not null 
GROUP BY dp.glcname