add getById, fix getIdByParams and fix MaintenanceHandler

Table fields are missing in AND conditions