메모장
MyBatis foreach 본문
# IN
<when test="id" != null and id != ''">
AND (
<foreach collection="ids" item="item" separator="," open="(" close=")">
#{item}
</foreach>
)
</when>
# OR
<when test="id" != null and id != ''">
AND (
<foreach collection="ids" item="item" separator="OR">
#{item}
</foreach>
)
</when>
# MyBatis update foreach 설정
jdbc:mysql://localhost:3306/test?allowMultiQueries=true
'DataBase' 카테고리의 다른 글
MySQL You can't specify target table 'tablename' for update in FROM clause (0) | 2024.10.24 |
---|---|
MariaDB 암호화, 복호화 (0) | 2024.06.25 |
MariaDB 컬럼명, 컬럼 코멘트로 테이블 조회 (0) | 2024.06.24 |
MariaDB Procedure 반복문 (0) | 2023.02.20 |
MariaDB 콤마(,)로 구분되어 있는 문자열에서 정확한 값 조건으로 조회 (0) | 2023.02.15 |