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
<?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="GetProductDepUsedQuery">
        <![CDATA[
 
select syde_name,sum(ifnull(oued_size,0)-ifnull(oued_back_size,0)) as de_size,bbpr_name,bbpr_id from bb_product
left join out_exit_detail on bbpr_id = oued_bbpr_id
left join out_exit on ouex_id = oued_ouex_id
left join sys_user on syus_real_name = ouex_exit_author
left join sys_department on syus_syde_id = syde_id
where 1=1
and bbpr_id in (:bbprIds)
and (DATE_FORMAT(ouex_exit_date,'%Y-%m')=:yearMonth or ouex_id is null)
<<and bbpr_locationid=:locationid>>
group by syde_id,bbpr_id 
 
        ]]>
    </sql-query>
</hibernate-mapping>