package com.jxd.Boot.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.jxd.Boot.po.Student;

/**
* @author jinxudong
*
*/
public interface StudentDao extends JpaRepository<Student, Long> {
Student findByName(String studentName);

@Query(value = "sql", nativeQuery = true)
Student findByUid(String uid);

/**
* @Description (原生态sql)
* @return
*/
@Query(value = "select s.* from student s where 1=1 ", nativeQuery = true)
List<Student> selectStudent();

/**
* @Description (多条件查询)
* @param name
* @param age
* @return
*/
List<Student> findByNameAndAge(String name, Integer age);

List<Student> findByNameLike(String name);

/**
* @Description (模糊搜索按字段排序)
* @param name
* @return
*/
List<Student> findByNameLikeOrderByAge(String name);

/**
* @Description (按字段排序)
* @return
*/
List<Student> findByOrderByAgeDesc();

/**
* @Description (按字段统计)
* @param name
* @return
*/
long countByName(String name);


}

相关文章:

  • 2021-09-23
  • 2018-05-28
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-26
  • 2022-12-23
  • 2018-11-10
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2021-10-17
相关资源
相似解决方案