在用jpa的過程中需要使用find_in_set這個mysql的方法.
使用in查詢,當A,B,C中這個字段查詢B或C的時候會失敗
使用regexp的方法
@Query("select * FROM $table WHERE concat(',',$column,',') regexp concat(',(',replace(?1,',','|'),'),') order by ?#{#pageable} ",nativeQuery = true)
貌似可以.
在用jpa的過程中需要使用find_in_set這個mysql的方法.
使用in查詢,當A,B,C中這個字段查詢B或C的時候會失敗
使用regexp的方法
@Query("select * FROM $table WHERE concat(',',$column,',') regexp concat(',(',replace(?1,',','|'),'),') order by ?#{#pageable} ",nativeQuery = true)
貌似可以.