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="InOutReturnBillReportQuery">
        <![CDATA[
 
SELECT
    a.bbpr_sn,
    a.bbpr_name,
    a.bbpr_en_name,
    a.bbpr_unit,
    a.bbpr_style,
    a.bbpr_brand,
    a.bbpr_size,
    a.bbpr_sale_price,
    b.bbbr_name,
    d.cgen_entry_type,
    d.cgen_entry_date,
    c.cged_price,
    0.0 entry_size,
    0.0 out_size,
    0.0 return_size,
    0.0 cost_price,
    0.0 cost_total,
    '' warehouse,
    '' business_type,
    '' batch_number,
    '' bill_sn,
    '' partner,
    '' bill_type,
    '' bill_creator,
    d.create_time,
    d.modify_time
FROM
    bb_product a
LEFT JOIN bb_branch b ON a.bbpr_bbbr_id = b.bbbr_id
LEFT JOIN cg_entry_detail c ON c.cged_bbpr_id = a.bbpr_id
LEFT JOIN cg_entry d ON c.cged_cgen_id = d.cgen_id
WHERE 1=1
<<AND a.bbpr_locationid=:locationid>>
<<AND b.bbbr_locationid=:locationid>>
<<AND c.cged_locationid=:locationid>>
<<AND d.cgen_locationid=:locationid>>
<<AND d.cgen_entry_date>=:beginDate>>
<<AND d.cgen_entry_date<=:endDate>>
<<AND a.bbpr_id=:bbprId>>
<<AND bbbr_id=:bbbrId>>
<<AND cgen_sn=:billSn>>
GROUP BY d.cgen_id
 
        ]]>
    </sql-query>
</hibernate-mapping>