package com.ywt.outpatient.domain.entity.center;

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

import java.util.List;

/**
 * create by daiyihua
 */
public interface DoctorTitleRepository extends JpaRepository<DoctorTitle, Integer> {

    /**
     * 得到所有对象
     *
     * @return
     */
    @Query(value = "select * from doctor_title where deleted = 0;", nativeQuery = true)
    List<DoctorTitle> findAll();

    List<DoctorTitle> getAllByDeletedFalseOrderByWeightDesc();

    List<DoctorTitle> getAllByDeletedFalseAndTypeOrderByWeightDesc(int type);
}
