change update from simple update sql to if not exists insert else update
fix one bug of not use is_valid_period_new in hb_service