select * from board where title like concat('%', #{title}, '%')
like %#{title}%로
<choose>
<when test = "option == 'T'">
title like concat('%', #{keyword}, '%')
</when>
<when test = "option == 'W'">
writer like concat('%', #{keyword}, '%')
</when>
<otherwise>
title like concat('%', #{keyword}, '%')
or content like concat('%', #{keyword}, '%')
</otherwise>
</choose>
choose로 감싸고 when으로 조건문 사용. otherwise는 else나 default와 같음.
option은 #{option}으로 안써도 알아서 인식된다.