I had an ilioinguinal hernia repair over 10 years ago and I believe my ilioinguinal nerve is the one which had been severed. I likewise have exactly the same issues you do -- there is definitely a connection. Prior to surgery, I could instantaneously get an erection, it was hard as steel and would last as long as it needed to. Afterwards, I struggle to get one using manual stimulation, and it quickly goes away without constant stimulation. What a nightmare.
I have since read about mesh-free repair. If one *needs* their hernia fixed, this is the only way I would go, and I would ask a huge amount of questions about nerves and scar tissue. If you can live with your problem, I would do that.