스프링

[iBatis/MyBatis] 아이/마이바티스 in절 사용

배고파요 2023. 5. 4. 13:13
728x90

 

select * 
from TB_TEST
where STATUS in
<iterate property="statusArray" open="(" close=")" conjunction=",">
    #statusArray[]#
</iterate>

 

📍 중요 포인트 ?

  • <iterate>
  • #statusArray[]#
  • <iterate> 에는 "List", "Array" 모두 가능하다는 점.

 

 

 

 

❗ 참고

  • 그렇다면 Mybatis 에서는 어떻게 쓰나?
  • <foreach collection="testList" item="test" separator="," open="(" close=")" > #{test} </foreach>
  • 물론 MyBatis에서도 "List", "Array" 모두 가능함.

 

 


출처 : 

https://hee-kkk.tistory.com/41

https://ddolcat.tistory.com/241

https://insight-bgh.tistory.com/169

https://kkh0977.tistory.com/1035


개발 공부를 위한 블로그 입니다. 

오류가 있다면 댓글로 알려주세요! 

감사합니다.

728x90