
250418 하석형 Pagination SQL 검색 필드 추가 (와일드카드 이스케이프 처리), 권한SQL 검색 필드 변경
@9da6959a7a7feac7101ac423c01050db4dc12bae
--- src/main/java/com/takensoft/common/Pagination.java
+++ src/main/java/com/takensoft/common/Pagination.java
... | ... | @@ -31,6 +31,7 @@ |
31 | 31 |
|
32 | 32 |
private String searchType; // 검색조건 |
33 | 33 |
private String searchText; // 검색어 |
34 |
+ private String sqlSearchText; // SQL검색어 (이스케이프 처리된 검색어) |
|
34 | 35 |
|
35 | 36 |
private String startDt; // 시작일 |
36 | 37 |
private String endDt; // 종료일 |
... | ... | @@ -54,7 +55,11 @@ |
54 | 55 |
this.recordSize = Integer.parseInt(params.getOrDefault("recordSize", "1")); |
55 | 56 |
this.pageSize = Integer.parseInt(params.getOrDefault("pageSize", "10")); |
56 | 57 |
this.searchType = (String)params.get("searchType"); |
57 |
- this.searchText = (String)params.get("searchText"); |
|
58 |
+ String rawSearchText = (String)params.get("searchText"); |
|
59 |
+ this.searchText = rawSearchText; |
|
60 |
+ this.sqlSearchText = rawSearchText != null |
|
61 |
+ ? rawSearchText.replace("~", "~~").replace("_", "~_").replace("%", "~%") |
|
62 |
+ : null; // SQL 검색 시 와일드카드 이스케이프 처리 |
|
58 | 63 |
this.startDt = (String)params.get("startDt"); |
59 | 64 |
this.endDt = (String)params.get("endDt"); |
60 | 65 |
this.id = (String)params.get("id"); |
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?