update mall_agent_record set state = 2 where id = #{memberId} delete from mall_agent_record where member_id = #{memberId} and state = #{state}