select count(baseuu.realname) as total, 
count(uu2.id)as unknownCount, 
count(uu3.id)as wuxueliCount, 
count(uu4.id)as xiaoxueCount, 
count(uu5.id)as chuzhongCount, 
count(uu6.id)as gaozhongCount, 
count(uu7.id)as dazhuanCount, 
count(uu8.id)as benkeCount, 
count(uu9.id)as shuoshiCount, 
count(uu10.id)as boshiCount, 
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 uu2 on baseuu.id = uu2.id and uu2.education is null
left join t_s_user uu3 on baseuu.id = uu3.id and uu3.education = '0'
left join t_s_user uu4 on baseuu.id = uu4.id and uu4.education = '1'
left join t_s_user uu5 on baseuu.id = uu5.id and uu5.education = '2'
left join t_s_user uu6 on baseuu.id = uu6.id and uu6.education = '3'
left join t_s_user uu7 on baseuu.id = uu7.id and uu7.education = '4'
left join t_s_user uu8 on baseuu.id = uu8.id and uu8.education = '5'
left join t_s_user uu9 on baseuu.id = uu9.id and uu9.education = '6'
left join t_s_user uu10 on baseuu.id = uu10.id and uu10.education = '7'
where  pers.leave_date is null and baseuu.delete_flag = '0' and dp.glcname is not null 
GROUP BY dp.glcname