the content of elements must consist of well-formed character data or markup 에러 발생시(톰캣, 스프링)
부등호 (즉 < , > ) 를 기냥 쓰게 되면 오류가 난다. (태그에 존재하는 <tag> 꺽쇠랑 동일하기 때문에 파싱에러발생)
이때는 <![CDATA[ ]]> 로 감싸주면 된다
<select id="select" resultClass="DischargePointData" parameterClass="Map">
SELECT
seq as seq
, note as note
FROM
table
user_id = #userId#
<isNotEmpty prepend="AND" property="startYYYYMM" removeFirstPrepend="true">
<![CDATA[
reg_date >= str_to_date(concat('#startYYYYMM#','01000000'),'%Y%m%d%H%i%s')
]]>
</isNotEmpty>
</select>
SELECT
seq as seq
, note as note
FROM
table
user_id = #userId#
<isNotEmpty prepend="AND" property="startYYYYMM" removeFirstPrepend="true">
<![CDATA[
reg_date >= str_to_date(concat('#startYYYYMM#','01000000'),'%Y%m%d%H%i%s')
]]>
</isNotEmpty>
</select>
참고 : http://tost.tistory.com/144
반응형
'DB Story' 카테고리의 다른 글
[ Mybatis ] Type handler was null on parameter mapping for property '__frch_item_0.value'. (3) | 2016.10.18 |
---|---|
[ Mybatis ] foreach (0) | 2016.09.08 |
[ RRD ] rrd graph y-aixs unit (0) | 2016.06.29 |
[ Mysql ] 특정 필드명 보기 (0) | 2016.05.04 |
[ RRD ] 데이터 저장 기간 설정하기 (0) | 2016.04.21 |
[ DB ] execute / executeQuery / executeUpdate 차이 (0) | 2016.01.29 |
[ DB ] INSERT 데이터 삽입 (0) | 2016.01.29 |
[ DB ] DB 테이블 연산자 - JOIN 연산자 (두 개 이상 테이블 간의 비교검색) (0) | 2016.01.29 |