AppointmentDao.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package thyyxxk.wxservice_server.dao;
  2. import org.apache.ibatis.annotations.*;
  3. import thyyxxk.wxservice_server.entity.PureCodeName;
  4. import thyyxxk.wxservice_server.entity.assessment.CovidQuestionnaire;
  5. import thyyxxk.wxservice_server.entity.appointment.DoctorInfo;
  6. /**
  7. * @author dj
  8. */
  9. @Mapper
  10. public interface AppointmentDao {
  11. /**
  12. * 获取医生信息
  13. * @param doctorCode 医生编码
  14. * @param openId 用户的openId,用于判断医生是否被用户收藏
  15. * @return 医生信息
  16. * */
  17. @Select("select " +
  18. "rtrim(a.code) doctorCode, " +
  19. "rtrim(a.name) doctorName, " +
  20. "rtrim(b.name) doctorTitle, " +
  21. "rtrim(a.dept_code) deptCode, " +
  22. "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dept_code), " +
  23. "a.specialty, " +
  24. "a.introduction, " +
  25. "a.portrait, " +
  26. "collected=(select count(1) from t_wechat_patient_collection with(nolock) where " +
  27. "doctor_code=#{doctorCode} and open_id=#{openId}) " +
  28. "from a_employee_mi a with(nolock), zd_emp_title b with(nolock) " +
  29. "where a.code=#{doctorCode} and " +
  30. "a.emp_tit_code=b.code and " +
  31. "a.code not in ('00000', '00026') and " +
  32. "isnull(a.del_flag,0)<>1")
  33. DoctorInfo selectDoctorInfo(@Param("doctorCode") String doctorCode, @Param("openId") String openId);
  34. @Select("select top 1 * from t_covid19_assessment with(nolock) where patient_id=#{patientId} and " +
  35. "datediff(day, date, getdate()) <= 3 order by date desc")
  36. CovidQuestionnaire validCovidAssessment(@Param("patientId") String patientId);
  37. @Select("select rtrim(social_no) from mz_patient_mi with(nolock) where patient_id=#{patientId}")
  38. String selectPatientIdCard(@Param("patientId") String patientId);
  39. @Select("select rtrim(mz_class) from zd_unit_code with(nolock) where code=#{code}")
  40. String selectMzClass(@Param("code") String code);
  41. @Select("select isnull(portrait,'') as portrait,isnull(introduction,'') as introduction " +
  42. "from a_employee_mi with(nolock) where code=#{code}")
  43. DoctorInfo selectPortraitAndIntroduction(@Param("code") String code);
  44. }