일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- Android
- 잡토이
- MSSQL
- html5
- s4a
- librecad
- 운정
- 시작하기
- Spring Security
- 아두이노
- 오라클
- 유니티
- 안드로이드
- 리브레캐드
- 스크래치
- jobtoy
- 설치
- 잡토이 메이킹 코딩 학원
- mysql
- 설정
- jsp
- 라즈베리파이
- 예제
- 톰캣
- Unity
- 강좌
- 파주
- tomcat
- oracle
- 코딩
- Today
- Total
랩제이
[ibatis] in 조건 생성하기 본문
[ibatis] in 조건 생성하기
* ctrl
List<String> option_state_no = new ArrayList<String>();
option_state_no.add("1");
option_state_no.add("2");
condition.put("option_state_no", option_state_no);
List<Goods> goodsList = goodsService.getList(condition);
* svc
public List<Goods> getList(Map<String, Object> condition) throws Exception {
return goodsDao.getList(condition);
}
* dao
@SuppressWarnings("unchecked")
@Override
public List<Goods> getList(Map<String, Object> condition) throws Exception {
return (List<Goods>)sqlMap.queryForList("goods.list",condition);
}
* sql
<isNotEmpty property="option_state_list" prepend="AND">
<![CDATA[
b.STATE
]]>
<iterate prepend="IN" property="option_state_no" open="(" close=")" conjunction=",">
#option_state_no[]#
</iterate>
</isNotEmpty>
[ibatis] in 조건 생성하기
'programming > ibatis mybatis' 카테고리의 다른 글
[mybatis] oracle insert 리턴값 받기 selectKey (0) | 2014.10.23 |
---|---|
[mybatis] function 호출하고 리턴값 받기 (0) | 2014.08.04 |
[ibatis] in 조건으로 delete 하기 (0) | 2013.10.02 |
[ibatis] delete sql in 사용 (0) | 2013.06.30 |
[ibatis] sql문 예제5 procedure (0) | 2013.06.25 |