The clamped---clamped beam has attracted increasing attention in the area of piezoelectric energy harvesting and transducer. In this paper, we present the theoretical models of clamped---clamped piezoelectric unimorph and bimorph beams with a quasi-static force in the middle. Based on the models, numerical studies are carried out to compare the generated charge, open-circuit voltage and generated energy of the piezoelectric beams under different condition. The simulation results demonstrate that the output performance of the beams are depended on the bonding position and electromechanical properties of the piezoelectric layer, and the length ratio, thickness ratio and the Young's modulus ratio (YMR) of the piezoelectric layer and substrate. Specifically, the unimorph and bimorph beams share the same optimal length ratio while their optimal width ratio and thickness ratio are different. The YMR imposes a great impact on the performance of the beam both in the unimorph and bimorph cases. As a generalization, the models are not only suitable for the beam with a non-uniform cross-section but also applicable for the beam with uniform cross-section. The analyses can be used to improve the performance of the clamped---clamped beam working as an energy harvester and transducer.