Hoursworked/day computation via Bio Logs
The idea I wrote in the comment http://sqlfiddle.com/#!9/785bc/5 :

select 
    a.userid,
    date(a.CHECKTIME),
    timediff(max(b.CHECKTIME), min(a.CHECKTIME)) as diff
from CHECKINOUT a
join CHECKINOUT b
    on date(a.CHECKTIME) = date(b.CHECKTIME) and a.userid = b.userid
where
    a.CHECKTYPE = 'I'
    AND b.CHECKTYPE = 'O'
group by date(a.CHECKTIME), userid;


But as I wrote, there is a problem with the days where one of the I/O rows is missing and you need to either fix your data or specify what to do in such case.