WHERE (
(
(TO_CHAR(SYSDATE, 'YYYYMMDD') = #{searchStartDt, jdbcType=VARCHAR})
AND
(BB.PROGRAM_CD IN ('11111'))
)
OR (
(TO_CHAR(SYSDATE, 'YYYYMMDD') <![CDATA[ <> ]]> #{searchStartDt, jdbcType=VARCHAR})
AND
(1=1)
)
)
위의 쿼리는 아래처럼 작동함
if (TO_CHAR(SYSDATE, 'YYYYMMDD') = #{searchStartDt, jdbcType=VARCHAR}) {
BB.PROGRAM_CD IN ('11111')
} else if (TO_CHAR(SYSDATE, 'YYYYMMDD') <![CDATA[ <> ]]> #{searchStartDt, jdbcType=VARCHAR}) {
1=1
}