반응형
▶board.xml
detailCondition 검색 조건
<sql id="searchFrag">
<trim prefix="WHERE" prefixOverrides="AND">
<if test="detailCondition neq null">
<if test="@org.apache.commons.lang3.StringUtils@isNotBlank(detailCondition.buyerLgu)">
AND BUYER_LGU = #{detailCondition.buyerLgu}
</if>
<if test="@org.apache.commons.lang3.StringUtils@isNotBlank(detailCondition.buyerAdd1)">
AND INSTR(BUYER_ADD1, #{detailCondition.buyerAdd1}) > 0
</if>
<if test="@org.apache.commons.lang3.StringUtils@isNotBlank(detailCondition.buyerName)">
AND INSTR(BUYER_NAME, #{detailCondition.buyerName}) > 0
</if>
</if>
</trim>
</sql>
simpleCondition 검색조건
<sql id="searchFrag">
<where>
<if test="simpleCondition neq null and @org.apache.commons.lang3.StringUtils@isNotBlank(simpleCondition.searchWord)">
<choose>
<when test="simpleCondition.searchType eq 'writer'">
INSTR(BO_WRITER, #{simpleCondition.searchWord}) > 0
</when>
<when test="simpleCondition.searchType eq 'content'">
INSTR(BO_CONTENT, #{simpleCondition.searchWord}) > 0
</when>
<otherwise>
INSTR(BO_WRITER, #{simpleCondition.searchWord}) > 0
OR
INSTR(BO_CONTENT, #{simpleCondition.searchWord}) > 0
</otherwise>
</choose>
</if>
</where>
</sql>
반응형
'내가 보려고 정리하는 > Spring' 카테고리의 다른 글
시큐리티 2 - db연결, 비밀번호 단방향 암호화(0503) (1) | 2023.05.03 |
---|---|
시큐리티 (0) | 2023.05.02 |
웹 : 전략객체에게 검증 넘기기, Tiles사용해보기 : 0411 (0) | 2023.04.11 |
웹 : datasource-context : 0410 (1) | 2023.04.10 |
웹 : 스프링 방식으로 해보자. : 0407 (0) | 2023.04.07 |