8dc487b1
함상기
Init Version - 20...
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class MatchingSetup {
List<Matching> matchingSetup;
@Data
public class Matching {
String type;
String typeName;
Cond condOne;
Cond condTwo;
List<String> uniqueKey;
String compareKey;
List<String> compareField;
|
8dc487b1
함상기
Init Version - 20...
|
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
String amtField;
String matchingType;
String matchingTypeName;
String matchingNumber;
Boolean active;
public Matching() {
this.uniqueKey = new ArrayList<String>();
this.condOne = new Cond();
this.condTwo = new Cond();
this.compareField = new ArrayList<String>();
}
};
@Data
public class Cond {
List<String> cond;
List<String> makeCompareKey;
public Cond() {
this.cond = new ArrayList<String>();
this.makeCompareKey = new ArrayList<String>();
}
public String getMakeCompareKey() {
StringBuffer sbMakeCompareKey = new StringBuffer();
for (String curStr : this.makeCompareKey) {
if (sbMakeCompareKey.length() > 0) sbMakeCompareKey.append(" || ':' || ");
sbMakeCompareKey.append(curStr);
}
String sRtnVal = sbMakeCompareKey.toString();
if (sRtnVal.length() < this.makeCompareKey.size()) sRtnVal = "NULL";
return sbMakeCompareKey.toString();
}
}
public Matching getMatching(String sName) {
Matching matching = null;
for (Matching curObj : this.matchingSetup) {
if (curObj.getType().equalsIgnoreCase(sName)) {
matching = curObj;
break;
}
}
return matching;
}
}
/*
* 예시 데이타
*/
/*
{
"matchingSetup": [
{
"type": "A1",
"typeName": "A type",
"condOne": {
"cond": [
"dta_ty in ('11', '12')"
],
"makeCompareKey": [
"cmpnsp_ky"
]
},
"condTwo": {
"cond": [
"dta_ty in ('21', '22')"
],
"makeCompareKey": [
"cmpnsp_ky"
]
},
"uniqueKey": [
"sys_se",
"accnut_ym",
"sn"
],
"compareKey": "compare_ky",
"amtField": "delng_amt",
"compareField": [
"accnut_ym",
"compare_ky"
]
},
]
}
*/
|