List<String> useridList = new ArrayList<>(); //需要注意的是这个位置 new ArrayList<>(); useridList 存的是 not in 中的参数
Repository 接口中方法
第一种带分页
public Page<UserEntity> findByIdNotIn(List<String> list, Pageable page);
第二种不带分页
public List<UserEntity> findByIdNotIn(List<String> list);
第三种不带分页
@Query(nativeQuery =true,value = "SELECT * FROM table as u where u.id NOT IN (?1) order by u.createTime )
public List<UserEntity> findAllcs( List<String> uIds);