|
@@ -151,4 +151,84 @@
|
151
|
151
|
WHERE
|
152
|
152
|
contract_number = #{contractNumber}
|
153
|
153
|
</select>
|
|
154
|
+ <select id="getOutStorageInfo" parameterType="string" resultType="com.chinaitop.depot.intelligent.priceApproval.model.BusinessFsSaleRevenueThreeConsistence">
|
|
155
|
+ SELECT
|
|
156
|
+ YEAR (ci.createdate) `year`,
|
|
157
|
+ MONTH (ci.createdate) `month`,
|
|
158
|
+ ci.basic_storehouse_id basicStorehouseId,
|
|
159
|
+ ci.warehouse_id warehouseId,
|
|
160
|
+ bs.storehouse_name storehouseName,
|
|
161
|
+ bw.warehouse_name warehouseName,
|
|
162
|
+ IFNULL(lc.actual_loss_quantity, 0) loss,
|
|
163
|
+ IFNULL(cd.klhjz, 0) custodyAccountQuantity,
|
|
164
|
+ IFNULL(sa.expenditure_quantity, 0) statisticalAccountQuantity,
|
|
165
|
+ cd.djsj completeTime
|
|
166
|
+ FROM
|
|
167
|
+ business_fs_out_confirm oc
|
|
168
|
+ LEFT JOIN business_fs_out_confirm_contract_item ci ON ci.fs_out_confirm_id = oc.id
|
|
169
|
+ LEFT JOIN business_contract bc ON bc.id = oc.contract_id
|
|
170
|
+ LEFT JOIN basic_storehouse bs ON ci.basic_storehouse_id = bs.storehouse_id
|
|
171
|
+ LEFT JOIN basic_warehouse bw ON ci.warehouse_id = bw.warehouse_id
|
|
172
|
+ LEFT JOIN (
|
|
173
|
+ SELECT
|
|
174
|
+ SUM(lcIn.actual_loss_quantity) actual_loss_quantity,
|
|
175
|
+ YEAR (lcIn.outbound_time) `year`,
|
|
176
|
+ MONTH (lcIn.outbound_time) `month`
|
|
177
|
+ FROM
|
|
178
|
+ business_gslr_loss_collect lcIn
|
|
179
|
+ GROUP BY
|
|
180
|
+ YEAR (lcIn.outbound_time),
|
|
181
|
+ MONTH (lcIn.outbound_time)
|
|
182
|
+ ) lc ON YEAR (ci.createdate) = lc. YEAR
|
|
183
|
+ AND MONTH (ci.createdate) = lc. MONTH
|
|
184
|
+ LEFT JOIN (
|
|
185
|
+ SELECT
|
|
186
|
+ cdIn.htbh,
|
|
187
|
+ cdIn2.klhjz,
|
|
188
|
+ cdIn2.sjhwh,
|
|
189
|
+ cdIn2.xldd,
|
|
190
|
+ cdIn.djsj,
|
|
191
|
+ YEAR (cdIn.djsj) `year`,
|
|
192
|
+ MONTH (cdIn.djsj) `month`
|
|
193
|
+ FROM
|
|
194
|
+ data_crkyw_ckrmdj_default cdIn
|
|
195
|
+ LEFT JOIN data_crkyw_ckcmz_default cdIn2 ON cdIn.BizNo = cdIn2.BizNo
|
|
196
|
+ GROUP BY
|
|
197
|
+ YEAR (cdIn.djsj),
|
|
198
|
+ MONTH (cdIn.djsj)
|
|
199
|
+ ) cd ON YEAR (ci.createdate) = cd. YEAR
|
|
200
|
+ AND MONTH (ci.createdate) = cd. MONTH
|
|
201
|
+ LEFT JOIN (
|
|
202
|
+ SELECT
|
|
203
|
+ SUM(saIn.expenditure_quantity) expenditure_quantity,
|
|
204
|
+ YEAR (saIn.statistical_date) `year`,
|
|
205
|
+ MONTH (saIn.statistical_date) `month`
|
|
206
|
+ FROM
|
|
207
|
+ business_fs_statistical_account saIn
|
|
208
|
+ LEFT JOIN business_contract bcIn ON saIn.contract_id = bcIn.id
|
|
209
|
+ GROUP BY
|
|
210
|
+ YEAR (saIn.statistical_date),
|
|
211
|
+ MONTH (saIn.statistical_date)
|
|
212
|
+ ) sa ON YEAR (ci.createdate) = sa. YEAR
|
|
213
|
+ AND MONTH (ci.createdate) = sa. MONTH
|
|
214
|
+ WHERE
|
|
215
|
+ bc.contract_number = #{contractNumber}
|
|
216
|
+ </select>
|
|
217
|
+ <select id="getOutStorageDetailed" parameterType="string" resultType="com.chinaitop.depot.intelligent.priceApproval.model.DataCPZ">
|
|
218
|
+ SELECT
|
|
219
|
+ cdIn.htbh,
|
|
220
|
+ cdIn2.sjckchmc storehouseName,
|
|
221
|
+ cdIn2.sjhwhmc warehouseName,
|
|
222
|
+ cdIn2.qcph,
|
|
223
|
+ cdIn2.mz mzzl,
|
|
224
|
+ cdIn3.pz,
|
|
225
|
+ cdIn2.klhjz bzwkl,
|
|
226
|
+ cdIn.djsj cpzsj
|
|
227
|
+ FROM
|
|
228
|
+ data_crkyw_ckrmdj_default cdIn
|
|
229
|
+ LEFT JOIN data_crkyw_ckcmz_default cdIn2 ON cdIn.BizNo = cdIn2.BizNo
|
|
230
|
+ LEFT JOIN data_crkyw_ckcpz_default cdIn3 ON cdIn.BizNo = cdIn3.BizNo
|
|
231
|
+ WHERE
|
|
232
|
+ cdIn.htbh = #{contractNumber}
|
|
233
|
+ </select>
|
154
|
234
|
</mapper>
|