How to ajex id get in controller page and define select query

How to ajex id get in controller page and define select query