Theoretical study of interplay of superconductivity and antiferromagnetism in rate earth ternary compounds