|
@@ -12,12 +12,199 @@
|
12
|
12
|
bc.performance_quantity performanceQuantity,
|
13
|
13
|
sr.createdate,
|
14
|
14
|
sr.`status`,
|
15
|
|
- sr.updatedate
|
|
15
|
+ sr.updatedate,
|
|
16
|
+ sr.report_time
|
16
|
17
|
FROM
|
17
|
|
- depot_qh.business_fs_sale_revenue sr
|
18
|
|
- LEFT JOIN depot_qh.business_contract bc ON sr.contract_id = bc.id
|
19
|
|
- LEFT JOIN depot_qh.org_info oi ON sr.org_id = oi.org_id
|
20
|
|
- LEFT JOIN biz_unit_info ui ON ui.id = oi.unit_info_id
|
|
18
|
+ business_fs_sale_revenue sr
|
|
19
|
+ LEFT JOIN business_contract bc ON sr.contract_id = bc.id
|
|
20
|
+ LEFT JOIN org_info oi ON sr.org_id = oi.org_id
|
|
21
|
+ LEFT JOIN province_all.biz_unit_info ui ON ui.id = oi.unit_info_id
|
21
|
22
|
${ew.customSqlSegment}
|
22
|
23
|
</select>
|
|
24
|
+ <select id="getContractInfoList" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenue.entity.BusinessContractDetail">
|
|
25
|
+ SELECT
|
|
26
|
+ swd.id,
|
|
27
|
+ bs.storehouse_name houseName,
|
|
28
|
+ bw.warehouse_name warehouseName,
|
|
29
|
+ swd.grain_kind grainKind,
|
|
30
|
+ be.enumname grainKindName,
|
|
31
|
+ swd.in_count inCount,
|
|
32
|
+ swd.in_price inPrice,
|
|
33
|
+ swd.in_detail_total_price inDetailTotalPrice
|
|
34
|
+ FROM
|
|
35
|
+ business_store_ware_detail swd
|
|
36
|
+ LEFT JOIN basic_enum be ON be.enumId = swd.grain_kind
|
|
37
|
+ LEFT JOIN basic_storehouse bs ON swd.house_id = bs.storehouse_id
|
|
38
|
+ LEFT JOIN basic_warehouse bw ON swd.warehouse_id = bw.warehouse_id
|
|
39
|
+ WHERE
|
|
40
|
+ swd.zid = #{id}
|
|
41
|
+ </select>
|
|
42
|
+ <select id="getConsistenceAccountDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistenceAccount.entity.FsSaleRevenueThreeConsistenceAccount">
|
|
43
|
+ SELECT
|
|
44
|
+ tcc.id,
|
|
45
|
+ tcc. YEAR,
|
|
46
|
+ tcc. MONTH,
|
|
47
|
+ tcc.accounting_quantity accountingQuantity,
|
|
48
|
+ tcc.accounting_amount accountingAmount
|
|
49
|
+ FROM
|
|
50
|
+ business_fs_sale_revenue_three_consistence_account tcc
|
|
51
|
+ LEFT JOIN business_fs_sale_revenue sr ON sr.id = tcc.fs_sale_revenue_id
|
|
52
|
+ WHERE
|
|
53
|
+ tcc.fs_sale_revenue_id = #{id}
|
|
54
|
+ </select>
|
|
55
|
+ <select id="getQualityDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueInspectionLoss.entity.FsSaleRevenueInspectionLoss">
|
|
56
|
+ SELECT
|
|
57
|
+ il.id,
|
|
58
|
+ il.qc_quality_inspection_id_out,
|
|
59
|
+ il.qc_quality_inspection_id_in,
|
|
60
|
+ bs.storehouse_name storehouseName,
|
|
61
|
+ bw.warehouse_name warehouseName,
|
|
62
|
+ t1.zzIn,
|
|
63
|
+ t1.sfIn,
|
|
64
|
+ t2.zzOut,
|
|
65
|
+ t2.sfOut,
|
|
66
|
+ il.gslr_loss_collect_id gslrLossCollectId,
|
|
67
|
+ lc.actual_loss_quantity actualLossQuantity,
|
|
68
|
+ (
|
|
69
|
+ lc.natural_loss + lc.moisture_loss + lc.impurity_reduction_quality
|
|
70
|
+ ) quotaLoss,
|
|
71
|
+ lc.natural_loss naturalLoss,
|
|
72
|
+ lc.moisture_loss moistureLoss,
|
|
73
|
+ lc.impurity_reduction_quality impurityReductionQuality,
|
|
74
|
+ lc.excess_loss_quantity excessLossQuantity,
|
|
75
|
+ lc.loss_profit_reason lossProfitReason
|
|
76
|
+ FROM
|
|
77
|
+ business_fs_sale_revenue_inspection_loss il
|
|
78
|
+ LEFT JOIN business_gslr_loss_collect lc ON lc.id = il.gslr_loss_collect_id
|
|
79
|
+ LEFT JOIN basic_storehouse bs ON lc.basic_storehouse_id = bs.storehouse_id
|
|
80
|
+ LEFT JOIN basic_warehouse bw ON lc.warehouse_id = bw.warehouse_id
|
|
81
|
+ LEFT JOIN
|
|
82
|
+ (
|
|
83
|
+ SELECT
|
|
84
|
+ qi.id,
|
|
85
|
+ SUM(CASE WHEN qii.inspection_item_id = 7619 THEN qii.inspection_value ELSE 0 END) zzIn,
|
|
86
|
+ SUM(CASE WHEN qii.inspection_item_id = 9528239 THEN qii.inspection_value ELSE 0 END) sfIn
|
|
87
|
+ FROM
|
|
88
|
+ business_fs_sale_revenue_inspection_loss il
|
|
89
|
+ LEFT JOIN business_qc_quality_inspection qi ON il.qc_quality_inspection_id_out = qi.id
|
|
90
|
+ LEFT JOIN business_qc_quality_inspection_item qii ON qi.id = qii.qc_quality_inspection_id
|
|
91
|
+ ) t1 ON il.qc_quality_inspection_id_in = t1.id
|
|
92
|
+ LEFT JOIN
|
|
93
|
+ (
|
|
94
|
+ SELECT
|
|
95
|
+ qi.id,
|
|
96
|
+ SUM(CASE WHEN qii.inspection_item_id = 7619 THEN qii.inspection_value ELSE 0 END) zzOut,
|
|
97
|
+ SUM(CASE WHEN qii.inspection_item_id = 9528239 THEN qii.inspection_value ELSE 0 END) sfOut
|
|
98
|
+ FROM
|
|
99
|
+ business_fs_sale_revenue_inspection_loss il
|
|
100
|
+ LEFT JOIN business_qc_quality_inspection qi ON il.qc_quality_inspection_id_out = qi.id
|
|
101
|
+ LEFT JOIN business_qc_quality_inspection_item qii ON qi.id = qii.qc_quality_inspection_id
|
|
102
|
+ ) t2 ON il.qc_quality_inspection_id_out = t2.id
|
|
103
|
+ WHERE
|
|
104
|
+ il.fs_sale_revenue_id = #{id}
|
|
105
|
+ </select>
|
|
106
|
+ <select id="getOutStorageDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistence.entity.FsSaleRevenueThreeConsistence">
|
|
107
|
+ SELECT
|
|
108
|
+ tc.id,
|
|
109
|
+ tc.`year`,
|
|
110
|
+ tc.`month`,
|
|
111
|
+ tc.basic_storehouse_id,
|
|
112
|
+ tc.warehouse_id,
|
|
113
|
+ bs.storehouse_name storehouseName,
|
|
114
|
+ bw.warehouse_name warehouseName,
|
|
115
|
+ tc.loss,
|
|
116
|
+ tc.custody_account_quantity,
|
|
117
|
+ tc.statistical_account_quantity,
|
|
118
|
+ tc.complete_time
|
|
119
|
+ FROM
|
|
120
|
+ business_fs_sale_revenue_three_consistence tc
|
|
121
|
+ LEFT JOIN basic_storehouse bs ON tc.basic_storehouse_id = bs.storehouse_id
|
|
122
|
+ LEFT JOIN basic_warehouse bw ON tc.warehouse_id = bw.warehouse_id
|
|
123
|
+ WHERE
|
|
124
|
+ tc.fs_sale_revenue_id = #{id}
|
|
125
|
+ </select>
|
|
126
|
+ <select id="getSettlementDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueSettle.entity.FsSaleRevenueSettle">
|
|
127
|
+ SELECT
|
|
128
|
+ rs.id,
|
|
129
|
+ rs.province_acceptance_unit,
|
|
130
|
+ rs.province_total_settle_quantity,
|
|
131
|
+ rs.province_total_settle_amount,
|
|
132
|
+ rs.province_loan_return_time loanReturnTime,
|
|
133
|
+ rs.province_loan_recovery_unit provinceLoanRecoveryUnit,
|
|
134
|
+ rs.province_loan_recovery_quantity provinceLoanRecoveryQuantity,
|
|
135
|
+ rs.province_loan_recovery_amount provinceLoanRecoveryAmount,
|
|
136
|
+ rs.province_invoice_unit provinceInvoiceUnit,
|
|
137
|
+ rs.province_invoice_quantity provinceInvoiceQuantity,
|
|
138
|
+ rs.province_invoice_unit_price provinceInvoiceUnitPrice,
|
|
139
|
+ rs.province_invoice_amount provinceInvoiceAmount,
|
|
140
|
+ rs.province_loan_return_time provinceLoanReturnTime,
|
|
141
|
+ rs.province_loan_return_amount provinceLoanReturnAmount,
|
|
142
|
+ rs.fs_out_confirm_id fsOutConfirmId
|
|
143
|
+ FROM
|
|
144
|
+ business_fs_sale_revenue_settle rs
|
|
145
|
+ WHERE
|
|
146
|
+ rs.fs_sale_revenue_id = #{id}
|
|
147
|
+ </select>
|
|
148
|
+ <select id="getCardDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueApprovalPrice.entity.FsSaleRevenueApprovalPrice">
|
|
149
|
+ SELECT
|
|
150
|
+ ap.id,
|
|
151
|
+ sc.basic_storehouse_id storehouseId,
|
|
152
|
+ bs.storehouse_name storehouseName,
|
|
153
|
+ sc.warehouse_id warehouseId,
|
|
154
|
+ bw.warehouse_name warehouseName,
|
|
155
|
+ sc.lssl,
|
|
156
|
+ sc.in_financial_verification inNinancialVerification,
|
|
157
|
+ ap.storage_amount storageAmount,
|
|
158
|
+ ap.document_number,
|
|
159
|
+ ap.document_upload,
|
|
160
|
+ ap.grain_situation_card_id,
|
|
161
|
+ ap.fs_sale_revenue_id
|
|
162
|
+ FROM
|
|
163
|
+ business_fs_sale_revenue_approval_price ap
|
|
164
|
+ LEFT JOIN grain_situation_card sc ON ap.grain_situation_card_id = sc.id
|
|
165
|
+ LEFT JOIN basic_storehouse bs ON sc.basic_storehouse_id = bs.storehouse_id
|
|
166
|
+ LEFT JOIN basic_warehouse bw ON sc.warehouse_id = bw.warehouse_id
|
|
167
|
+ WHERE
|
|
168
|
+ ap.fs_sale_revenue_id = #{id}
|
|
169
|
+ </select>
|
|
170
|
+ <select id="getDiffPriceDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueDiffPrice.entity.FsSaleRevenueDiffPrice">
|
|
171
|
+ SELECT
|
|
172
|
+ dp.id,
|
|
173
|
+ dp.project_type projectType,
|
|
174
|
+ dp.total_quantity totalQuantity,
|
|
175
|
+ dp.total_amount totalAmount
|
|
176
|
+ FROM
|
|
177
|
+ business_fs_sale_revenue_diff_price dp
|
|
178
|
+ WHERE
|
|
179
|
+ dp.fs_sale_revenue_id = #{id}
|
|
180
|
+ </select>
|
|
181
|
+ <select id="getOutStorageDetailed" parameterType="string" resultType="com.unis.financialSupervision.modular.priceApproval.entity.DataCPZ">
|
|
182
|
+ SELECT
|
|
183
|
+ cdIn.htbh,
|
|
184
|
+ cdIn2.sjckchmc storehouseName,
|
|
185
|
+ cdIn2.sjhwhmc warehouseName,
|
|
186
|
+ cdIn.cph qcph,
|
|
187
|
+ cdIn2.mz mzzl,
|
|
188
|
+ cdIn3.pz,
|
|
189
|
+ cdIn2.klhjz bzwkl,
|
|
190
|
+ cdIn.djsj cpzsj
|
|
191
|
+ FROM
|
|
192
|
+ data_crkyw_ckrmdj_default cdIn
|
|
193
|
+ LEFT JOIN data_crkyw_ckcmz_default cdIn2 ON cdIn.BizNo = cdIn2.BizNo
|
|
194
|
+ LEFT JOIN data_crkyw_ckcpz_default cdIn3 ON cdIn.BizNo = cdIn3.BizNo
|
|
195
|
+ WHERE
|
|
196
|
+ cdIn.htbh = #{contractNumber}
|
|
197
|
+ </select>
|
|
198
|
+ <select id="queryEntityById" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenue.entity.FsSaleRevenue">
|
|
199
|
+ SELECT
|
|
200
|
+ sr.*, bc.contract_number contractNumber,
|
|
201
|
+ bc.attachment,
|
|
202
|
+ oi.org_name orgName
|
|
203
|
+ FROM
|
|
204
|
+ business_fs_sale_revenue sr
|
|
205
|
+ LEFT JOIN business_contract bc ON sr.contract_id = bc.id
|
|
206
|
+ LEFT JOIN org_info oi ON oi.org_id = sr.org_id
|
|
207
|
+ WHERE
|
|
208
|
+ sr.id = #{id}
|
|
209
|
+ </select>
|
23
|
210
|
</mapper>
|