|
@@ -19,10 +19,11 @@ public interface InspectionsDao {
|
|
|
/**
|
|
|
* 通过门诊号获取住院号
|
|
|
* */
|
|
|
- @Select("select rtrim(inpatient_no) from zy_actpatient with(nolock) where inpatient_no=(select max(inpatient_no) " +
|
|
|
- "from a_patient_mi with(nolock) where a_patient_mi.mz_no=#{patientId}) and inpatient_no not like 'S%' and " +
|
|
|
- "inpatient_no not like 'JT%' and inpatient_no not like '%$%' ")
|
|
|
- String selectInpatientNo(@Param("patientId") String patientId);
|
|
|
+ @Select("select rtrim(a.inpatient_no) from a_patient_mi a,mz_patient_mi b " +
|
|
|
+ "where upper(a.social_no)=upper(b.social_no) and b.patient_id=#{patientId} " +
|
|
|
+ "and a.inpatient_no not like 'S%' and a.inpatient_no not like 'JT%' " +
|
|
|
+ "and a.inpatient_no not like '%$%'")
|
|
|
+ List<String> selectInpatientNo(@Param("patientId") String patientId);
|
|
|
|
|
|
@Select("select distinct rtrim(tj_no) from mz_patient_mi with(nolock) where social_no=#{socialNo}")
|
|
|
List<String> selectTjNos(@Param("socialNo") String socialNo);
|