SELECT `access` FROM `roles_routes` WHERE `role_id`=1
SELECT * FROM `roles` LEFT JOIN `roles_routes`
ON `roles`.`id` = `roles_routes`.`role_id`
WHERE `roles_routes`.`access`=1
OR (`roles_routes`.`access`>1
AND `roles_routes`.`access`=1)
SELECT *
FROM `user`
LEFT JOIN `user_info` ON `user`.`id` = `user_info`.`id`
WHERE `user_info`.`id`=(SELECT `id` FROM `user` WHERE `access`=1)
OR (`user_info`.`id`>(SELECT `id` FROM `user` WHERE `access`=1)
AND `user_info`.`user`=(SELECT `id` FROM `user` WHERE `access`=1))
ON `roles.id` = `roles_routes`.`role_id`
.SELECT * FROM `roles` LEFT JOIN `roles_routes`
ON `roles`.`id` = `roles_routes`.`role_id`
WHERE `roles_routes`.`access`=(SELECT `access` FROM `roles_routes` WHERE `role_id`=1)
OR (`roles_routes`.`access`>(SELECT `access` FROM `roles_routes` WHERE `role_id`=1)
AND `roles_routes`.`access`=(SELECT `access` FROM `roles_routes` WHERE `role_id`=1))