select tb.hospital_no,sum(tb.costs),sum(tb.rc),sum(tb.xy_costs),sum(tb.zy_costs),sum(tb.cy_costs),
sum(tb.matri_costs),sum(tb.blood_costs),sum(tb.x_costs),sum(tb.lab_costs),sum(tb.bed_costs),
sum(tb.other_costs),sum(tb.fl_costs),sum(tb.o_costs),sum(tb.zc_costs),sum(tb.food_costs),
sum(tb.ss_costs),sum(tb.zl_costs),sum(tb.hl_costs),sum(tb.jl_costs),sum(tb.ect_costs),
sum(tb.dsa_costs),sum(tb.mri_costs),sum(tb.ct_costs)
from (select (case r.hospital_no when '01' then '城中院区' else '阳湖院区'end) hospital_no,t.patient_id,t.visit_id,
decode(sum(t.costs),0, '', to_char(sum(t.costs), '9999999999.99')) as costs, count(*) as rc,
decode(sum(t.xy_costs),0, '', to_char(sum(t.xy_costs), '9999999999.99')) as xy_costs,
decode(sum(t.zy_costs),0, '', to_char(sum(t.zy_costs), '9999999999.99')) zy_costs,
decode(sum(t.cy_costs),0, '', to_char(sum(t.cy_costs), '9999999999.99')) cy_costs,
decode(sum(t.matri_costs),0, '', to_char(sum(t.matri_costs), '9999999999.99')) matri_costs,
decode(sum(t.blood_costs),0, '', to_char(sum(t.blood_costs), '9999999999.99')) blood_costs,
decode(sum(t.x_costs),0, '', to_char(sum(t.x_costs), '9999999999.99')) x_costs,
decode(sum(t.lab_costs),0, '', to_char(sum(t.lab_costs), '9999999999.99')) lab_costs,
decode(sum(t.bed_costs),0, '', to_char(sum(t.bed_costs), '9999999999.99')) bed_costs,
decode(sum(t.other_costs),0, '', to_char(sum(t.other_costs), '9999999999.99')) other_costs,
decode(sum(t.fl_costs),0, '', to_char(sum(t.fl_costs), '9999999999.99')) fl_costs,
decode(sum(t.o_costs),0, '', to_char(sum(t.o_costs), '9999999999.99')) o_costs,
decode(sum(t.zc_costs),0, '', to_char(sum(t.zc_costs), '9999999999.99')) zc_costs,
decode(sum(t.food_costs),0, '', to_char(sum(t.food_costs), '9999999999.99')) food_costs,
decode(sum(t.ss_costs),0, '', to_char(sum(t.ss_costs), '9999999999.99')) ss_costs,
decode(sum(t.zl_costs),0, '', to_char(sum(t.zl_costs), '9999999999.99')) zl_costs,
decode(sum(t.hl_costs),0, '', to_char(sum(t.hl_costs), '9999999999.99')) hl_costs,
decode(sum(t.jl_costs),0, '', to_char(sum(t.jl_costs), '9999999999.99')) jl_costs,
decode(sum(t.ect_costs),0, '', to_char(sum(t.ect_costs), '9999999999.99')) ect_costs,
decode(sum(t.dsa_costs),0, '', to_char(sum(t.dsa_costs), '9999999999.99')) dsa_costs,
decode(sum(t.mri_costs),0, '', to_char(sum(t.mri_costs), '9999999999.99')) mri_costs,
decode(sum(t.ct_costs),0, '', to_char(sum(t.ct_costs), '9999999999.99')) ct_costs
from HIS.BI_YBJZ_DETAIL t
left join his.dept_vs_class q on t.dept_code = q.dept_code left join his.dept_class r on q.ksbm = r.ksbm
where t.js_date >= trunc(sysdate, 'yyyy') and t.js_date <= trunc(sysdate) and r.hospital_no is not null group by r.hospital_no, t.patient_id, t.visit_id ) tb group by tb.hospital_no
sum(tb.matri_costs),sum(tb.blood_costs),sum(tb.x_costs),sum(tb.lab_costs),sum(tb.bed_costs),
sum(tb.other_costs),sum(tb.fl_costs),sum(tb.o_costs),sum(tb.zc_costs),sum(tb.food_costs),
sum(tb.ss_costs),sum(tb.zl_costs),sum(tb.hl_costs),sum(tb.jl_costs),sum(tb.ect_costs),
sum(tb.dsa_costs),sum(tb.mri_costs),sum(tb.ct_costs)
from (select (case r.hospital_no when '01' then '城中院区' else '阳湖院区'end) hospital_no,t.patient_id,t.visit_id,
decode(sum(t.costs),0, '', to_char(sum(t.costs), '9999999999.99')) as costs, count(*) as rc,
decode(sum(t.xy_costs),0, '', to_char(sum(t.xy_costs), '9999999999.99')) as xy_costs,
decode(sum(t.zy_costs),0, '', to_char(sum(t.zy_costs), '9999999999.99')) zy_costs,
decode(sum(t.cy_costs),0, '', to_char(sum(t.cy_costs), '9999999999.99')) cy_costs,
decode(sum(t.matri_costs),0, '', to_char(sum(t.matri_costs), '9999999999.99')) matri_costs,
decode(sum(t.blood_costs),0, '', to_char(sum(t.blood_costs), '9999999999.99')) blood_costs,
decode(sum(t.x_costs),0, '', to_char(sum(t.x_costs), '9999999999.99')) x_costs,
decode(sum(t.lab_costs),0, '', to_char(sum(t.lab_costs), '9999999999.99')) lab_costs,
decode(sum(t.bed_costs),0, '', to_char(sum(t.bed_costs), '9999999999.99')) bed_costs,
decode(sum(t.other_costs),0, '', to_char(sum(t.other_costs), '9999999999.99')) other_costs,
decode(sum(t.fl_costs),0, '', to_char(sum(t.fl_costs), '9999999999.99')) fl_costs,
decode(sum(t.o_costs),0, '', to_char(sum(t.o_costs), '9999999999.99')) o_costs,
decode(sum(t.zc_costs),0, '', to_char(sum(t.zc_costs), '9999999999.99')) zc_costs,
decode(sum(t.food_costs),0, '', to_char(sum(t.food_costs), '9999999999.99')) food_costs,
decode(sum(t.ss_costs),0, '', to_char(sum(t.ss_costs), '9999999999.99')) ss_costs,
decode(sum(t.zl_costs),0, '', to_char(sum(t.zl_costs), '9999999999.99')) zl_costs,
decode(sum(t.hl_costs),0, '', to_char(sum(t.hl_costs), '9999999999.99')) hl_costs,
decode(sum(t.jl_costs),0, '', to_char(sum(t.jl_costs), '9999999999.99')) jl_costs,
decode(sum(t.ect_costs),0, '', to_char(sum(t.ect_costs), '9999999999.99')) ect_costs,
decode(sum(t.dsa_costs),0, '', to_char(sum(t.dsa_costs), '9999999999.99')) dsa_costs,
decode(sum(t.mri_costs),0, '', to_char(sum(t.mri_costs), '9999999999.99')) mri_costs,
decode(sum(t.ct_costs),0, '', to_char(sum(t.ct_costs), '9999999999.99')) ct_costs
from HIS.BI_YBJZ_DETAIL t
left join his.dept_vs_class q on t.dept_code = q.dept_code left join his.dept_class r on q.ksbm = r.ksbm
where t.js_date >= trunc(sysdate, 'yyyy') and t.js_date <= trunc(sysdate) and r.hospital_no is not null group by r.hospital_no, t.patient_id, t.visit_id ) tb group by tb.hospital_no
解决方案 »
- struts2国际化问题,回复者均给分!!
- 高手们,帮忙啊,关于socket数据流的问题
- jsp:forward的问题
- 请问在jsp中怎么调用(或实现)javascript中的escape()效果?
- struts多维数组怎么用标签显示在JSP?
- 大家帮帮忙,怎么在jsp中创建能够支持输入的下拉框??重谢!
- javabean 中,一点不解
- jsp中怎么获得客户端的charset?
- 高分请教高手:如何将Excel表单通过jsp嵌入到IE(或者Netscape)中
- spring mvc jsp页面传数据到控制器
- @Controller @RequestMapping无效问题...
- 有谁成功安装过jwsdp,帮我看看我怎么安装不了
(
tid int primary key identity,
tip001 varchar(20)
)