接口 UserDao
- 所有超级接口:
org.springframework.data.repository.CrudRepository<User,,Long> HiverBaseDao<User,,Long> org.springframework.data.jpa.repository.JpaRepository<User,,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<User>,org.springframework.data.repository.ListCrudRepository<User,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<User,,Long> org.springframework.data.repository.PagingAndSortingRepository<User,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<User>,org.springframework.data.repository.Repository<User,Long>
用户数据处理层
尊重知识产权,CV 请保留版权,海文科技 https://hiver.cc 出品,不允许非法使用,后果自负
- 作者:
- Yazhi Li
-
嵌套类概要
从接口继承的嵌套类/接口 org.springframework.data.jpa.repository.JpaSpecificationExecutor
org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T extends Object> -
方法概要
修饰符和类型方法说明findByDeletedAndStatusAndDepartmentId(Integer deleted, Integer status, Long departmentId) 通过部门获得员工列表findByDepartmentId(Long departmentId) 通过部门id获取findByEmail(String email) 通过邮件获取用户findByMobile(String mobile) 通过手机获取用户findByUsername(String username) 通过用户名获取用户findByUsernameLikeAndStatus(String key, Integer status) 通过用户名模糊搜索findByUsernameOrEmailOrMobile(String username, String email, String mobile) 搜索用户voidupdateDepartmentTitle(Long departmentId, String departmentTitle) 更新部门名称从接口继承的方法 org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save从接口继承的方法 org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush从接口继承的方法 org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, delete, exists, findAll, findAll, findAll, findAll, findBy, findOne从接口继承的方法 org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAll从接口继承的方法 org.springframework.data.repository.ListPagingAndSortingRepository
findAll从接口继承的方法 org.springframework.data.repository.PagingAndSortingRepository
findAll从接口继承的方法 org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
方法详细资料
-
findByUsername
通过用户名获取用户 -
findByMobile
通过手机获取用户 -
findByEmail
通过邮件获取用户 -
findByDepartmentId
通过部门id获取 -
findByUsernameLikeAndStatus
@Query("select u from User u where u.username like %?1% or u.nickname like %?1% and u.status = ?2") List<User> findByUsernameLikeAndStatus(String key, Integer status) 通过用户名模糊搜索 -
updateDepartmentTitle
@Modifying @Query("update User u set u.departmentTitle=?2 where u.departmentId=?1") void updateDepartmentTitle(Long departmentId, String departmentTitle) 更新部门名称 -
findByDeletedAndStatusAndDepartmentId
List<User> findByDeletedAndStatusAndDepartmentId(Integer deleted, Integer status, Long departmentId) 通过部门获得员工列表 -
findByUsernameOrEmailOrMobile
搜索用户- 参数:
username-email-mobile-- 返回:
-