PatientDao.java 23 KB

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