package com.yihu.figure.dao.patient.portrait;

import com.yihu.figure.model.patient.portrait.UserPortrait;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by chenweida on 2017/3/7.
 */
public interface UserPortraitDao extends PagingAndSortingRepository<UserPortrait, Long>, JpaSpecificationExecutor<UserPortrait> {
   @Query(" from UserPortrait u where u.userCode=?1  ")
    List<UserPortrait> findByPatientCode(String patientCode);

    @Query(" from UserPortrait u where u.subCategory=?1  ")
    List<UserPortrait> findBySubCategory(String key);
}
