The newly observed P c (4312), P c (4440) and P c (4457) at the LHCb experiment are very close to the Σ cD and Σ cD * thresholds. In this work, we perform a systematic study and give a complete picture on the interactions between the Σ ( * ) c andD ( * ) systems in the framework of heavy hadron chiral perturbation theory, where the short-range contact interaction, long-range one-pion-exchange contribution, and intermediate-range two-pion-exchange loop diagrams are all considered. We first investigate the three P c states without and with considering the Λ c contribution in the loop diagrams. It is difficult to simultaneously reproduce the three P c s unless the Λ c is included. The coupling between the Σ ( * ) cD ( * ) and Λ cD ( * ) channels is crucial for the formation of these P c s. Our calculation supports the P c (4312), P c (4440) and P c (4457) to be the S-wave hidden-charm [Σ cD ] I=1/2 J=1/2 , [Σ cD * ] I=1/2 J=1/2 and [Σ cD * ] I=1/2 J=3/2 molecular pentaquarks, respectively. Our calculation disfavors the spin assignment J P = 1 2 − for P c (4457) and J P = 3 2 − for P c (4440), because the excessively enhanced spin-spin interaction is unreasonable in the present case. We obtain the complete mass spectra of the [Σ ( * ) cD ( * ) ] J systems with the fixed low energy constants. Our result indicates the existence of the [Σ *cD * ] J (J = 1 2 , 3 2 , 5 2 ) hadronic molecules. The previously reported P c (4380) might be a deeper bound one. Additionally, we also study the hidden-bottom Σ ( * ) b B ( * ) systems, and predict seven bound molecular states, which could serve as a guidance for future experiments. Furthermore, we also examine the heavy quark symmetry breaking effect in the hidden-charm and hidden-bottom systems by taking into account the mass splittings in the propagators of the intermediate states. As expected, the heavy quark symmetry in the bottom cases is better than that in the charmed sectors. We notice that the heavy quark symmetry in the Σ cD and Σ * cD systems is much worse for some fortuitous reasons. The heavy quark symmetry breaking effect is nonnegligible in predicting the effective potentials between the charmed hadrons.