select c.username,c.businessname ywlx,c.acceptname hj, count(*) bll
from (select d.zllb businessname,
b.name_ acceptname,
(select t.staff_name
from platform.bt_user t
where t.username = b.assignee_) username,
cast(b.start_time_ as date) dealtime
from gisqbpm.act_hi_procinst a
inner join gisqbpm.act_hi_taskinst b
on a.proc_inst_id_ = b.proc_inst_id_
and b.assignee_ <> '-1'
inner join bdcdj.slsq d
on d.ywh = a.business_key_) c
where c.dealtime between
to_date('2016/1/1 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and
to_date('2016/8/9 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
group by c.username, c.businessname, c.acceptname
order by c.username