The invention belongs to the technical field of green buildings, and particularly relates to an environment-friendly and energy-saving green building which comprises a wall body, photovoltaic panels, connecting shafts, gear blocks and gears, the photovoltaic panels are installed on the periphery of the wall body, the connecting shafts are fixedly arranged on the surfaces of the photovoltaic panels, the connecting shafts are rotationally connected with the wall body, and the gear blocks are arranged on the connecting shafts. The front half part of the connecting shaft is fixedly provided with a tooth block, the front end of the tooth block is in meshed connection with a gear, the surface of the gear is fixedly provided with a tooth column, the front end of the gear is in meshed connection with a rack, the left side and the right side of the rack are fixedly connected with fixing frames, and the rack is connected with the adjacent rack through the fixing frames; a sliding rod is movably mounted in the middle of the wall body, a scraping plate is fixedly connected to the front end of the sliding rod, and a first spring is fixedly connected to the top of the scraping plate; when the building is used, the photovoltaic panels can be unfolded and stored at the same time, and when the photovoltaic panels are stored, the photovoltaic panels are automatically cleaned, and cleaning liquid is automatically supplemented.