E10 postman key값으로 조회 기능만들기, mybatis
<select id="getList" parameterType="com.portfolio.mvc.parameter.BoardSearchParameter" resultType="com.portfolio.mvc.domain.Board">
SELECT
B.BOARD_SEQ,
B.BOARD_TYPE,
B.TITLE,
B.CONTENTS,
B.REG_DATE
FROM T_BOARD B
<where>
<!-- 키워드 검색 @isNotEmpty() null체크, 배열길이체크-->
<if test="@org.apache.commons.lang3.StringUtils@isNotEmpty(keyword)">
AND B.TITLE LIKE CONCAT('%', #{keyword}, '%')
</if>
<!-- 게시판 종류 배열 검색 -->
<if test="@org.apache.commons.lang3.ObjectUtils@isNotEmpty(boardTypes)">
AND B.BOARD_TYPE IN(
<foreach collection="boardTypes" item="value" separator=",">
#{value}
</foreach>
)
</if>
</where>
ORDER BY B.REG_DATE DESC
</select>
이부분을 추가하면 postman에서 검색가능하다
<!-- 게시판 종류 배열 검색 -->
<if test="@org.apache.commons.lang3.ObjectUtils@isNotEmpty(boardTypes)">
AND B.BOARD_TYPE IN(
<foreach collection="boardTypes" item="value" separator=",">
#{value}
</foreach>
)
</if>