SELECT `a`.*, `b`.`username`, `c`.`file_name`, `c`.`file_location`, `d`.`id` as `employment_id`, `d`.`date_joined`, `d`.`date_commencement`, `d`.`date_termination`, `d`.`position_id`, `e`.`position` as `position_name`, `d`.`company_id`, `f`.`name` as `company_name`, `g`.`branch_id`, `h`.`name` as `branch_name`, `d`.`department_id`, `g`.`name` as `department_name`, `e`.`parent_id` as `position_category_id`, `i`.`position` as `position_category`
FROM `user` `a`
JOIN `user__login` `b` ON `b`.`user_id` = `a`.`id`
LEFT JOIN `user__picture` `c` ON `a`.`profile_picture_id` = `c`.`id`
LEFT JOIN `user__employment_detail` `d` ON `d`.`user_id` = `a`.`id`
LEFT JOIN `company__position` `e` ON `d`.`position_id` = `e`.`id`
LEFT JOIN `company` `f` ON `d`.`company_id` = `f`.`id`
LEFT JOIN `company__department` `g` ON `d`.`department_id` = `g`.`id`
LEFT JOIN `company__branch` `h` ON `g`.`branch_id` = `h`.`id`
LEFT JOIN `company__position` `i` ON `e`.`parent_id` = `i`.`id`
WHERE `a`.`id` != '45'
AND `a`.`staff_id` = 'c45'
AND `a`.`status` =0
AND `a`.`is_delete` =0
ORDER BY `a`.`name` ASC