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
<?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="StuffEntryDetailAllQuery">
        <![CDATA[
 
SELECT cgsd_id, cgsd_did, cgsd_cgse_id, cgsd_cgpd_id, cgsd_bbst_id,cgse_entry_date
cgsd_amount_w, cgsd_amount_v, cgsd_reject_amount, cgsd_now_amount_w,
cgsd_now_amount_v, cgsd_now_reject_amount, cgsd_statue, cgsd_price,
cgsd_sub_totle, cgsd_volume, cgsd_tax, cgsd_remark ,
b.bbst_name,b.bbst_style,c.cgse_sn,d.bbbp_name,
ifnull(cgsd_now_amount_w*cgsd_price,0) surplus_value
FROM cg_stuff_entry_detail left join
bb_stuff b on cgsd_bbst_id=b.bbst_id left join
cg_stuff_entry c on c.cgse_id=cgsd_cgse_id left join
bb_business_partner d on c.cgse_bbbp_id=d.bbbp_id
WHERE 1=1
and c.cgse_flag_entry !=  '五金' and c.cgse_flag_entry !=  '五金退货'  
<<and c.cgse_sn=:cgseSn>>
<<and d.bbbp_name=:bbbpName>>
<<and c.cgse_flag_entry=:cgseFlagEntry>>
<<and c.cgse_entry_date>=:beginDate>>
<<and c.cgse_entry_date<=:endDate>>
<<and b.bbst_name=:bbstName>>
<<and b.bbst_style=:bbstStyle>>
<<and cgsd_volume=:cgsdVolume>>
<<and cgsd_price is null and 1 = :cgsdPrice>>
   and ##CONDITIONS##
 
        ]]>
    </sql-query>
</hibernate-mapping>