8dc487b1
함상기
Init Version - 20...
|
1
2
3
4
5
6
7
8
9
10
11
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.batch.mapper.primary.MatchingInnerDelingMapper">
<!-- 작업리스트 -->
<select id="getCustomItemReadData" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, cpr_code
, partn_cpr
|
82994579
함상기
2024.04.26
|
12
13
14
|
<if test='asCurrency eq "Y".toString()'>
, delng_crncy
</if>
|
8dc487b1
함상기
Init Version - 20...
|
15
16
17
18
19
20
21
|
FROM
(
SELECT
sys_se
, accnut_ym
, cpr_code
, partn_cpr
|
82994579
함상기
2024.04.26
|
22
23
24
|
<if test='asCurrency eq "Y".toString()'>
, delng_crncy
</if>
|
8dc487b1
함상기
Init Version - 20...
|
25
26
27
28
29
30
31
32
|
, case when count(*) > 0 then 1 else 0 end as cnt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and mtch_ty is null
and dta_ty in ('11','21','31','33','35','37','41')
|
30bbef42
함상기
ai sub Matching 추가
|
33
34
35
36
37
38
|
<if test='cpr_code != null and !cpr_code.equals("")'>
and cpr_code = #{cpr_code}
</if>
<if test='partn_cpr != null and !partn_cpr.equals("")'>
and partn_cpr = #{partn_cpr}
</if>
|
8dc487b1
함상기
Init Version - 20...
|
39
40
41
42
43
|
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
|
82994579
함상기
2024.04.26
|
44
45
46
|
<if test='asCurrency eq "Y".toString()'>
, delng_crncy
</if>
|
8dc487b1
함상기
Init Version - 20...
|
47
48
49
50
51
52
|
union all
SELECT
sys_se
, accnut_ym
, partn_cpr as cpr_code
, cpr_code as partn_cpr
|
82994579
함상기
2024.04.26
|
53
54
55
|
<if test='asCurrency eq "Y".toString()'>
, delng_crncy
</if>
|
8dc487b1
함상기
Init Version - 20...
|
56
57
58
59
60
61
62
63
|
, case when count(*) > 0 then 1 else 0 end as cnt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and mtch_ty is null
and dta_ty in ('12','22','32','34','36','38','42')
|
30bbef42
함상기
ai sub Matching 추가
|
64
|
<if test='partn_cpr != null and !partn_cpr.equals("")'>
|
415842d2
함상기
20240408
|
65
66
67
68
|
and cpr_code = #{partn_cpr}
</if>
<if test='cpr_code != null and !cpr_code.equals("")'>
and partn_cpr = #{cpr_code}
|
30bbef42
함상기
ai sub Matching 추가
|
69
|
</if>
|
8dc487b1
함상기
Init Version - 20...
|
70
71
72
73
74
|
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
|
82994579
함상기
2024.04.26
|
75
76
77
|
<if test='asCurrency eq "Y".toString()'>
, delng_crncy
</if>
|
8dc487b1
함상기
Init Version - 20...
|
78
79
80
81
82
83
|
) m
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
|
82994579
함상기
2024.04.26
|
84
85
86
|
<if test='asCurrency eq "Y".toString()'>
, delng_crncy
</if>
|
8dc487b1
함상기
Init Version - 20...
|
87
88
89
90
91
92
93
94
95
96
97
98
99
|
HAVING sum(cnt) > 1
</select>
<!-- 작업키 업데이트 -->
<update id="setDataMakeCompareKy" parameterType="map">
UPDATE public.batch_tbcr_inner_delng
SET
${compareKey} = ${makeCompareKey}
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and cpr_code = #{cprCode}
and partn_cpr = #{partnCpr}
|
8dc487b1
함상기
Init Version - 20...
|
100
101
102
103
104
105
106
107
108
109
|
<foreach collection="cond" item="item" open="" close="" separator="">
and ${item}
</foreach>
</update>
<!-- 매칭작업할 데이타 가져오기 -->
<select id="getMatchingData" parameterType="map" resultType="map">
SELECT
accnut_ym
, compare_ky
|
30bbef42
함상기
ai sub Matching 추가
|
110
|
, ${currencyField}
|
8dc487b1
함상기
Init Version - 20...
|
111
112
113
114
115
116
117
118
119
|
, ${amtField}
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and compare_ky is not null
and cpr_code = #{cprCode}
and partn_cpr = #{partnCpr}
|
8dc487b1
함상기
Init Version - 20...
|
120
121
122
123
124
|
<foreach collection="cond" item="item" open="" close="" separator="">
and ${item}
</foreach>
group by
accnut_ym,
|
30bbef42
함상기
ai sub Matching 추가
|
125
126
|
compare_ky,
${currencyField}
|
8dc487b1
함상기
Init Version - 20...
|
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
</select>
<!-- 매칭결과 업데이트 -->
<select id="getMatchingResult" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, sn
, compare_ky
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and compare_ky is not null
and cpr_code = #{cprCode}
and partn_cpr = #{partnCpr}
|
8dc487b1
함상기
Init Version - 20...
|
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
<foreach collection="cond" item="item" open="" close="" separator="">
and ${item}
</foreach>
</select>
<update id="setResult" parameterType="map">
<foreach collection="itemList" item="item" separator=";">
UPDATE public.batch_tbcr_inner_delng
SET
mtch_sys = 'AUTO',
${item.matchingType} = #{item.matchingTypeVal},
${item.matchingTypeName} = #{item.matchingTypeNameVal},
${item.matchingNumber} = #{item.matchingNumberVal}
WHERE
sys_se = #{item.sys_se}
and accnut_ym = #{item.accnut_ym}
and sn = #{item.sn}
</foreach>
</update>
<update id="deleteOriginalData" parameterType="map">
DELETE FROM tbcr_transaction_history
WHERE
cons_group = #{sysSe}
and account_period = #{accnutYm}
</update>
<update id="insertOriginalData" parameterType="map">
INSERT INTO tbcr_transaction_history (
session_id,
cons_group,
ledger,
account_period,
seq,
tran_type,
own_comp,
|
a99930a8
함상기
2024.04.18
|
188
|
own_comp_name,
|
8dc487b1
함상기
Init Version - 20...
|
189
|
tran_comp,
|
a99930a8
함상기
2024.04.18
|
190
|
tran_comp_name,
|
8dc487b1
함상기
Init Version - 20...
|
191
|
comp_acct_code,
|
a99930a8
함상기
2024.04.18
|
192
|
comp_acct_name,
|
8dc487b1
함상기
Init Version - 20...
|
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
comp_prod_code,
recon_key,
tran_date,
tran_currency,
tran_amt,
book_amt,
group_amt,
book_cost,
document_no,
remark,
cons_acct_code,
cons_acct_name,
prod_code,
adjust_type,
adjust_remark,
if_account_period,
if_comp_code,
if_file_id,
if_source,
equal_check,
cons_own_comp,
cons_tran_comp,
invoice_no,
lc_no,
bl_no,
own_biz_no,
partner_biz_no,
acct_date,
matching_cause,
|
50447760
함상기
.
|
222
223
224
|
match_key,
creation_div_code,
cost_mat_key
|
8dc487b1
함상기
Init Version - 20...
|
225
226
227
228
229
230
231
232
233
234
|
) values
<foreach collection="itemList" item="item" separator=",">
(
#{item.SESSION_ID},
#{item.CONS_GROUP},
#{item.LEDGER},
#{item.ACCOUNT_PERIOD},
#{item.SEQ},
#{item.TRAN_TYPE},
#{item.OWN_COMP},
|
a99930a8
함상기
2024.04.18
|
235
|
#{item.OWN_COMP_NAME},
|
8dc487b1
함상기
Init Version - 20...
|
236
|
#{item.TRAN_COMP},
|
a99930a8
함상기
2024.04.18
|
237
|
#{item.TRAN_COMP_NAME},
|
8dc487b1
함상기
Init Version - 20...
|
238
|
#{item.COMP_ACCT_CODE},
|
a99930a8
함상기
2024.04.18
|
239
|
#{item.COMP_ACCT_NAME},
|
8dc487b1
함상기
Init Version - 20...
|
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
#{item.COMP_PROD_CODE},
#{item.RECON_KEY},
#{item.TRAN_DATE},
#{item.TRAN_CURRENCY},
#{item.TRAN_AMT},
#{item.BOOK_AMT},
#{item.GROUP_AMT},
#{item.BOOK_COST},
#{item.DOCUMENT_NO},
#{item.REMARK},
#{item.CONS_ACCT_CODE},
#{item.CONS_ACCT_NAME},
#{item.PROD_CODE},
#{item.ADJUST_TYPE},
#{item.ADJUST_REMARK},
#{item.IF_ACCOUNT_PERIOD},
#{item.IF_COMP_CODE},
#{item.IF_FILE_ID},
#{item.IF_SOURCE},
#{item.EQUAL_CHECK},
#{item.CONS_OWN_COMP},
#{item.CONS_TRAN_COMP},
#{item.INVOICE_NO},
#{item.LC_NO},
#{item.BL_NO},
#{item.OWN_BIZ_NO},
#{item.PARTNER_BIZ_NO},
#{item.ACCT_DATE},
#{item.MATCHING_CAUSE},
|
50447760
함상기
.
|
269
270
271
|
#{item.MATCH_KEY},
#{item.CREATION_DIV_CODE},
#{item.COST_MAT_KEY}
|
8dc487b1
함상기
Init Version - 20...
|
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
)
</foreach>
</update>
<update id="deleteData" parameterType="map">
DELETE FROM batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
</update>
<update id="insertDataFromOriginal" parameterType="map">
INSERT INTO
batch_tbcr_inner_delng
(
sys_se
, accnut_ym
, sn
, dta_ty
, cpr_code
|
76e09ec5
함상기
2024.04.18 수정분
|
292
|
, cpr_nm
|
8dc487b1
함상기
Init Version - 20...
|
293
|
, partn_cpr
|
76e09ec5
함상기
2024.04.18 수정분
|
294
|
, partn_cpr_nm
|
8dc487b1
함상기
Init Version - 20...
|
295
|
, cpr_acnt_code
|
76e09ec5
함상기
2024.04.18 수정분
|
296
|
, cpr_acnt_nm
|
8dc487b1
함상기
Init Version - 20...
|
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
|
, cnnc_acnt_code
, cnnc_acnt_nm
, delng_de
, elcty_de
, chit_no
, cmpnsp_ky
, ext_key1
, ext_key2
, ext_key3
, ext_key4
, ext_key5
, delng_crncy
, delng_amt
, acntbk_amt
, group_amt
, suply_amount
, sumry
, org_mtch_ty
, org_mtch_ky
, new_mtch_ty
, new_mtch_ky
, compare_ky
, mtch_ty
, mtch_ty_nm
, mtch_ky
)
SELECT
cons_group
, account_period
, seq
, tran_type
, own_comp
|
76e09ec5
함상기
2024.04.18 수정분
|
329
|
, own_comp_name
|
8dc487b1
함상기
Init Version - 20...
|
330
|
, tran_comp
|
76e09ec5
함상기
2024.04.18 수정분
|
331
|
, tran_comp_name
|
8dc487b1
함상기
Init Version - 20...
|
332
|
, comp_acct_code
|
76e09ec5
함상기
2024.04.18 수정분
|
333
|
, comp_acct_name
|
8dc487b1
함상기
Init Version - 20...
|
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
|
, cons_acct_code
, cons_acct_name
, tran_date
, acct_date
, document_no
, recon_key
, null
, invoice_no
, lc_no
, bl_no
, null
, tran_currency
, tran_amt
, book_amt
, group_amt
, book_cost
, remark
, matching_cause
, match_key
, null
, null
, null
, null
, null
, null
FROM
tbcr_transaction_history
WHERE
cons_group = #{sysSe}
and account_period = #{accnutYm}
|
f97db154
함상기
.
|
364
365
366
|
<foreach collection="conds" item="item" open="" close="" separator="">
and ${item}
</foreach>
|
8dc487b1
함상기
Init Version - 20...
|
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
|
</update>
<update id="deleteDataAi" parameterType="map">
DELETE FROM batch_tbcr_inner_delng_ai
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
</update>
<update id="insertDataAiFromOriginal" parameterType="map">
INSERT INTO
batch_tbcr_inner_delng_ai
(
sys_se
, accnut_ym
, sn
, ai_key1
, ai_key2
, ai_key3
, ai_key4
, ai_key5
, ai_key6
, ai_key7
, ai_key8
, ai_key9
, ai_key10
)
SELECT
cons_group
, account_period
, seq
, regexp_replace(document_no, '[^0-9a-zA-Z]', '',1,0) as ai_key1
, regexp_replace(recon_key, '[^0-9a-zA-Z]', '',1,0) as ai_key2
, '' as ai_key3
, '' as ai_key4
, '' as ai_key5
, '' as ai_key6
, '' as ai_key7
, '' as ai_key8
, '' as ai_key9
, '' as ai_key10
FROM
tbcr_transaction_history
WHERE
cons_group = #{sysSe}
and account_period = #{accnutYm}
|
8dc487b1
함상기
Init Version - 20...
|
414
|
</update>
|
78928007
함상기
20240305
|
415
416
417
418
419
420
421
422
423
424
|
<update id="updateClearNewMatchKey" parameterType="map">
update batch_tbcr_inner_delng
set
new_mtch_ty = null,
new_mtch_ky = null
where
sys_se = #{sysSe}
AND accnut_ym = #{accnutYm}
</update>
|
8dc487b1
함상기
Init Version - 20...
|
425
426
427
428
429
430
431
432
433
434
435
436
437
|
<update id="updateNewMatchKey" parameterType="map">
merge into batch_tbcr_inner_delng m
using
(
select
sys_se,
accnut_ym,
sn,
org_mtch_ty,
org_mtch_ky,
mtch_ty as new_mtch_ty,
mtch_ky,
|
dcdf9dd3
함상기
.
|
438
439
440
|
DENSE_RANK() over (order by
mtch_ty
, mtch_ky
|
7eae5008
함상기
.
|
441
|
, delng_crncy
|
dcdf9dd3
함상기
.
|
442
443
444
|
, case when dta_ty in ('11','21','31','33','35','37','41') then cpr_code else partn_cpr end
, case when dta_ty in ('11','21','31','33','35','37','41') then partn_cpr else cpr_code end
) AS new_mtch_ky
|
8dc487b1
함상기
Init Version - 20...
|
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
|
from batch_tbcr_inner_delng
where
sys_se = #{sysSe}
AND accnut_ym = #{accnutYm}
AND mtch_ty is not null
) t
on
m.sys_se = t.sys_se
and m.accnut_ym = t.accnut_ym
and m.sn = t.sn
when matched then
update set
new_mtch_ty = t.new_mtch_ty,
new_mtch_ky = t.new_mtch_ky
</update>
<!-- 매칭작업할 데이타 가져오기 -->
<select id="getMatchingExtraDataOne" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, sn
, '' as compare_ky
, delng_de
|
8dc487b1
함상기
Init Version - 20...
|
471
472
473
474
475
476
477
478
|
, delng_amt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and cpr_code = #{cprCode}
and partn_cpr = #{partnCpr}
|
82994579
함상기
2024.04.26
|
479
|
and delng_crncy = #{delngCurncy}
|
8dc487b1
함상기
Init Version - 20...
|
480
|
and mtch_ky is null
|
78928007
함상기
20240305
|
481
482
483
484
485
486
|
<if test='conds eq "T".toString()'>
and dta_ty in ('11','21','41')
</if>
<if test='conds eq "B".toString()'>
and dta_ty in ('31','33','35','37')
</if>
|
8dc487b1
함상기
Init Version - 20...
|
487
488
|
and delng_amt != 0
ORDER BY
|
d3e8a8a9
함상기
2024-04-01
|
489
|
delng_de
|
8dc487b1
함상기
Init Version - 20...
|
490
491
492
493
494
495
496
497
498
499
|
</select>
<!-- 매칭작업할 데이타 가져오기 -->
<select id="getMatchingExtraDataTwo" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, sn
, '' as compare_ky
, delng_de
|
8dc487b1
함상기
Init Version - 20...
|
500
501
502
503
504
505
506
507
|
, delng_amt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and cpr_code = #{cprCode}
and partn_cpr = #{partnCpr}
|
82994579
함상기
2024.04.26
|
508
|
and delng_crncy = #{delngCurncy}
|
8dc487b1
함상기
Init Version - 20...
|
509
|
and mtch_ky is null
|
78928007
함상기
20240305
|
510
511
512
513
514
515
|
<if test='conds eq "T".toString()'>
and dta_ty in ('12','22','42')
</if>
<if test='conds eq "B".toString()'>
and dta_ty in ('32','34','36','38')
</if>
|
8dc487b1
함상기
Init Version - 20...
|
516
517
|
and delng_amt != 0
ORDER BY
|
d3e8a8a9
함상기
2024-04-01
|
518
|
delng_de
|
8dc487b1
함상기
Init Version - 20...
|
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
|
</select>
<update id="setExtraResult" parameterType="map">
<foreach collection="itemList" item="item" separator=";">
UPDATE public.batch_tbcr_inner_delng
SET
mtch_sys = #{item.mtch_sys},
mtch_ty = #{item.mtch_ty},
mtch_ty_nm = #{item.mtch_ty_nm},
mtch_ky = #{item.mtch_ky}
WHERE
sys_se = #{item.sys_se}
and accnut_ym = #{item.accnut_ym}
and sn = #{item.sn}
</foreach>
</update>
<update id="createUserJob" parameterType="map">
INSERT INTO public.batch_user_job_status (
|
78928007
함상기
20240305
|
538
|
user_job_group,
|
8dc487b1
함상기
Init Version - 20...
|
539
540
541
542
543
|
user_job_id,
user_job_name,
start_time,
status
) VALUES (
|
78928007
함상기
20240305
|
544
|
#{user_job_group},
|
8dc487b1
함상기
Init Version - 20...
|
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
|
#{user_job_id},
#{user_job_name},
now(),
'Started'
)
</update>
<update id="finishUserJob" parameterType="map">
UPDATE public.batch_user_job_status
SET
end_time = now(),
status = 'Finished',
exit_code = #{exit_code},
exit_message = #{exit_message}
WHERE
user_job_id = #{user_job_id}
</update>
<!-- AI 작업리스트 -->
<select id="getAiReadData" parameterType="map" resultType="map">
|
d3e8a8a9
함상기
2024-04-01
|
565
566
567
568
569
|
SELECT
sys_se
, accnut_ym
, cpr_code
, partn_cpr
|
f97db154
함상기
.
|
570
|
, tb_ty
|
d3e8a8a9
함상기
2024-04-01
|
571
|
, delng_crncy
|
82994579
함상기
2024.04.26
|
572
573
|
, sum(cnt) as cnt
, max(cnt_all) as cnt_all
|
d3e8a8a9
함상기
2024-04-01
|
574
575
|
FROM
(
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
576
577
578
579
580
581
|
SELECT
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, delng_crncy
|
f97db154
함상기
.
|
582
|
, case when dta_ty in ('11','21','41') then 'T' else 'B' end tb_ty
|
d3e8a8a9
함상기
2024-04-01
|
583
|
, case when count(*) > 0 then 1 else 0 end as cnt
|
82994579
함상기
2024.04.26
|
584
|
, count(*) as cnt_all
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
585
586
587
588
589
590
|
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and mtch_ty is null
|
d3e8a8a9
함상기
2024-04-01
|
591
|
and dta_ty in ('11','21','31','33','35','37','41')
|
30bbef42
함상기
ai sub Matching 추가
|
592
593
594
595
596
597
|
<if test='cpr_code != null and !cpr_code.equals("")'>
and cpr_code = #{cpr_code}
</if>
<if test='partn_cpr != null and !partn_cpr.equals("")'>
and partn_cpr = #{partn_cpr}
</if>
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
598
599
600
601
602
603
|
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, delng_crncy
|
f97db154
함상기
.
|
604
|
, case when dta_ty in ('11','21','41') then 'T' else 'B' end
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
605
606
607
608
609
610
611
|
union all
SELECT
sys_se
, accnut_ym
, partn_cpr as cpr_code
, cpr_code as partn_cpr
, delng_crncy
|
f97db154
함상기
.
|
612
|
, case when dta_ty in ('12','22','42') then 'T' else 'B' end as tb_ty
|
d3e8a8a9
함상기
2024-04-01
|
613
|
, case when count(*) > 0 then 1 else 0 end as cnt
|
82994579
함상기
2024.04.26
|
614
|
, count(*) as cnt_all
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
615
616
617
618
619
620
|
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and mtch_ty is null
|
d3e8a8a9
함상기
2024-04-01
|
621
|
and dta_ty in ('12','22','32','34','36','38','42')
|
30bbef42
함상기
ai sub Matching 추가
|
622
|
<if test='partn_cpr != null and !partn_cpr.equals("")'>
|
415842d2
함상기
20240408
|
623
624
625
626
|
and cpr_code = #{partn_cpr}
</if>
<if test='cpr_code != null and !cpr_code.equals("")'>
and partn_cpr = #{cpr_code}
|
30bbef42
함상기
ai sub Matching 추가
|
627
|
</if>
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
628
629
630
|
GROUP BY
sys_se
, accnut_ym
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
631
|
, cpr_code
|
d3e8a8a9
함상기
2024-04-01
|
632
|
, partn_cpr
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
633
|
, delng_crncy
|
f97db154
함상기
.
|
634
|
, case when dta_ty in ('12','22','42') then 'T' else 'B' end
|
d3e8a8a9
함상기
2024-04-01
|
635
|
) m
|
a45ecedc
ggun12
* EX 매칭은 순차 실행으로 처리
|
636
637
638
639
640
641
|
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, delng_crncy
|
4aa0b12d
함상기
.
|
642
|
, tb_ty
|
d3e8a8a9
함상기
2024-04-01
|
643
|
HAVING sum(cnt) > 1
|
82994579
함상기
2024.04.26
|
644
|
ORDER BY cnt_all
|
78928007
함상기
20240305
|
645
646
647
648
649
650
651
652
653
654
655
656
657
|
</select>
<!-- User Job Status -->
<select id="getUserJobStatus" parameterType="map" resultType="map">
SELECT
user_job_id
, user_job_name
, start_time
, end_time
, status
, exit_code
, exit_message
, user_job_group
|
78928007
함상기
20240305
|
658
659
660
661
|
FROM
public.batch_user_job_status
WHERE
user_job_group = #{userJobGroup}
|
fb057d1e
함상기
.
|
662
663
664
|
<if test='exceptJobId != null and !exceptJobId.equals("")'>
and user_job_id != #{exceptJobId}
</if>
|
78928007
함상기
20240305
|
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
|
ORDER BY
user_job_id ASC
</select>
<!-- ReturnData Select -->
<select id="getReturnData" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, sn
, dta_ty
, cpr_code
, partn_cpr
, cpr_acnt_code
, cnnc_acnt_code
, cnnc_acnt_nm
, delng_de
, elcty_de
, chit_no
, cmpnsp_ky
, ext_key1
, ext_key2
, ext_key3
, ext_key4
, ext_key5
, delng_crncy
, delng_amt
, acntbk_amt
, group_amt
, suply_amount
, sumry
, org_mtch_ty
, org_mtch_ky
, new_mtch_ty
, new_mtch_ky
, compare_ky
, mtch_sys
, mtch_ty
, mtch_ty_nm
, mtch_ky
FROM
batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
</select>
|
30bbef42
함상기
ai sub Matching 추가
|
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
|
<!-- 작업리스트 -->
<select id="getAiSubReadData" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, mtch_ty
, mtch_ky
FROM
(
SELECT
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, mtch_ty
, mtch_ky
, case when count(*) > 0 then 1 else 0 end as cnt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and mtch_ty = #{mtch_ty}
and dta_ty in ('11','21','31','33','35','37','41')
<if test='cpr_code != null and !cpr_code.equals("")'>
and cpr_code = #{cpr_code}
</if>
<if test='partn_cpr != null and !partn_cpr.equals("")'>
and partn_cpr = #{partn_cpr}
</if>
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, mtch_ty
, mtch_ky
union all
SELECT
sys_se
, accnut_ym
, partn_cpr as cpr_code
, cpr_code as partn_cpr
, mtch_ty
, mtch_ky
, case when count(*) > 0 then 1 else 0 end as cnt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and mtch_ty = #{mtch_ty}
and dta_ty in ('12','22','32','34','36','38','42')
|
30bbef42
함상기
ai sub Matching 추가
|
767
|
<if test='partn_cpr != null and !partn_cpr.equals("")'>
|
415842d2
함상기
20240408
|
768
769
770
771
|
and cpr_code = #{partn_cpr}
</if>
<if test='cpr_code != null and !cpr_code.equals("")'>
and partn_cpr = #{cpr_code}
|
30bbef42
함상기
ai sub Matching 추가
|
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
|
</if>
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, mtch_ty
, mtch_ky
) m
GROUP BY
sys_se
, accnut_ym
, cpr_code
, partn_cpr
, mtch_ty
, mtch_ky
HAVING sum(cnt) > 1
</select>
<!-- 매칭작업할 데이타 가져오기 -->
<select id="getAiSubDataOne" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, sn
, '' as compare_ky
, delng_de
, delng_amt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and cpr_code = #{cprCode}
and partn_cpr = #{partnCpr}
and mtch_ty = #{mtchTy}
and mtch_ky = #{mtchKy}
<if test='conds eq "T".toString()'>
and dta_ty in ('11','21','41')
</if>
<if test='conds eq "B".toString()'>
and dta_ty in ('31','33','35','37')
</if>
and delng_amt != 0
ORDER BY
delng_de
</select>
<!-- 매칭작업할 데이타 가져오기 -->
<select id="getAiSubDataTwo" parameterType="map" resultType="map">
SELECT
sys_se
, accnut_ym
, sn
, '' as compare_ky
, delng_de
, delng_amt
FROM
public.batch_tbcr_inner_delng
WHERE
sys_se = #{sysSe}
and accnut_ym = #{accnutYm}
and cpr_code = #{cprCode}
and partn_cpr = #{partnCpr}
and mtch_ty = #{mtchTy}
and mtch_ky = #{mtchKy}
<if test='conds eq "T".toString()'>
and dta_ty in ('12','22','42')
</if>
<if test='conds eq "B".toString()'>
and dta_ty in ('32','34','36','38')
</if>
and delng_amt != 0
ORDER BY
delng_de
</select>
|
8dc487b1
함상기
Init Version - 20...
|
850
|
</mapper>
|