多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
```java public interface UserRepository extends JpaRepository<User, Integer>, JpaSpecificationExecutor<User> { // ?1 ?是占位符,1是方法参数的索引,从1开始 @Query("select u from User u where u.email = ?1") User getByEmail(String eamil); @Query("select u from User u where u.username = ?1 and u.password = ?2") User getByUsernameAndPassword(String username, String password); @Query("select u from User u where u.username like %?1%") List<User> getByUsernameLike(String username); //可以省略select,直接写from @Query(value="from User") public List<User> findAllUser(); } ```