Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- JavaScript
- es6
- Express
- xPlatform
- table
- mybatis
- 공정능력
- window
- SQL
- 정렬
- maVen
- Eclipse
- NPM
- SPC
- vaadin
- mapreduce
- tomcat
- hadoop
- Java
- MSSQL
- Kotlin
- Spring
- Android
- IntelliJ
- Python
- GIT
- 보조정렬
- R
- react
- Sqoop
Archives
- Today
- Total
DBILITY
독거 가능성 100% 노후에 라면값이라도 하게 센스를 발휘합시다!😅
Please click on the ad so that I can pay for ramen in my old age!
点击一下广告,让老后吃个泡面钱吧!
老後にラーメン代だけでもするように広告を一回クリックしてください。
mybatis foreach multiple like 본문
반응형
갑자기 필요해서 해봤다.
paramter로 array를 사용함. 과목명과 교육목표에 특정 키워드들이 들어 갔는지 조회하는 부분에 사용...
<foreach collection="subjects" index="index" item="item" open=" AND (" close=")" separator=" ">
<choose>
<when test="index==0">
B.SUBJECT_NAME LIKE '%${item}%'
OR C.EDUC_GOAL LIKE '%${item}%'
</when>
<otherwise>
OR B.SUBJECT_NAME LIKE '%${item}%'
OR C.EDUC_GOAL LIKE '%${item}%'
</otherwise>
</choose>
</foreach>
하고 보니 static...
<foreach collection="subjects" index="index" item="item" open=" AND (" close=")" separator=" ">
<choose>
<when test="index==0">
B.SUBJECT_NAME LIKE '%#'+#{item}+'%'
OR C.EDUC_GOAL LIKE '%#'+#{item}+'%'
</when>
<otherwise>
OR B.SUBJECT_NAME LIKE '%'+#{item}+'%'
OR C.EDUC_GOAL LIKE '%'+#{item}+'%'
</otherwise>
</choose>
</foreach>
반응형
'java > mybatis' 카테고리의 다른 글
mybatis result net.sourceforge.jtds.jdbc.ClobImpl@object 일 경우 (0) | 2023.01.09 |
---|---|
mybatis 조건문에서 java static method 사용 예시 (0) | 2022.11.08 |
mybatis comparision usage in condition expression ( 부등호 조건 등 ) (0) | 2022.10.04 |
mybatis typehandler를 이용한 oracle procedure에 list<map> parameter 넘기기 (0) | 2017.07.15 |
mybatis insert into table select시 ora-00933 (0) | 2017.07.01 |
Comments