SheetSearchDao.java 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package thyyxxk.webserver.dao.his.casefrontsheet;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.apache.ibatis.annotations.Select;
  5. import thyyxxk.webserver.entity.casefrontsheet.StatisticsBySeason;
  6. import thyyxxk.webserver.entity.dictionary.CodeName;
  7. import java.util.List;
  8. @Mapper
  9. public interface SheetSearchDao {
  10. @Select("select top 10 rtrim(code) as code, rtrim(name) as name from " +
  11. "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',* from " +
  12. "zd_icd9_cm3 with(nolock) where ${method} like #{content} and del_flag=0) a " +
  13. "where a.[Number]>10*(#{page}-1)")
  14. List<CodeName> searchSurgery(@Param("method") String method, @Param("content") String content, @Param("page") int page);
  15. @Select("select top 10 rtrim(code) as code, rtrim(name) as name from " +
  16. "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',* from " +
  17. "zd_icd_code_new with(nolock) where ${method} like #{content} and del_flag=0 ) a " +
  18. "where a.[Number]>10*(#{page}-1) order by weight desc")
  19. List<CodeName> searchClinicdiag(@Param("method") String method, @Param("content") String content, @Param("page") int page);
  20. @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
  21. "(SELECT ROW_NUMBER() OVER(order by code) AS 'Number', * " +
  22. "from zd_icd_m_code with(nolock) where ${method} like #{content}) a " +
  23. "where a.[Number]>10*(#{page})")
  24. List<CodeName> searchPathologicDiag(@Param("method") String method, @Param("content") String content, @Param("page") int page);
  25. @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
  26. "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number', * " +
  27. "from zd_district_code with(nolock) where ${method} like #{content}) a " +
  28. "where a.[Number]>10*(#{page})")
  29. List<CodeName> searchBirthPlace(@Param("method") String method, @Param("content") String content, @Param("page") int page);
  30. @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
  31. "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number', * " +
  32. "from zd_icd_code_new with(nolock) where PATINDEX('%[V-Y]%',code)=1 and ${method} like #{content}) a " +
  33. "where a.[Number]>10*(#{page}) order by weight desc")
  34. List<CodeName> searchHurtReason(@Param("method") String method, @Param("content") String content, @Param("page") int page);
  35. @Select("select top 10 rtrim(code) code, rtrim(name) name, rtrim(yb_code) ybCode, " +
  36. "deptName=(select rtrim(t.name) from zd_unit_code t where t.code=dept_code) from " +
  37. "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number', * " +
  38. "from a_employee_mi with(nolock) where isnull(del_flag,0)=0 and ${method} like #{content}) a " +
  39. "where a.[Number]>10*(#{page})")
  40. List<CodeName> searchEmployee(@Param("method") String method, @Param("content") String content, @Param("page") int page);
  41. @Select("select rtrim(dis_diag) from zy_dis_diag_yb where inpatient_no=#{bah} and admiss_times=#{times} and dis_diag_no=1")
  42. String selectMainMedinsDiag(@Param("bah") String bah, @Param("times") int times);
  43. @Select("select yb_code from zd_icd_code_new where code=#{code} and del_flag=0")
  44. String selectMedinsDiagReflect(@Param("code") String code);
  45. @Select("select top 1 disefamily_code from t_si_disefamily_diagnose with(nolock) where dise_code=#{code} or disefamily_code=#{code}")
  46. String selectDisefamilyCode(@Param("code") String code);
  47. @Select("select oprn_code as code, oprn_name as name, oprn_grade as ssfz from " +
  48. "t_si_operation_disefamily with(nolock) where disefamily_code=#{code} order by oprn_grade desc")
  49. List<CodeName> selectOperationDisefamilies(@Param("code") String code);
  50. @Select("select " +
  51. "rtrim(a.inpatient_no) as patNo,hospId='H43010500370',hospName='长沙泰和医院', " +
  52. "rtrim(isnull(b.occupation_code,'90')) as occupation,country='CHN', " +
  53. "marriage=case when b.marry_code='1' then '10' when b.marry_code='2' then '20' when b.marry_code='3' then '40' " +
  54. "when b.marry_code='4' then 30 when b.marry_code='9' then '90' end, " +
  55. "a.admiss_times as times,(rtrim(a.inpatient_no)+'-'+cast(admiss_times as varchar)) as bah, " +
  56. "rtrim(a.name) as name,a.sex AS gender, " +
  57. "birthdate=convert(varchar(8),b.birth_date,112),age=(datediff(year,b.birth_date,getdate())), " +
  58. "b.social_no,admissDate=convert(varchar(8),a.admiss_date,112),disDate=convert(varchar(8),a.dis_date,112), " +
  59. "inHospDays=datediff(day,a.admiss_date,a.dis_date), " +
  60. "disdiagName=isnull((select rtrim(dis_diag_comment) from zy_dis_diag_yb tmp where tmp.inpatient_no=a.inpatient_no and " +
  61. "tmp.admiss_times=a.admiss_times and tmp.dis_diag_no=1), " +
  62. "(select rtrim(dis_diag_comment) from ba_first_page1 tmp where tmp.inpatient_no=a.inpatient_no and " +
  63. "tmp.admiss_times=a.admiss_times and tmp.dis_diag_no=1)), " +
  64. "disdiagCode=isnull((select rtrim(dis_diag) from zy_dis_diag_yb tmp where tmp.inpatient_no=a.inpatient_no and " +
  65. "tmp.admiss_times=a.admiss_times and tmp.dis_diag_no=1), " +
  66. "(select rtrim(dis_diag) from ba_first_page1 tmp where tmp.inpatient_no=a.inpatient_no and " +
  67. "tmp.admiss_times=a.admiss_times and tmp.dis_diag_no=1)), " +
  68. "dismissWay=(select isnull(lyfs,1) from batj_ba2 tmp where tmp.zyh=a.inpatient_no and tmp.zycs=a.admiss_times), " +
  69. "a.total_charge " +
  70. "from zy_inactpatient a, a_patient_mi b " +
  71. "where responce_type in ('03','09','04','ad') and " +
  72. "dis_date>=#{begntime} and " +
  73. "dis_date<=#{endtime} and " +
  74. "a.inpatient_no=b.inpatient_no")
  75. List<StatisticsBySeason> selectStatisticsBySeason(@Param("begntime") String begntime,
  76. @Param("endtime") String endtime);
  77. @Select("select count(1) from zd_icd_code_new where yb_code=#{code} and del_flag=0")
  78. int medinsDiagExist(@Param("code") String code);
  79. @Select("select rtrim(dis_diag) code, rtrim(dis_diag_comment) name from zy_dis_diag_yb where " +
  80. "inpatient_no=#{patNo} and admiss_times=#{times} and dis_diag_no=1")
  81. CodeName selectMainDisDiag(@Param("patNo") String patNo, @Param("times") String times);
  82. @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name " +
  83. "from zd_icd_code_new where yb_code like '${code}%' and del_flag=0 ")
  84. List<CodeName> selectMedinsDiags(@Param("code") String code);
  85. }