백엔드/myBatis
[3.0] forEach 사용
팩트폭력배
2010. 7. 15. 16:41
- item : forEach내에서 각 아이템 이름으로 사용할 것.
- index : index
- collection="classNames" // 배열명
- open="" // forEach 시작 전 ex: "(" forEach 시작전에 ( #{item}
- separator="," // forEach 1회시 구분 해줄 기호
- close="" // forEach 종료 후 ex: ")" forEach 종료 후에 ( #{item}, #{item}, #{item} .... #{item[index]} )
SUM(CASE WHEN R.CLASS_NAME = #{item} THEN R.CNT ELSE 0 END) AS #{item}