Skip to content

Commit da4781a

Browse files
committed
v5, QueryDSL, RepositoryImpl 검색조건 업데이트.
1 parent 74def1c commit da4781a

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

src/main/java/org/example/v5/UtilStaticV5.java

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ private String impl2ConS2Mehtod() {
699699
for(int j=0; j<colStrs.length; j++){
700700
if(colNames[i].equals(colStrs[j])){
701701
result += " if(field.equals(\""+colNames[i]+"\")){\n" +
702-
" builder.or("+toLowerFirst(domainStr)+"."+colNames[i]+".eq(s));\n" +
702+
" builder.or("+toLowerFirst(domainStr)+"."+colNames[i]+".like(\"%\"+s+\"%\"));\n" +
703703
" }\n";
704704
}
705705
}
@@ -803,7 +803,7 @@ private String impl2ConSMehtod() {
803803
for(int j=0; j<colStrs.length; j++){
804804
if(colNames[i].equals(colStrs[j])){
805805
result += " if(field.equals(\""+colNames[i]+"\")){\n" +
806-
" builder.or("+toLowerFirst(domainStr)+"."+colNames[i]+".eq(s));\n" +
806+
" builder.or("+toLowerFirst(domainStr)+"."+colNames[i]+".like(\"%\"+s+\"%\"));\n" +
807807
" }\n";
808808
}
809809
}
@@ -1565,7 +1565,8 @@ public String makeIndex() {
15651565
" <td class=\"font-12\" style=\"width:40px;\">키워드</td>\n" +
15661566
" <td class=\"font-12 d-flex align-items-center\" style=\"width:190px;\">\n" +
15671567
" <select id=\"field\" name=\"field\" style=\"width:80px;\" title=\"키워드 선택\" autocomplete=\"on\" >\n" +
1568-
" <option th:value=\"id\" th:selected=\"${#strings.trim(param.field) eq 'id'}\">id</option>\n" +
1568+
//" <option th:value=\"id\" th:selected=\"${#strings.trim(param.field) eq 'id'}\">id</option>\n" +
1569+
optionStr()+
15691570
// " <option th:value=\"all\" th:selected=\"${#strings.trim(param.field) eq 'addrFull'}\">주소검색</option>\n" +
15701571
// " <option th:value=\"zipcode\" th:selected=\"${#strings.trim(param.field) eq 'zipCode'}\">우편번호</option>\n" +
15711572
// " <option th:value=\"addr1\" th:selected=\"${#strings.trim(param.field) eq 'addr1'}\">도로명주소</option>\n" +
@@ -1709,6 +1710,43 @@ public String makeIndex() {
17091710
return result;
17101711
}
17111712

1713+
private String optionStr() {
1714+
String result ="";
1715+
//" <option th:value=\"id\" th:selected=\"${#strings.trim(param.field) eq 'id'}\">id</option>\n"
1716+
for(int i=0; i<colNames.length;i++){
1717+
if(colLongs!=null){
1718+
for(int j=0; j<colLongs.length;j++){
1719+
if(colLongs[j].equals(colNames[i])){
1720+
result += " <option th:value=\""+colNames[i]+"\" th:selected=\"${#strings.trim(param.field) eq '"+colNames[i]+"'}\">"+colNames[i]+"</option>\n";
1721+
}
1722+
}
1723+
1724+
}
1725+
if(colStrs!=null){
1726+
for(int j=0; j<colStrs.length; j++){
1727+
if(colStrs[j].equals(colNames[i])){
1728+
result += " <option th:value=\""+colNames[i]+"\" th:selected=\"${#strings.trim(param.field) eq '"+colNames[i]+"'}\">"+colNames[i]+"</option>\n";
1729+
}
1730+
}
1731+
1732+
}
1733+
if(colDates!=null){
1734+
for(int j=0; j<colDates.length; j++){
1735+
if(colDates[j].equals(colNames[i])){
1736+
result += " <option th:value=\""+colNames[i]+"\" th:selected=\"${#strings.trim(param.field) eq '"+colNames[i]+"'}\">"+colNames[i]+"</option>\n";
1737+
}
1738+
}
1739+
1740+
}
1741+
}
1742+
if(foreignCols!=null){
1743+
for(int i=0; i<foreignCols.length; i++){
1744+
result += " <option th:value=\""+toLowerFirst(foreignCols[i])+"Id\" th:selected=\"${#strings.trim(param.field) eq '"+toLowerFirst(foreignCols[i])+"Id'}\">"+toLowerFirst(foreignCols[i])+"Id</option>\n";
1745+
}
1746+
}
1747+
return result;
1748+
}
1749+
17121750
private String tableColIndex2() {
17131751
String result ="";
17141752
// " <td th:text=\"${board.id}\"></td>\n" +

0 commit comments

Comments
 (0)