Punishment has traditionally been considered a more effective mechanism to promote cooperation than reward, but this is not necessarily the case if they are driven by inequity aversion (IA). A complete sense of fairness includes first-order and second-order IAs which refer to protests against advantageous and disadvantageous inequity, respectively. In this paper, such protests refer to the punishment and reward in payoff. To study the effect of IAs on human cooperation, we model a four-strategy system in spatial public goods game (PGG) with cooperators (Cs), first-order and second-order inequity-averse individuals (FIAs and SIAs), as well as defectors (Ds). The phase diagrams of the system illustrate that the presence of IAs can improve the cooperation level of population, and the effectiveness of different types of IAs are affected by several factors. Through the exploration of some phases and phase transitions, we conclude that a higher r (synergy factor) improves the competitiveness of SIAs more than that of FIAs, while a higher α (the factor of punishment and reward costs) undermines the cooperation promoting effect of FIAs more than that of SIAs. Such results are mainly related to the different spread patterns of their clusters. Unexpectedly, the increase of β (the factor of punishment and reward intensity) sometimes has a positive effect on the spread of defectors, which is attributed to the emergence of the self-organizing cyclic state among Cs, SIAs and Ds. Furthermore, indirect territorial competition can be observed for a high r, where Cs, FIAs and SIAs compete separately with Ds, and SIAs are more competitive than FIAs as a result.