select STR_TO_DATE(concat(recordTim,daytime+1),'%X%V%w') as recordTime,seccessNum,failureNum,totalNum
from (select yearweek(visitTime) as recordTim,
weekday(visitTime) as daytime,
sum(case when visitStatus=1 then 1 else 0 end) as seccessNum,
sum(case when visitStatus=0 then 1 else 0 end) as failureNum ,
count(*) as totalNum
and visitTime > "2016-12-16 11:11:06.0"
and visitTime < "2016-12-20 11:16:06.0"
group by recordTim) as temtable