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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?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="PrOrderDetailQuery">
        <![CDATA[
 
select distinct a.prod_id,a.prod_did,a.prod_pror_id,a.prod_bbpr_id,a.prod_bbst_id,
a.prod_order_size,a.prod_task_size,a.prod_entry_size,a.prod_exit_size,
a.prod_price,a.prod_quantity,a.prod_sale_goods,a.prod_sale_type,
a.prod_flagp,a.prod_flags,a.prod_flagp_update,a.prod_flags_update,
a.prod_urgent,a.prod_flagt,a.prod_remark,
 
d.bbpr_name prod_bbpr_name,d.bbpr_name,d.bbpr_style prod_bbpr_style,e.bbst_name prod_bbst_name,e.bbst_style prod_bbst_style,
h.sydi_name prod_sale_method,
c.bbbp_name prod_bbbp_name,c.bbbp_name,b.pror_saler prod_pror_saler,
b.pror_sn prod_pror_sn,b.pror_sn,b.pror_order_date
 
from
pr_order_detail a left join
pr_order b on b.pror_id=a.prod_pror_id left join
bb_business_partner c on c.bbbp_id=b.pror_bbbp_id left join
bb_product d on a.prod_bbpr_id=d.bbpr_id left join
bb_stuff e on a.prod_bbst_id=e.bbst_id left join
bb_station f on b.pror_bbta_id=f.bbta_id left join
sys_dictionary h on h.sydi_id=b.pror_sydi_id
 
where 1=1
<<and c.bbbp_name=:prodBbbpName>>
<<and b.pror_saler=:prodProrSaler>>
<<and d.bbpr_name=:prodBbprName>>
<<and d.bbpr_style=:prodBbprStyle>>
<<and e.bbst_name=:prodBbstName>>
<<and e.bbst_style=:prodBbstStyle>>
<<and b.pror_sn=:prodProrSn>>
<<and a.prod_flagp=:prodFlagp>>
<<and a.prod_flags=:prodFlags>>
<<and a.prod_flags !=:notProdFlags>>
<<and a.prod_flagt=:prodFlagt>>
<<and f.bbta_id=:bbtaId>>
<<and b.pror_order_date>=:beginOrderDate>>
<<and b.pror_order_date<=:endOrderDate>>
<<and b.pror_send_date>=:beginSendDate>>
<<and b.pror_send_date<=:endSendDate>>
<<and a.prod_sale_goods=:prodSaleGoods>>
<<and 1=:produce and a.prod_quantity > 0>>
<<and 2=:order and a.prod_quantity=0>>
<<and a.prod_id=:prodId>>
   and ##CONDITIONS##
order by b.pror_order_date asc
 
        ]]>
    </sql-query>
</hibernate-mapping>