package com.yihu.jw.hospital.healthCare;

import com.yihu.jw.entity.hospital.healthCare.YlzMedicalIcdDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by wangzhinan 20211003
 */
public interface YlzMedicailIcdDao extends PagingAndSortingRepository<YlzMedicalIcdDO, String>, JpaSpecificationExecutor<YlzMedicalIcdDO> {

    @Query("from YlzMedicalIcdDO a where a.medicalId = ?1 ")
    List<YlzMedicalIcdDO> findByMedicalId(String medicalId);

    @Modifying
    @Query("delete from YlzMedicalIcdDO  where medicalId = ?1")
    void deleteByMedicalId(String medicalId);
}
