update ta_share_activity set activity_status = 1 where NOW() < start_time and activity_status != 2 update ta_share_activity t set activity_status = 0 where t.activity_status != '2' and NOW() BETWEEN t.start_time and t.end_time update ta_share_activity set activity_status = 2 where NOW() > end_time and activity_status != 2