일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- zip 파일 암호화
- aggregation
- MySQL
- 900gle
- token filter test
- license delete
- query
- Kafka
- Elasticsearch
- springboot
- sort
- docker
- Test
- ELASTIC
- matplotlib
- high level client
- flask
- Python
- 차트
- zip 암호화
- TensorFlow
- licence delete curl
- API
- aggs
- Mac
- License
- plugin
- 파이썬
- analyzer test
- Java
Archives
- Today
- Total
개발잡부
[mybatis] if else 혹은 switch case 본문
반응형
우선 if 문
<select id="findBoardList" resultType="boardList">
select * from tbl_board
where title = '%'||#{title}||'%'
<if test="content != null">
OR content = '%'||#{content}||'%'
</if>
</select>
and or 조건문
<if test="parameter1 != null and parameter2 != null">
<if test="parameter1 != null or parameter2 != null">
<if test='parameter1 == "string" and parameter2 == "string"'>
<if test='parameter1 != null and parameter2.equals("string")'>
<if test="parameter1 != null and parameter2.equals('string')">
switch case
<choose>
<when test="storeType == 'DOO'">-- doo 인 경우 재고수량
, iisales.remain_cnt -- 재고수량
</when>
<otherwise>
, (SELECT remain_cnt FROM itm_item_sales WHERE item_no = ii .item_no
AND if (iiss.stock_allot_type = 'ALL' <![CDATA[&&]]>
iiss. online_stock_yn ='Y' <![CDATA[&&]]>
iiss. online_stock_start_dt <![CDATA[<=]]> now() <![CDATA[&&]]>
now() <![CDATA[<=]]> iiss. online_stock_end_dt
<choose>
<when test="storeType == 'EOO'">
, store_id ='99998'
</when>
<otherwise>
, store_id ='99999'
</otherwise>
</choose>
, store_id = iisd.store_id ) ) AS remain_cnt
</otherwise>
</choose>
반응형
Comments