--查询关联数据
select a.name, a.status, nvl(b.price, 0) as price,c.amount as amount
,c.prescriptionid
from d_medical_service_item a,
d_medical_item b,
CLINIC_TOTAL_TYPE_MAPPNG c
where exists (select 1
from d_medical_service_item b
where a.parent_code = b.code
and b.parent_code = 12)
and a.code = c.type_id(+)
and a.code = b.id(+) and c.prescriptionid = 'cf10004';
select a.name, a.status, nvl(b.price, 0) as price,c.amount as amount
,c.prescriptionid
from d_medical_service_item a,
d_medical_item b,
CLINIC_TOTAL_TYPE_MAPPNG c
where exists (select 1
from d_medical_service_item b
where a.parent_code = b.code
and b.parent_code = 12)
and a.code = c.type_id(+)
and a.code = b.id(+) and c.prescriptionid = 'cf10004';