select left(task.planendtime,10) date,
floor((sum(case  when  task.taskstatus ='20' then 1 else 0 end)/count(task.id))*100) rate
from p_projecttask task
where 1=1
<#if projectid ?exists && projectid ?length gt 0>
and task.projectid = :projectid
</#if>
and left(task.planendtime,10) <= :today 
and left(task.planendtime,10) > :laseweekday 
group by date