mybatis 에서 like 쓰기

2020. 6. 7. 15:02프로젝트/Spring

mybatis Doc 에 like 를 치면 나오긴 하지만, 이는 oracle 기준이라, mysql에서 쓰면 먹히질 않는다. 

https://mybatis.org/mybatis-3/java-api.html   

 

mybatis – MyBatis 3 | Java API

Java API Now that you know how to configure MyBatis and create mappings, you're ready for the good stuff. The MyBatis Java API is where you get to reap the rewards of your efforts. As you'll see, compared to JDBC, MyBatis greatly simplifies your code and k

mybatis.org

하지만, 운이 좋게도 DB 별로 정리해주신 분이 있어서 편하게 했다. 

 

mysql 에서는 

WHERE(AND) column LIKE CONCAT('%',#{name},'%')


출처: https://roqkffhwk.tistory.com/128 [야근싫어하는 개발자]