본문 바로가기

Backend/DB 실무

[Mybatis] 대소문자 구분 없이 조회

반응형

대소문자 구분없이 조회

<if test='searchType eq "K" and searchKeyword != null and searchKeyword != ""'>
	AND UPPER(table_kor_name) like UPPER('%' || #{searchKeyword} || '%')
	AND LOWER(table_kor_name) like LOWER('%' || #{searchKeyword} || '%')
</if>

 

foreach문속 option selected

<select id="selectDataset" name="dataListSeq" style="width: 300px;">
	<option value="">데이터 셋을 선택하세요</option>
	<c:forEach var="item" items="${dataset}" varStatus="s">
		<option value="${item.dataListSeq}"
        	<c:if test="${pCDV eq item.dataListSeq }">selected</c:if> >
        	    ${item.korName}_v.${item.version}
        </option>
	</c:forEach>
</select>

 

반응형