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
<?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="PreviousProductLocationQuery">
        <![CDATA[
 
SELECT
    g.bbwt_name,
    g.bbwh_id
FROM
    bb_product_item f
LEFT JOIN bb_warehouse g ON f.bbit_bbwh_id = g.bbwh_id
LEFT JOIN cg_entry_detail a ON a.cged_id = f.bbit_cged_id
LEFT JOIN cg_entry b ON b.cgen_id = a.cged_cgen_id
WHERE
    1 = 1
AND f.bbit_bbwh_id IS NOT NULL
<<AND f.bbit_bbpr_id = a.cged_bbpr_id>>
<<AND f.bbit_locationid =:locationid>>
<<AND g.bbwt_locationid =:locationid>>
<<AND b.cgen_locationid =:locationid>>
<<AND a.cged_locationid =:locationid>>
<<AND f.bbit_id <> :bbitId>>
ORDER BY
    cgen_entry_date DESC
LIMIT 1
 
        ]]>
    </sql-query>
</hibernate-mapping>