
--- server/main/java/kr/co/takensoft/dataQuality/rule/dao/DupRulManagementDAO.java
+++ server/main/java/kr/co/takensoft/dataQuality/rule/dao/DupRulManagementDAO.java
... | ... | @@ -47,4 +47,28 @@ |
47 | 47 |
*/ |
48 | 48 |
List<HashMap<String, Object>> selectDuplRuleId(HashMap<String,Object> params) throws Exception; |
49 | 49 |
|
50 |
+ /** |
|
51 |
+ * 중복 검사 선택 대상 테이블 조회 |
|
52 |
+ * |
|
53 |
+ * @author 임재현 |
|
54 |
+ * @since 2024.02.06 |
|
55 |
+ */ |
|
56 |
+ List<HashMap<String,Object>> selectCheckedList(HashMap<String,Object>params) throws Exception; |
|
57 |
+ |
|
58 |
+ |
|
59 |
+ /** |
|
60 |
+ * 중복 검사 선택 대상 테이블 페이징 |
|
61 |
+ * |
|
62 |
+ * @author 임재현 |
|
63 |
+ * @since 2024.02.06 |
|
64 |
+ */ |
|
65 |
+ public int countCheckedList(HashMap<String,Object> params) throws Exception; |
|
66 |
+ |
|
67 |
+ /** |
|
68 |
+ * 중복 검사 선택 대상 테이블 컬럼명 조회 기능 (미완) |
|
69 |
+ * |
|
70 |
+ * @author 임재현 |
|
71 |
+ * @since 2024.02.06 |
|
72 |
+ */ |
|
73 |
+ public String selectColumnNm(int params) throws Exception; |
|
50 | 74 |
} |
--- server/main/java/kr/co/takensoft/dataQuality/rule/service/DupRulManagementService.java
+++ server/main/java/kr/co/takensoft/dataQuality/rule/service/DupRulManagementService.java
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 |
import org.springframework.beans.factory.annotation.Autowired; |
6 | 6 |
import org.springframework.stereotype.Service; |
7 | 7 |
|
8 |
+import java.util.Arrays; |
|
8 | 9 |
import java.util.HashMap; |
9 | 10 |
import java.util.List; |
10 | 11 |
|
... | ... | @@ -47,19 +48,27 @@ |
47 | 48 |
* @author 정다정 |
48 | 49 |
* @since 2024.01.26 |
49 | 50 |
*/ |
50 |
- public int insertDupRule(HashMap<String, Object> params) throws Exception { |
|
51 |
+ public int insertDupRule(HashMap<String,Object> params) throws Exception { |
|
52 |
+ |
|
53 |
+ System.out.println("params = " + params); |
|
54 |
+ |
|
55 |
+ List<Integer> columnList = (List<Integer>) params.get("columnList"); |
|
56 |
+ |
|
57 |
+ params.put("mainColumnId", columnList.get(0)); |
|
58 |
+ params.put("columnListId", columnList.toString().replaceAll("[\\[\\]]","")); |
|
59 |
+ |
|
51 | 60 |
dupRulManagementDAO.insertDupRule(params); |
52 | 61 |
|
53 |
- params.put("rule_type", "dupl_rule"); |
|
54 |
- |
|
55 |
- List<HashMap<String, Object>> duplRuleIdList = dupRulManagementDAO.selectDuplRuleId(params); |
|
56 |
- |
|
57 |
- for (HashMap<String, Object> row : duplRuleIdList) { |
|
58 |
- Integer duplRuleId = (Integer) row.get("dupl_rule_id"); |
|
59 |
- params.put("rule_id", duplRuleId); |
|
60 |
- |
|
61 |
- manageDAO.insertManageRule(params); |
|
62 |
- } |
|
62 |
+// params.put("rule_type", "dupl_rule"); |
|
63 |
+// |
|
64 |
+// List<HashMap<String, Object>> duplRuleIdList = dupRulManagementDAO.selectDuplRuleId(params); |
|
65 |
+// |
|
66 |
+// for (HashMap<String, Object> row : duplRuleIdList) { |
|
67 |
+// Integer duplRuleId = (Integer) row.get("dupl_rule_id"); |
|
68 |
+// params.put("rule_id", duplRuleId); |
|
69 |
+// |
|
70 |
+// manageDAO.insertManageRule(params); |
|
71 |
+// } |
|
63 | 72 |
return 1; |
64 | 73 |
} |
65 | 74 |
|
... | ... | @@ -70,18 +79,58 @@ |
70 | 79 |
* @since 2024.02.01 |
71 | 80 |
*/ |
72 | 81 |
public int deleteDupRule(HashMap<String,Object> params) throws Exception{ |
73 |
- List<HashMap<String, Object>> duplRuleIdList = dupRulManagementDAO.selectDuplRuleId(params); |
|
74 |
- |
|
75 |
- for (HashMap<String, Object> row : duplRuleIdList) { |
|
76 |
- Integer duplRuleId = (Integer) row.get("dupl_rule_id"); |
|
77 |
- params.put("rule_id", duplRuleId); |
|
78 |
- HashMap<String, Object> manage_id = manageDAO.selectManageId(params); |
|
79 |
- Integer manageRuleId = (Integer) manage_id.get("manage_rule_id"); |
|
80 |
- params.put("manage_rule_id", manageRuleId); |
|
81 |
- manageDAO.deleteManageRule(params); |
|
82 |
- } |
|
82 |
+// List<HashMap<String, Object>> duplRuleIdList = dupRulManagementDAO.selectDuplRuleId(params); |
|
83 |
+// |
|
84 |
+// for (HashMap<String, Object> row : duplRuleIdList) { |
|
85 |
+// Integer duplRuleId = (Integer) row.get("dupl_rule_id"); |
|
86 |
+// params.put("rule_id", duplRuleId); |
|
87 |
+// HashMap<String, Object> manage_id = manageDAO.selectManageId(params); |
|
88 |
+// Integer manageRuleId = (Integer) manage_id.get("manage_rule_id"); |
|
89 |
+// params.put("manage_rule_id", manageRuleId); |
|
90 |
+// manageDAO.deleteManageRule(params); |
|
91 |
+// } |
|
83 | 92 |
|
84 | 93 |
return dupRulManagementDAO.deleteDupRule(params); |
85 | 94 |
} |
95 |
+ /** |
|
96 |
+ * 중복 분석 선택 대상 테이블 조회 |
|
97 |
+ * 컬럼명 조회 기능 (미완) |
|
98 |
+ * |
|
99 |
+ * @author 임재현 |
|
100 |
+ * @since 2024.02.06 |
|
101 |
+ */ |
|
102 |
+ public List<HashMap<String,Object>> selectCheckedList(HashMap<String,Object> params) throws Exception{ |
|
103 |
+ int currentPage = (int) params.get("curPage"); |
|
104 |
+ int perPage = (int) params.get("perPage"); |
|
105 |
+ int startIndex = (currentPage - 1) * perPage; |
|
106 |
+ params.put("startIndex", startIndex); |
|
86 | 107 |
|
108 |
+ String s = (String) dupRulManagementDAO.selectCheckedList(params).get(0).get("column_id_list"); |
|
109 |
+ System.out.println("(String) dupRulManagementDAO.selectCheckedList(params).get(0) : " + dupRulManagementDAO.selectCheckedList(params).get(0)); |
|
110 |
+ |
|
111 |
+ int[] a = Arrays.stream(s.split(", ")).mapToInt(Integer::parseInt).toArray(); |
|
112 |
+ |
|
113 |
+ System.out.println(a[0]); |
|
114 |
+ System.out.println(a[1]); |
|
115 |
+ System.out.println(a[2]); |
|
116 |
+ |
|
117 |
+ System.out.println("s : " + s); |
|
118 |
+ String str = ""; |
|
119 |
+ System.out.println("a.length : " + a.length); |
|
120 |
+ |
|
121 |
+ System.out.println("dupRulManagementDAO.selectColumnNm(a[i]) : " + dupRulManagementDAO.selectColumnNm(a[0])); |
|
122 |
+ for(int i = 0; i<a.length; i++) |
|
123 |
+ { |
|
124 |
+ |
|
125 |
+ str += dupRulManagementDAO.selectColumnNm(a[i]) + ", "; |
|
126 |
+ } |
|
127 |
+ System.out.println("str : "+ str); |
|
128 |
+ |
|
129 |
+ return dupRulManagementDAO.selectCheckedList(params); |
|
130 |
+ } |
|
131 |
+ |
|
132 |
+ |
|
133 |
+ public int countCheckedList(HashMap<String,Object> params) throws Exception{ |
|
134 |
+ return dupRulManagementDAO.countCheckedList(params); |
|
135 |
+ } |
|
87 | 136 |
} |
--- server/main/java/kr/co/takensoft/dataQuality/rule/web/DupRulManagementController.java
+++ server/main/java/kr/co/takensoft/dataQuality/rule/web/DupRulManagementController.java
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 |
import org.springframework.web.servlet.ModelAndView; |
10 | 10 |
|
11 | 11 |
import java.util.HashMap; |
12 |
+import java.util.List; |
|
12 | 13 |
|
13 | 14 |
@Controller |
14 | 15 |
public class DupRulManagementController { |
... | ... | @@ -56,4 +57,19 @@ |
56 | 57 |
mav.addObject("result", dupRulManagementService.deleteDupRule(params)); |
57 | 58 |
return mav; |
58 | 59 |
} |
60 |
+ |
|
61 |
+ /** |
|
62 |
+ * 중복 분석 선택 대상 테이블 조회, 중복검사 선택 대상 테이블 페이징 |
|
63 |
+ * |
|
64 |
+ * @author 임재현 |
|
65 |
+ * @since 2024.02.06 |
|
66 |
+ */ |
|
67 |
+ @RequestMapping(value = "/selectCheckedList.json", method = RequestMethod.POST) |
|
68 |
+ public ModelAndView selectCheckedList(@RequestBody HashMap<String,Object> params) throws Exception { |
|
69 |
+ System.out.println("selectCheckedList : " + params); |
|
70 |
+ ModelAndView mav = new ModelAndView("jsonView"); |
|
71 |
+ mav.addObject("table", dupRulManagementService.selectCheckedList(params)); |
|
72 |
+ mav.addObject("count", dupRulManagementService.countCheckedList(params)); |
|
73 |
+ return mav; |
|
74 |
+ } |
|
59 | 75 |
} |
--- server/main/resources/mybatis/main/DupRulManagement-SQL.xml
+++ server/main/resources/mybatis/main/DupRulManagement-SQL.xml
... | ... | @@ -49,14 +49,14 @@ |
49 | 49 |
내용 : 중복 분석 컬럼 저장 |
50 | 50 |
--> |
51 | 51 |
<insert id="insertDupRule" parameterType="HashMap"> |
52 |
- INSERT INTO dupl_rule (column_id, dqi_id) |
|
52 |
+ INSERT INTO dupl_rule (column_id, column_id_list, dqi_id) |
|
53 | 53 |
VALUES |
54 |
- <foreach collection="columnList" item="item" separator=","> |
|
55 |
- ( |
|
56 |
- #{item.column_id} |
|
57 |
- , 9 |
|
58 |
- ) |
|
59 |
- </foreach> |
|
54 |
+ ( |
|
55 |
+ #{mainColumnId}, |
|
56 |
+ #{columnListId}, |
|
57 |
+ 9 |
|
58 |
+ ) |
|
59 |
+ |
|
60 | 60 |
</insert> |
61 | 61 |
|
62 | 62 |
<!-- |
... | ... | @@ -87,4 +87,47 @@ |
87 | 87 |
</foreach> |
88 | 88 |
</select> |
89 | 89 |
|
90 |
+ <!-- |
|
91 |
+ 작성자 : 임재현 |
|
92 |
+ 작성일 : 2024.02.06 |
|
93 |
+ 내용 : 중복검사 선택 대상 테이블 조회 |
|
94 |
+ --> |
|
95 |
+ <select id="selectCheckedList" parameterType="HashMap" resultType="HashMap"> |
|
96 |
+ SELECT |
|
97 |
+ dr.column_id_list |
|
98 |
+ FROM |
|
99 |
+ dupl_rule dr |
|
100 |
+ JOIN |
|
101 |
+ column_data cd ON cd.column_id = dr.column_id |
|
102 |
+ ORDER BY |
|
103 |
+ dr.dupl_rule_id ASC |
|
104 |
+ OFFSET #{startIndex} LIMIT #{perPage}; |
|
105 |
+ </select> |
|
106 |
+ |
|
107 |
+ <!-- |
|
108 |
+ 작성자 : 임재현 |
|
109 |
+ 작성일 : 2024.02.06 |
|
110 |
+ 내용 : 중복검사 선택 대상 테이블 페이징 |
|
111 |
+ --> |
|
112 |
+ <select id="countCheckedList" parameterType="HashMap" resultType="int"> |
|
113 |
+ SELECT |
|
114 |
+ count(*) |
|
115 |
+ FROM |
|
116 |
+ dupl_rule dr |
|
117 |
+ JOIN |
|
118 |
+ column_data cd ON cd.column_id = dr.column_id |
|
119 |
+ </select> |
|
120 |
+ <!-- |
|
121 |
+ 작성자 : 임재현 |
|
122 |
+ 작성일 : 2024.02.06 |
|
123 |
+ 내용 : 중복검사 선택 대상 테이블 컬럼명 조회 기능 (미완) |
|
124 |
+ --> |
|
125 |
+ <select id="selectColumnNm" parameterType="int" resultType="String"> |
|
126 |
+ SELECT |
|
127 |
+ column_nm |
|
128 |
+ FROM |
|
129 |
+ column_data |
|
130 |
+ WHERE |
|
131 |
+ column_id = #{b} |
|
132 |
+ </select> |
|
90 | 133 |
</mapper>(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?