0
|
CD20160914Lv8专家互助发布于2022-5-13 17:51
|
sql中如何写的。你的时间参数名称与你控件的名称是否一样?检查一下
|
-
yzmF5b2s7488365(提问者)
- select distinct
a.hospital_name,
a.patient_id,
a.visit_id,
a.inpati_id,
a.patient_name,
a.st_date,
a.item_code,
a.item_name,
a.unit_price,
a.charge_date,
(b.amount::float - a.in_days::float) as overstep_amount,
((b.amount::float - a.in_days::float) * a.unit_price::float ) as overstep_price,
a.exec_dept_name,
a.in_dept_name,
a.out_dept_name,
a.in_days,
a.admission_date,
a.discharge_date,
a.open_dept_name,
a.real_charge_quantity,
a.expense_category_name,
a.real_charge_amount,
a.assess_unit,
a.accounding_unit,
a.nurse_level
from
odr_dwm.dwm_msfee_check a
join(
select
inpati_id,
sum(real_charge_quantity::float) as amount
from
odr_dwm.dwm_msfee_check
where
check_type_code =\'4\'
and check_out_date between to_date(\'${st_date}\', \'yyyy-mm-dd\') and to_date(\'${StDate_to}\', \'yyyy-mm-dd\') + 1
${if(len(Area_Code) == 0,\"\",\"and hospital_code = \'\" +Area_Code+\"\'\")}
group by hospital_code,patient_id,visit_id,inpati_id,st_date,item_code
) b on a.inpati_id = b.inpati_id
where
a.check_type_code = \'4\'
and check_out_date between to_date(\'${st_date}\', \'yyyy-mm-dd\') and to_date(\'${StDate_to}\', \'yyyy-mm-dd\') + 1
${if(len(Area_Code) == 0,\"\",\"and a.hospital_code = \'\" +Area_Code+\"\'\")}
order by hospital_name, patient_id, patient_name, admission_date, discharge_date, open_dept_name, charge_date
-
CD20160914 回复 yzmF5b2s7488365(提问者)
- 检查一下你参数面板的控件名称是不是st_date 和stdate_to两个名称,
|
|