select sum(数量) as 数量 from 你的表名称
where 1=1
and mytime >='${format(today(),"yyyy-MM-dd"+" 10:00:00")}'
and mytime <='${format(today(),"yyyy-MM-dd"+" 16:00:00")}'
/*取每天10-16的数据求和*/
求和不就好了 然后where限制时间段