select g.dept_id,
count(g.dept_id) as '总数',
sum(case g.is_deal when '0' then 1 else 0 end) as '办理',
sum(case g.is_deal when '1' then 1 else 0 end) as '未办理'
from getnumber g where g.style='0' or g.style is null
group by g.dept_id
count(g.dept_id) as '总数',
sum(case g.is_deal when '0' then 1 else 0 end) as '办理',
sum(case g.is_deal when '1' then 1 else 0 end) as '未办理'
from getnumber g where g.style='0' or g.style is null
group by g.dept_id