If you are forced to relocate due to illegal construction, there is no compensation, because you are the first to violate the construction and can only bear the losses yourself. If the farm is required to relocate due to environmental problems, it can get some compensation. As for the amount, it depends on the local requirements.
Article 25 of the Regulations on the Prevention and Control of Pollution from Livestock and Poultry Breeding (Draft for Comments) stipulates that if it is really necessary to close or relocate the existing livestock and poultry breeding sites, resulting in economic losses to livestock and poultry breeders, the local people's government shall compensate them, because of livestock development planning, adjustment of urban and rural planning, delimitation of prohibited breeding areas, restricted breeding areas, or rectification of areas where livestock and poultry are intensively raised in bulk.