InspectionsDao.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package thyyxxk.wxservice_server.dao;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.apache.ibatis.annotations.Select;
  5. import thyyxxk.wxservice_server.entity.inspections.HshjPatient;
  6. import java.util.List;
  7. /**
  8. * @author dj
  9. */
  10. @Mapper
  11. public interface InspectionsDao {
  12. @Select("select rtrim(max(tj_no)) from mz_patient_mi with(nolock) where patient_id=#{patientId}")
  13. String selectTjNo(@Param("patientId") String patientId);
  14. // TODO: 2021-04-30 以后这个地方要换成葫芦娃的接口
  15. /**
  16. * 通过门诊号获取住院号
  17. * */
  18. @Select("select rtrim(a.inpatient_no) from a_patient_mi a,mz_patient_mi b " +
  19. "where upper(a.social_no)=upper(b.social_no) and b.patient_id=#{patientId} " +
  20. "and a.inpatient_no not like 'S%' and a.inpatient_no not like 'JT%' " +
  21. "and a.inpatient_no not like '%$%'")
  22. List<String> selectInpatientNo(@Param("patientId") String patientId);
  23. @Select("select distinct rtrim(tj_no) from mz_patient_mi with(nolock) where social_no=#{socialNo}")
  24. List<String> selectTjNos(@Param("socialNo") String socialNo);
  25. @Select("select distinct rtrim(patient_id) from mz_patient_mi with(nolock) where social_no=#{socialNo}")
  26. List<String> selectMzNos(@Param("socialNo") String socialNo);
  27. @Select("select distinct rtrim(inpatient_no) from a_patient_mi with(nolock) where social_no=#{socialNo}")
  28. List<String> selectZyNos(@Param("socialNo") String socialNo);
  29. @Select("select rtrim(name) from mz_patient_mi with(nolock) where patient_id=#{patId}")
  30. String selectPatName(@Param("patId") String patId);
  31. @Select("select rtrim(name) as name,rtrim(sex) as gender, age=datediff(year,birth_day,getdate()) " +
  32. "from mz_patient_mi where patient_id=#{patId}")
  33. HshjPatient selectPatientBriefInfo(@Param("patId") String patId);
  34. @Select("select top 1 pat_id from t_tencent_electronic_health_card where id_number=#{socialNo}")
  35. String selectPatIdBySocialNo(@Param("socialNo") String socialNo);
  36. @Select("select count(1) from t_wechat_patient_bind where patient_id=#{patId} and open_id=#{openId} and del_flag=0")
  37. int selectPatIdAndOpenIdMatchCount(@Param("patId") String patId, @Param("openId") String openId);
  38. }