<?xml version="1.0"?>
|
<!DOCTYPE hibernate-mapping PUBLIC
|
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
|
<hibernate-mapping>
|
<sql-query name="IoDeliverSentSizeQuery">
|
<![CDATA[
|
|
select
|
a.prod_order_size,a.prod_quantity,
|
ifnull((
|
select
|
sum(iodd_size)
|
from
|
io_deliver_detail
|
|
where 1=1
|
and iodd_prod_id=prod_id
|
and iodd_type='成品'
|
and iodd_goods_type='销售产品'
|
), 0) sent_size,
|
ifnull((
|
select
|
sum(iodd_size)
|
from
|
io_deliver_detail left join
|
io_deliver on iode_id=iodd_iode_id
|
|
where 1=1
|
and iodd_prod_id=prod_id
|
and iodd_type='成品'
|
and iodd_goods_type='销售产品'
|
and iode_is_task='Y'
|
), 0) audited_size,
|
prod_entry_size,
|
ifnull((
|
select
|
sum(reop_size)
|
from
|
ref_order_product_entry
|
where 1=1
|
and reop_prod_id=prod_id
|
),0) order_occupation_in_share,
|
prod_exit_size,
|
ifnull((
|
select
|
sum(b.reop_size) occupation_size
|
from
|
pr_product_entry_detail a left join
|
ref_order_product_entry b on a.prpd_id=b.reop_prpd_id
|
where 1=1
|
<<and a.prpd_prod_id=:ioddProdId>>
|
and a.prpd_flag_use='Y'
|
and b.reop_flag='N'
|
),0) other_order_occupation
|
from
|
pr_order_detail a
|
|
where 1=1
|
and a.prod_sale_goods='销售产品'
|
and a.prod_sale_type='成品'
|
<<and prod_id=:ioddProdId>>
|
|
]]>
|
</sql-query>
|
</hibernate-mapping>
|