liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?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,
    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=prod_id
    ),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>