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="SubjectSummaryReportQuery">
| <![CDATA[
|
| select
| a1.fisu_id,
| a1.sum_debit,
| a1.sum_credit,
| a1.fisu_name,
| a1.fisu_sn,
| a1.fisu_direction,
| a1.fisu_type,
| a2.fisb_initial_balance
| from
| (
| select
| fisu_id,
| sum(fivd_debtor_money) sum_debit,
| sum(fivd_creditor_money) sum_credit,
| fisu_name,
| fisu_sn,
| fisu_direction,
| fisu_type
| FROM
| fi_subject s
| left join fi_voucher_detail on fisu_id=fivd_subject_id
| left join fi_voucher v on fivo_id=fivd_fivo_id
| where 1=1
| and fivo_is_cancle<>'Y'
| <<and fivo_fiac_id=:fiboId>>
| <<and v.factory_id=:factoryId>>
| <<and fivo_date>=:beginDate>>
| <<and fivo_date<=:endDate>>
| and fivo_type<>'初始化'
| group by fisu_id
| ) a1
| left join
| (
| SELECT
| fisu_id, fisb_initial_balance
| FROM
| fi_subject_balance sb
| left join fi_subject s on fisb_fisu_id=fisu_id
| where 1=1
| <<and fisb_fiac_id=:fiboId>>
| <<and sb.factory_id=:factoryId>>
| ) a2 on a1.fisu_id=a2.fisu_id
|
| ]]>
| </sql-query>
| </hibernate-mapping>
|
|