实施 #1515
(器械科)审计需要耗材数据,含:耗材名称,单价,用量,总金额 ,统计日期为:2022年1月 5月 12月
0%
描述
注:按照耗材名称和单价统计,耗材名称相同单价不一样也按照不同数据处理
文件
历史记录
由 周志良 18702619850 更新于 大约一年 之前
select * from (
select a.item_code 编码,
a.item_name 名称,
b.specs 规格,
b.stock_unit 单位,
b.unit_price 单价,
sum(a.qty) 数量,
round(sum(a.tot_cost), 2) 金额
from fin_ipb_itemlist a, fin_com_undruginfo b
where a.item_code = b.item_code
and a.fee_date between
to_date('2022-12-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and
to_date('2022-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
and a.fee_code in ('056','057','058','060','062','061')
and b.valid_state = 1
group by a.item_name,
b.unit_price,
b.supply_name,
b.producer_name,
b.stock_unit,
b.unit_price,
b.specs,
a.item_code
union all
select a.item_code 编码,
a.item_name 名称,
b.specs 规格,
b.stock_unit 单位,
b.unit_price 单价,
sum(a.qty) 数量,
round(sum(a.own_cost ), 2) 金额
from fin_opb_feedetail a, fin_com_undruginfo b
where a.item_code = b.item_code
and a.fee_date between
to_date('2022-12-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and
to_date('2022-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
and a.fee_code in ('056','057','058','060','062','061')
and b.valid_state = 1
group by a.item_name,
b.unit_price,
b.supply_name,
b.producer_name,
b.stock_unit,
b.unit_price,
b.specs,
a.item_code
)
由 彭银生 13979856157 更新于 大约一年 之前
select * from (
select a.item_code 编码,
a.item_name 名称,
b.specs 规格,
b.stock_unit 单位,
b.unit_price 单价,
sum(a.qty) 数量,
round(sum(a.tot_cost), 2) 金额
from fin_ipb_itemlist a, fin_com_undruginfo b
where a.item_code = b.item_code
and a.fee_date between
to_date('2022-05-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and
to_date('2022-05-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
and a.fee_code in ('056','057','058','060','062','061','034','019')
and b.valid_state = 1
group by a.item_name,
b.unit_price,
b.supply_name,
b.producer_name,
b.stock_unit,
b.unit_price,
b.specs,
a.item_code
union all
select a.item_code 编码,
a.item_name 名称,
b.specs 规格,
b.stock_unit 单位,
b.unit_price 单价,
sum(a.qty) 数量,
round(sum(a.own_cost ), 2) 金额
from fin_opb_feedetail a, fin_com_undruginfo b
where a.item_code = b.item_code
and a.fee_date between
to_date('2022-05-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and
to_date('2022-05-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
and a.fee_code in ('056','057','058','060','062','061','034','019')
and b.valid_state = 1
group by a.item_name,
b.unit_price,
b.supply_name,
b.producer_name,
b.stock_unit,
b.unit_price,
b.specs,
a.item_code
)