hyebong_e

iBatis를 myBatis로 변환할 때.. 본문

Oracle&Mysql

iBatis를 myBatis로 변환할 때..

나는도비 2023. 7. 17. 13:45
728x90
반응형
SMALL

다들 소스를 보다보면 필요한 때에 따라 iBatis를 myBatis로 변환이 필요할때가 있을 것 이다.

나도 처음엔 많이 헷갈렸었던 문법인데 ... 다들 참고만 하고 필요에 따라 적용 해보자.

 

example..

쿼리 name값
#s_date_type# #{s_date_type}
<isNotEmpty property="s_date_type"> </isNotEmpty> <if test="s_date_type != '' " and  s_date_type != null>
</if>
<isEmpty property="s_date_type"> </isEmpty> <if test="s_date_type == '' " and  s_date_type == null> </if>
<isEqual property="s_date_type" compareValue="Y">
</isEqual >
<if test="s_date_type == 'Y' "> </if>

<if test = " ">로 통일 하여 비교연산자를 사용해서 간단하게 표현 할 수 있다.

반응형
LIST
Comments