일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
Tags
- Kafka
- MySQL
- token filter test
- matplotlib
- 파이썬
- zip 파일 암호화
- high level client
- 900gle
- 차트
- aggs
- zip 암호화
- springboot
- docker
- analyzer test
- API
- Python
- query
- flask
- ELASTIC
- Mac
- Elasticsearch
- sort
- plugin
- Test
- license delete
- TensorFlow
- License
- licence delete curl
- Java
- aggregation
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