반응형
mybatis에서 if-test만 사용하는게 아닌. if-else를 사용해야 할때 choose-when을 사용하면 됩니다.
<choose>
<when test="condition1">
//codition1 is true, then running this block
</when>
<when test="condition2">
//condition1 is false and condition2 is true, then running this block
</when>
<otherwise>
//all contition is false, then running this block
</otherwise?
</choose>
반응형
'Database' 카테고리의 다른 글
[MySQL-MyBatis] insert후 pk를 반환하는 selectKey와 useGeneratedKey의 동시성 이슈 (0) | 2023.05.19 |
---|---|
MySQL] 조인(Table join) 종류 (0) | 2023.01.25 |
[MySQL] ON DUPLICATE KEY UPDATE [짧] (0) | 2022.05.23 |
[MySQL] 복합키 설정하기 [짧] (0) | 2022.05.23 |
Procedure 기본 (0) | 2022.05.03 |