SELECT pc.*,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id = pc.primary_auditor_id) AS primary_auditor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=pc.secondary_auditor_id
) AS secondary_auditor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=pc.create_by
) AS create_name
, (
SELECT org.name
FROM dlp_base.sys_org org
WHERE org.org_id in (select org_id from dlp_base.sys_user where user_id = pc.create_by)) AS org_name
FROM purchase_catalogue pc
SELECT pc.*,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id = pc.primary_auditor_id) AS primary_auditor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=pc.secondary_auditor_id
) AS secondary_auditor_name
, (
SELECT org.name
FROM dlp_base.sys_org org
WHERE org.org_id in (select org_id from dlp_base.sys_user where user_id = pc.create_by)) AS org_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=pc.create_by
) AS create_name
FROM purchase_catalogue pc
WHERE pc.purchase_catalogue_id = #{purchaseCatalogueId}