PatientDao.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. package thyyxxk.webserver.dao.his.inpatient;
  2. import org.apache.ibatis.annotations.*;
  3. import thyyxxk.webserver.entity.dictionary.CodeName;
  4. import thyyxxk.webserver.entity.inpatient.dismiss.ZyDisYbDiag;
  5. import thyyxxk.webserver.entity.inpatient.patient.*;
  6. import java.util.Date;
  7. import java.util.List;
  8. @Mapper
  9. public interface PatientDao {
  10. @Select("select " +
  11. "RTRIM(a.bed_no) bedNo, " +
  12. "RTRIM(a.inpatient_no) inpatientNo, " +
  13. "a.admiss_times, " +
  14. "RTRIM(a.name) as name, " +
  15. "sex=isnull(a.sex, 9), " +
  16. "mdtrtId=(select b.mdtrt_id from t_si_pat_info b where b.pat_no=a.inpatient_no " +
  17. "and b.times=a.admiss_times and b.ledger_sn=a.times_billed), " +
  18. "injurySerialNo=(select serial_no from t_injury_si_pat_info where pat_no=a.inpatient_no " +
  19. "and times=a.admiss_times and ledger_sn=a.times_billed), " +
  20. "medType=a.med_type, " +
  21. "dismissOrder=(select count(1) from yz_act_order b where b.inpatient_no=a.inpatient_no " +
  22. "and b.admiss_times=a.admiss_times and status_flag > '1' and isnull(group_no,'00')='00' " +
  23. "and order_code in (select order_code from yz_zd_order_item_confirm where item_name in (N'出院',N'死亡')))," +
  24. "orderNoCount = (select count(1) " +
  25. " from yz_act_order c " +
  26. " where a.inpatient_no = c.inpatient_no " +
  27. " and c.admiss_times = a.admiss_times " +
  28. " and c.status_flag = '1' " +
  29. " and c.enter_oper = #{userCode}), " +
  30. " rtrim(refer_physician) refer_physician, " +
  31. " (select rtrim(name) from a_employee_mi where code = refer_physician) as refer_physician_name, " +
  32. " rtrim(consult_physician) consult_physician, " +
  33. " (select rtrim(name) from a_employee_mi where code = consult_physician) as consult_physician_name, " +
  34. " rtrim(dept_director) dept_director, " +
  35. " (select rtrim(name) from a_employee_mi where code = dept_director) as dept_director_name, " +
  36. " total_charge, " +
  37. " balance, " +
  38. " rtrim(admiss_diag_str) as admiss_diag_str, " +
  39. " rtrim(clinic_diag_str) as clinic_diag_str, " +
  40. " responce_type_name = (select rtrim(name) from zy_zd_responce_type where code = responce_type)," +
  41. " admiss_date,zkys," +
  42. " zkys_name =(select rtrim(name) from a_employee_mi where code = zkys) " +
  43. "from zy_actpatient a left join batj_ba2 ba on (a.inpatient_no = ba.zyh and a.admiss_times = ba.zycs) " +
  44. "where a.ward like #{ward} ${sql} " +
  45. "ORDER BY cast(a.bed_no AS int)")
  46. List<Overview> getOverView(@Param("ward") String ward,
  47. @Param("userCode") String userCode,
  48. @Param("sql") String sql);
  49. @Select("<script>" +
  50. "select inpatientNo=rtrim(a.inpatient_no),a.admiss_times,a.med_type,b.social_no,dis_date,consult_physician,dept_director," +
  51. "consult_physician_name = (select name from a_employee_mi where a_employee_mi.code = consult_physician)," +
  52. "dept_director_name = (select name from a_employee_mi where a_employee_mi.code = dept_director)," +
  53. "zkys= (select zkys from batj_ba2 ba where ba.zyh = a.inpatient_no and ba.zycs = a.admiss_times)," +
  54. "mz_no = (select rtrim(mz_no) from a_patient_mi where a_patient_mi.inpatient_no = a.inpatient_no)," +
  55. "zk_ward,zk_ward_name = (select rtrim(name) from zd_unit_code where code=zk_ward), " +
  56. "name=rtrim(a.name),sex=isnull(a.sex, b.sex),act_ipt_days=(datediff(day, admiss_date, isnull(dis_date,getdate()))), " +
  57. "birthDate=(convert(varchar(10), birth_date, 21)),home_tel=rtrim(b.home_tel), " +
  58. "admissPhysician=rtrim(a.admiss_physician),b.psn_cert_type, " +
  59. "insutype=(select top 1 insutype from t_si_pat_info with(nolock) where pat_no=#{inpatientNo} and " +
  60. "times=a.admiss_times order by ledger_sn desc), " +
  61. "admissPhysicianName=rtrim((select name FROM a_employee_mi WHERE code = a.admiss_physician)), " +
  62. "referPhysician=rtrim(a.refer_physician), " +
  63. "referPhysicianName=rtrim((select name FROM a_employee_mi WHERE code = a.refer_physician)), " +
  64. "admissDiagStr=rtrim(isnull(a.admiss_diag_str,'')), " +
  65. "clinicDiagStr=rtrim(isnull(a.clinic_diag_str,'')), " +
  66. "admissWard=rtrim(isnull(a.ward,a.admiss_ward)), " +
  67. "admissWardName=(select rtrim(name) from zd_unit_code where code=a.ward), " +
  68. "admissDept=rtrim(a.admiss_dept), a.matn_type,smallDept=rtrim(a.small_dept), " +
  69. "smallDeptName=rtrim((select name from zd_unit_code where code=small_dept)), " +
  70. "admiss_date,ybRegisterDate=isnull(yb_register_date, admiss_date), " +
  71. "responceType=a.med_type,a.dise_code,a.dise_name, " +
  72. "zkWard=rtrim(a.zk_ward),ward=(a.ward),a.latechb_flag,a.pret_flag,ledgerSn=a.times_billed, " +
  73. "admissStatus=rtrim(a.admiss_status), " +
  74. "dismissOrder=(select count(1) from yz_act_order y where y.inpatient_no=b.inpatient_no " +
  75. "and y.admiss_times=a.admiss_times and status_flag>'1' and isnull(group_no,'00')='00' " +
  76. "and order_code in (select order_code from yz_zd_order_item_confirm where item_name in (N'出院',N'死亡'))), " +
  77. "disDiagStatus=(select RTRIM(dis_diag_status) from zy_dis_diag_yb where inpatient_no=a.inpatient_no " +
  78. "and admiss_times=a.admiss_times and dis_diag_no=1), " +
  79. "operation=rtrim(a.operation),a.zy_serial_no, " +
  80. "bedNo=rtrim(a.bed_no),a.admdvs,a.exp_content, " +
  81. "dutyNurse=(select rtrim(job_nurse) from batj_ba2 t where t.zyh=a.inpatient_no and t.zycs=a.admiss_times), " +
  82. "rtrim(b.country) as country, rtrim(b.nation_code) as nation," +
  83. "rtrim(b.relation_name) as contactName, rtrim(relation_code) as contactRelation, " +
  84. "rtrim(b.relation_street) as contactAddrName, rtrim(relation_tel) as contactPhone, " +
  85. "mdtrtId=(select mdtrt_id from t_si_pat_info where pat_no=a.inpatient_no and times=a.admiss_times and ledger_sn=a.times_billed), " +
  86. "injurySerialNo=(select serial_no from t_injury_si_pat_info where pat_no=a.inpatient_no " +
  87. "and times=a.admiss_times and ledger_sn=a.times_billed), " +
  88. "chargeYb=(select isnull(charge_yb, '0.00') from zy_ledger_file where inpatient_no=a.inpatient_no " +
  89. "and admiss_times=a.admiss_times and ledger_sn=a.times_billed), " +
  90. "totalCharge=(select rtrim(isnull(total_charge, '0.00')) from zy_ledger_file where inpatient_no=a.inpatient_no " +
  91. "and admiss_times=a.admiss_times and ledger_sn=a.times_billed), " +
  92. "isnull(final_control,0) as final_control FROM ${table} a with(nolock), " +
  93. "a_patient_mi b with(nolock) WHERE a.inpatient_no=#{inpatientNo} " +
  94. "<if test=\"times != null and times != 0 \">" +
  95. "and a.admiss_times =#{times} " +
  96. "</if>" +
  97. " AND b.inpatient_no=a.inpatient_no" +
  98. "</script>")
  99. Patient getPatientInfo(@Param("inpatientNo") String inpatientNo, @Param("table") String table, @Param("times") Integer times);
  100. @Select("select parent_code from t_region where code=#{code}")
  101. Integer selectParentRegion(Integer code);
  102. @Select("select dis_diag_no, " +
  103. "rtrim(dis_diag) disDiag, " +
  104. "rtrim(dis_diag_comment) disDiagComment, " +
  105. "dis_diag_status, " +
  106. "opName=(select rtrim(name) from a_employee_mi where code=op_id_code) " +
  107. "from zy_dis_diag_yb where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
  108. List<ZyDisYbDiag> getYibaoDisDiags(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
  109. @Select("select * from zy_dis_diag_yb where inpatient_no=#{patNo} and admiss_times=#{times}")
  110. List<ZyDisYbDiag> getZyDisYbDiags(@Param("patNo") String patNo, @Param("times") Integer times);
  111. @Select("SELECT dis_diag_no, " +
  112. "rtrim(dis_diag) disDiag, " +
  113. "rtrim(dis_diag_comment) disDiagComment, " +
  114. "disDiagStatusName=(select rtrim(name) from zd_dis_diag_status WHERE code=dis_diag_status), " +
  115. "opName=(select rtrim(name) from a_employee_mi where code=op_id_code) " +
  116. "from ba_first_page1 where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
  117. List<ZyDisYbDiag> getBingliDisDiags(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
  118. @Select("select rtrim(inpatient_no) from a_patient_mi where social_no=#{idCard}")
  119. List<String> getInpatientNo(@Param("idCard") String idCard);
  120. @Select("SELECT item_no, inpatient_no, admiss_times, agency, expirestart, file_sfz " +
  121. "FROM zy_xnh_record_sfz WHERE inpatient_no=#{inpatientNo} AND admiss_times=#{admissTimes}")
  122. List<IdCard> getIdCard(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
  123. @Select("select agency, expirestart, sfz_image as fileSfz " +
  124. "from patient_mi_sfz where social_no=#{socialNo}")
  125. List<IdCard> selectIdCard(@Param("socialNo") String socialNo);
  126. @Select("SELECT item_no,inpatient_no,admiss_times,file_xnh AS file_sfz FROM zy_xnh_record " +
  127. "WHERE inpatient_no=#{inpatientNo} AND admiss_times=#{admissTimes}")
  128. List<IdCard> getScanFile(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
  129. @Select("select settle_type from zy_ledger_file where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes} " +
  130. "and ledger_sn=(select isnull(max ( ledger_sn ), min ( ledger_sn )) from zy_ledger_file where " +
  131. "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes})")
  132. Integer getSettleType(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
  133. @Select("select count(id) from zy_retract_yb where inpatientNo=#{inpatientNo} " +
  134. "and admissTimes=#{admissTimes} and requestType=#{requestType}")
  135. Integer getRequestCount(@Param("inpatientNo") String inpatientNo,
  136. @Param("admissTimes") Integer admissTimes,
  137. @Param("requestType") Integer requestType);
  138. @Select("select * from zy_retract_yb where inpatientNo=#{inpatientNo} and " +
  139. "admissTimes=#{admissTimes} and requestType=#{requestType}")
  140. List<ToYbkRequest> getRetractRequests(@Param("inpatientNo") String inpatientNo,
  141. @Param("admissTimes") Integer admissTimes,
  142. @Param("requestType") Integer requestType);
  143. @Insert("insert into zy_retract_yb (inpatientNo, admissTimes, name, sex, responceType, ybType, treatType, " +
  144. "remark, inputId, inputName, inputTimes, statusFlag, requestType) values (#{inpatientNo}, #{admissTimes}, " +
  145. "#{name}, #{sex}, #{responceType}, #{ybType}, #{treatType}, #{remark}, #{inputId}, #{inputName}," +
  146. "#{inputTimes}, 1, #{requestType})")
  147. void submitNewRequest(ToYbkRequest indata);
  148. @Select("select isnull(max ( ledger_sn ), isnull(min ( ledger_sn ), 1)) from zy_ledger_file where " +
  149. "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
  150. Integer getLedgerSn(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
  151. @Update("update zy_actpatient set yb_register_date=#{ybRegisterDate},med_type=#{medType},responce_type=#{responceType}, " +
  152. "admdvs=#{admdvs},refer_physician=#{referPhysician},matn_type=#{matnType},latechb_flag=#{latechbFlag}," +
  153. "pret_flag=#{pretFlag},dise_code=#{diseCode},dise_name=#{diseName},exp_content=#{expContent},name=#{name}, " +
  154. "sex=#{sex} where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
  155. void updateZyActpatient(Patient param);
  156. @Select("select count(1) from batj_ba2 with(nolock) where bah=#{bah} and zycs=#{times}")
  157. int isBatjBa2Exist(@Param("bah") String bah, @Param("times") int times);
  158. @Insert("insert into batj_ba2 (bah, zyh, zycs, job_nurse) values (#{bah}, #{bah}, #{times}, #{dutyNurse})")
  159. void createBatjBa2(@Param("bah") String bah, @Param("times") int times, @Param("dutyNurse") String dutyNurse);
  160. @Update("update batj_ba2 set job_nurse=#{dutyNurse} where zyh=#{bah} and zycs=#{times}")
  161. void updateBatjBa2(@Param("bah") String bah, @Param("times") int times, @Param("dutyNurse") String dutyNurse);
  162. @Update("update a_patient_mi set psn_cert_type=#{psnCertType},social_no=#{socialNo}," +
  163. "country=#{country},nation_code=#{nation},relation_name=#{contactName}," +
  164. "relation_code=#{contactRelation},relation_street=#{contactAddrName},sex=#{sex}, " +
  165. "relation_tel=#{contactPhone},home_tel=#{homeTel} where inpatient_no=#{inpatientNo}")
  166. void updateAPatientMi(Patient patient);
  167. @Select("select * from zy_in_diag_yb where inpatient_no=#{inpatientNo} and admiss_times=#{times} order by diag_no")
  168. List<ZyInYbDiag> getZyInYbDiag(@Param("inpatientNo") String inpatientNo, @Param("times") Integer times);
  169. @Delete("delete from zy_in_diag_yb where inpatient_no=#{inpatientNo} and admiss_times=#{times}")
  170. void deleteOldZyInYbDiag(@Param("inpatientNo") String inpatientNo, @Param("times") Integer times);
  171. @Insert("<script>" +
  172. "insert into zy_in_diag_yb (inpatient_no, admiss_times, diag_no, " +
  173. "icd_code, icd_text, oper_id, op_date, diag_type) values " +
  174. "<foreach collection='list' item='diag' separator=','>" +
  175. "(#{diag.inpatientNo},#{diag.admissTimes},#{diag.diagNo}," +
  176. "#{diag.icdCode},#{diag.icdText},#{operId},#{diag.opDate},#{diag.diagType})" +
  177. "</foreach>" +
  178. "</script>")
  179. void insertNewZyInYbDiag(@Param("operId") String operId, @Param("list") List<ZyInYbDiag> list);
  180. @Insert("<script>" +
  181. "insert into zy_in_diag_yb (inpatient_no, admiss_times, diag_no, " +
  182. "icd_code, icd_text, oper_id, op_date, diag_type) values " +
  183. "<foreach collection='diags' item='diag' separator=','>" +
  184. "(#{inpatientNo},#{admissTimes},#{diag.diagNo},#{diag.icdCode}," +
  185. "#{diag.icdText},#{staffId},getdate(),#{diag.diagType})" +
  186. "</foreach>" +
  187. "</script>")
  188. void insertSiZyInYbDiag(SaveSiZyDiags param);
  189. @Select("select convert (varchar(12),dateadd (day,0,start_time),111) from yz_act_order where " +
  190. "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes} and status_flag > '1' " +
  191. "and isnull(group_no,'00')='00' and order_code in " +
  192. "(select order_code from yz_zd_order_item_confirm where item_name in (N'出院',N'死亡')) ")
  193. String getActOrderDisDate(@Param("inpatientNo") String inpatientNo,
  194. @Param("admissTimes") Integer admissTimes);
  195. @Select("select act_order_no from yz_sequence")
  196. float getActOrderNo();
  197. @Update("update yz_sequence set act_order_no=#{no}")
  198. void updateActorOrderNo(float no);
  199. @Insert("insert into yz_act_order " +
  200. "(act_order_no, inpatient_no, admiss_times, order_code, order_time, frequ_code, enter_time, " +
  201. "enter_oper, start_time, end_time, infant_flag, drug_flag, performance_time, " +
  202. "physician, confirm_time, signer, status_flag, status_time,drug_specification,order_name,discription, " +
  203. "ward_code,dept_code,exec_unit) " +
  204. "values (#{actOrderNo}, #{inpatientNo}, #{admissTimes}, " +
  205. "(select top 1 order_code from yz_zd_order_item_confirm where item_name=N'出院'), " +
  206. "#{dismissOrderDate}, 'ONCE', #{dismissOrderDate},#{staffId}, #{dismissOrderDate}, #{dismissOrderDate}, " +
  207. "0, 0, #{dismissOrderDate}, #{staffId},#{dismissOrderDate}, #{staffId}, 5, #{dismissOrderDate}," +
  208. "'诊疗项目','今日结账出院','0.00 本项目不包含费用'," +
  209. "#{admissWard},#{admissWard},#{admissWard})")
  210. void insertNewDismissActOrder(@Param("actOrderNo") float actOrderNo,
  211. @Param("inpatientNo") String inpatientNo,
  212. @Param("admissTimes") Integer admissTimes,
  213. @Param("dismissOrderDate") Date dismissOrderDate,
  214. @Param("staffId") String staffId,
  215. @Param("admissWard") String admissWard);
  216. @Select("select * from zy_dis_diag_yb where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
  217. List<ZyDisYbDiag> getDisDiags(@Param("inpatientNo") String inpatientNo,
  218. @Param("admissTimes") Integer admissTimes);
  219. @Select("select rtrim(admiss_diag) code,rtrim(admiss_diag_str) name from zy_actpatient where " +
  220. "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
  221. CodeName getAdmissDiag(@Param("inpatientNo") String inpatientNo,
  222. @Param("admissTimes") Integer admissTimes);
  223. @Insert("insert into zy_dis_diag_yb (inpatient_no, admiss_times, dis_diag_no, dis_diag_type, dis_diag, " +
  224. "dis_diag_comment, op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, si_diag_type) " +
  225. "values (#{inpatientNo}, #{admissTimes}, 1, 13, #{code}, #{name}, #{staffId}, getDate(), '普通', 0, 1)")
  226. void insertDisDiag(@Param("inpatientNo") String inpatientNo,
  227. @Param("admissTimes") Integer admissTimes,
  228. @Param("code") String code,
  229. @Param("name") String name,
  230. @Param("staffId") String staffId);
  231. @Insert("<script>" +
  232. "insert into zy_dis_diag_yb (inpatient_no, admiss_times, dis_diag_no, dis_diag_type, dis_diag, " +
  233. "dis_diag_comment, op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, si_diag_type) values " +
  234. "<foreach collection='list' item='diag' separator=','>" +
  235. "(#{diag.inpatientNo},#{diag.admissTimes},#{diag.diagNo}, 13, " +
  236. "#{diag.icdCode},#{diag.icdText},#{staffId},getdate(), '普通', 0, 1)" +
  237. "</foreach>" +
  238. "</script>")
  239. void insertDisDiags(@Param("staffId") String staffId, @Param("list") List<ZyInYbDiag> list);
  240. @Update("update zy_detail_charge set charge_date=#{newDate} where inpatient_no=#{zyh} " +
  241. "and admiss_times=#{times} and CONVERT(varchar(20), charge_date, 20) <= #{admdate}")
  242. void correctFeeChargeTimeBeforeAdmiss(@Param("zyh") String zyh,
  243. @Param("times") int times,
  244. @Param("admdate") Date admdate,
  245. @Param("newDate") Date newDate);
  246. @Select("select start_time from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
  247. "and status_flag > '1' and isnull(group_no, '00')='00' and order_code in " +
  248. "(select order_code from yz_zd_order_item_confirm where item_name in (N'出院',N'死亡'))")
  249. Date selectActOrderDisDate(@Param("patNo") String patNo, @Param("times") Integer times);
  250. @Update("update zy_detail_charge set charge_date=#{disdate} where inpatient_no=#{zyh} " +
  251. "and admiss_times=#{times} and charge_date>#{disdate}")
  252. void correctFeeChargeTimeAfterDismiss(@Param("zyh") String zyh,
  253. @Param("times") int times,
  254. @Param("disdate") Date disdate);
  255. @Update("update zy_ledger_file set deposit=(select isnull(sum(depo_amount),0) from zy_deposit_file f with(nolock) " +
  256. "where f.inpatient_no=#{zyh} and f.admiss_times=#{times} and f.ledger_sn=#{ledger} and f.status in ('1','2') ) " +
  257. "where inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger} and account_date is null")
  258. void recountDeposit(@Param("zyh") String zyh,
  259. @Param("times") int times,
  260. @Param("ledger") int ledger);
  261. @Update("execute zy_receive_drug #{zyh},#{times},#{zyh},#{infant} ")
  262. void zyReceiveDrug(@Param("zyh") String zyh,
  263. @Param("times") int times,
  264. @Param("infant") int infant);
  265. @Update("execute zy_receive_one #{zyh},#{times},#{zyh},#{infant} ")
  266. void zyReceiveOne(@Param("zyh") String zyh,
  267. @Param("times") int times,
  268. @Param("infant") int infant);
  269. @Update("execute dbo.zy_cngl_fyjs_list_yz #{zyh},#{times} ")
  270. void zyCnglFyjsListYz(@Param("zyh") String zyh,
  271. @Param("times") int times);
  272. @Update("update zy_detail_charge set charge_status='2' where " +
  273. "inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger} ")
  274. void updateZyDetailCharge(@Param("zyh") String zyh,
  275. @Param("times") int times,
  276. @Param("ledger") int ledger);
  277. @Update("execute zy_calc_detail_again_new #{zyh},#{times},#{ledger},1,1")
  278. void zyCalcDetailAgainNew(@Param("zyh") String zyh,
  279. @Param("times") int times,
  280. @Param("ledger") int ledger);
  281. @Update("update zy_ledger_file set balance=(deposit+isnull(charge_yb,0)-total_charge) where " +
  282. "inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
  283. void updateBalance(@Param("zyh") String zyh,
  284. @Param("times") int times,
  285. @Param("ledger") int ledger);
  286. @Select("select balance from zy_ledger_file where inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
  287. String selectLedgerBalance(@Param("zyh") String zyh,
  288. @Param("times") int times,
  289. @Param("ledger") int ledger);
  290. @Update("update zy_actpatient set balance=#{balance} where inpatient_no=#{zyh}")
  291. void updateZyActPatientBalance(@Param("zyh") String zyh, @Param("balance") String balance);
  292. @Select("select chronic_disease_type " +
  293. "from crm_patient_mi " +
  294. "where social_no = #{socialNo} ")
  295. String getCrmBySocialNo(String socialNo);
  296. @Select("select name " +
  297. "from crm_zd_visit_type " +
  298. "where code in (${typeList})")
  299. List<String> getCrmTypeName(String typeList);
  300. }