adjust history table ui
fix bug: use leave room

update history sql miss endTime is null limitation