是否可以在查询注释中添加动态sql条件
当n =时说 n!=:名称 n就像“%:name%”
根据用户输入的条件形成
public interface PersonRepository extends CrudRepository<Person, Long> {
@Query("select p from Person AS p"
+ " ,Name AS n"
+ " where p.forename = n.forename "
+ " and p.surname = n.surname"
+ " and n = :name")
Set<Person>findByName(@Param("name") Name name);
}
当用户选择=或!=或类似
时,我想动态地形成sql条件,而不是编写“ and n =:name”“和n!=:name” “并且n类似于'%:name%'”
好像是“过滤”选项