YiZhuLuRuDao.java 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520
  1. package thyyxxk.webserver.dao.his.zhuyuanyisheng;
  2. import com.baomidou.mybatisplus.core.conditions.Wrapper;
  3. import com.baomidou.mybatisplus.core.toolkit.Constants;
  4. import org.apache.ibatis.annotations.*;
  5. import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
  6. import thyyxxk.webserver.entity.datamodify.YzActOrder;
  7. import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
  8. import thyyxxk.webserver.entity.inpatient.patient.Overview;
  9. import thyyxxk.webserver.entity.inpatient.patient.Patient;
  10. import thyyxxk.webserver.entity.zhuyuanyisheng.DoctorSOrderFee;
  11. import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;
  12. import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
  13. import java.math.BigDecimal;
  14. import java.util.Date;
  15. import java.util.List;
  16. import java.util.Set;
  17. import java.util.stream.Stream;
  18. /**
  19. * <p>
  20. * 描述: 医嘱录入dao
  21. * </p>
  22. *
  23. * @author xc
  24. * @date 2022-01-04 17:00
  25. */
  26. @Mapper
  27. public interface YiZhuLuRuDao {
  28. @Select("SELECT " +
  29. "RTRIM(a.bed_no) bedNo, " +
  30. "RTRIM(a.inpatient_no) inpatientNo, " +
  31. "a.admiss_times, " +
  32. "RTRIM(a.name) as name, " +
  33. "sex=isnull(a.sex, 9), " +
  34. "mdtrtId=(select b.mdtrt_id from t_si_pat_info b where b.pat_no=a.inpatient_no " +
  35. "and b.times=a.admiss_times and b.ledger_sn=a.times_billed), " +
  36. "injurySerialNo=(select serial_no from t_injury_si_pat_info where pat_no=a.inpatient_no " +
  37. "and times=a.admiss_times and ledger_sn=a.times_billed), " +
  38. "medType=a.med_type, " +
  39. "dismissOrder=(select count(1) from yz_act_order b where b.inpatient_no=a.inpatient_no " +
  40. "and b.admiss_times=a.admiss_times and status_flag > '1' and isnull(group_no,'00')='00' " +
  41. "and order_code in ('06026','06053','05973'))," +
  42. "orderNoCount = (select count(1) " +
  43. " from yz_act_order c " +
  44. " where a.inpatient_no = c.inpatient_no " +
  45. " and c.admiss_times = a.admiss_times " +
  46. " and c.status_flag = '1' " +
  47. " and c.enter_oper = #{userCode}), " +
  48. " refer_physician, " +
  49. " (select name from a_employee_mi where code = refer_physician) as refer_physician_name, " +
  50. " consult_physician, " +
  51. " (select name from a_employee_mi where code = refer_physician) as consult_physician_name, " +
  52. " dept_director, " +
  53. " (select name from a_employee_mi where code = refer_physician) as dept_director_name " +
  54. "FROM zy_actpatient a " +
  55. "where refer_physician = #{code} " +
  56. "ORDER BY cast(bed_no AS int) ")
  57. List<Patient> getMyPatient(String code);
  58. @Select("select isnull(balance,0) balance, " +
  59. " total_charge, " +
  60. " charge1, " +
  61. " charge2, " +
  62. " charge3, " +
  63. " charge4, " +
  64. " charge5, " +
  65. " charge6, " +
  66. " charge7, " +
  67. " charge8, " +
  68. " charge9, " +
  69. " charge10, " +
  70. " charge11, " +
  71. " charge12, " +
  72. " charge13, " +
  73. " charge14, " +
  74. " charge15, " +
  75. " charge16, " +
  76. " charge17, " +
  77. " charge18, " +
  78. " charge19, " +
  79. " charge20, " +
  80. " charge21, " +
  81. " charge22, " +
  82. " charge23, " +
  83. " charge24, " +
  84. " charge25, " +
  85. " charge26, " +
  86. " charge27, " +
  87. " charge28, " +
  88. " charge29, " +
  89. " charge30, " +
  90. " yp = (isnull(charge1 + charge2 + charge28, 0))," +
  91. " jyjc = (isnull(charge8 + charge9 + charge11 + charge18 + charge13, 0))," +
  92. " isnull(charge_yb, 0) charge_yb " +
  93. "from zy_ledger_file with (NOLOCK) " +
  94. "where inpatient_no = #{inpatientNo} " +
  95. " and admiss_times = #{admissTimes} " +
  96. " and ledger_sn = #{ledgerSn} ")
  97. HuanZheFeiYong feiYongXinXi(@Param("inpatientNo") String inpatientNo,
  98. @Param("admissTimes") Integer admissTimes,
  99. @Param("ledgerSn") Integer ledgerSn);
  100. @Select("select distinct rtrim(order_name) code, rtrim(order_name) name " +
  101. "from yz_act_order with (NOLOCK) " +
  102. "where inpatient_no = #{inpatientNo} " +
  103. " and admiss_times = #{admissTimes} " +
  104. " and (order_name like #{orderName} or order_code like #{orderName})")
  105. List<GetDropdownBox> huoQuYiZhuMingZi(@Param("inpatientNo") String inpatientNo,
  106. @Param("admissTimes") Integer admissTimes,
  107. @Param("orderName") String orderName);
  108. @Select("select rtrim(frequ_code) code, " +
  109. " name = (select rtrim(comm) from yz_order_frequency where frequ_code = code) " +
  110. "from yz_act_order with (NOLOCK) " +
  111. "where inpatient_no = #{patNo} " +
  112. " and admiss_times = #{times} " +
  113. "group by frequ_code")
  114. List<GetDropdownBox> huoQuGeRenPinLv(@Param("patNo") String patNo,
  115. @Param("times") Integer times);
  116. @Select("select a.act_order_no, " +
  117. " cast(cast(a.act_order_no as decimal) as varchar) id, " +
  118. " order_code, " +
  119. " order_name, " +
  120. " rtrim(frequ_code) frequ_code, " +
  121. " frequ_code_name = (select rtrim(comm) " +
  122. " from yz_order_frequency " +
  123. " where code = frequ_code), " +
  124. " instruction, " +
  125. " discription, " +
  126. " infant_flag, " +
  127. " order_time, " +
  128. " physician, " +
  129. " start_time, " +
  130. " drug_specification, " +
  131. " drug_quan, " +
  132. " drug_quan_name = (select name " +
  133. " from yp_zd_unit with (NOLOCK) " +
  134. " where code = mini_unit), " +
  135. " supply_code, " +
  136. " supply_code_name = (select supply_name " +
  137. " from yz_supply_type with (NOLOCK) " +
  138. " where yz_supply_type.supply_code = a.supply_code), " +
  139. " a.inpatient_no, " +
  140. " a.admiss_times, " +
  141. " drug_flag, " +
  142. " enter_oper," +
  143. "enter_oper_name = (select top (1) rtrim(name) " +
  144. " from a_employee_mi with (NOLOCK) " +
  145. " where code = enter_oper) /* 录入人 */, " +
  146. " enter_time, " +
  147. " mini_unit, " +
  148. " drug_weight, " +
  149. " drug_weight_unit, " +
  150. " rtrim(status_flag) status_flag, " +
  151. " status_time, " +
  152. " parent_no," +
  153. " parent_no_name = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no)," +
  154. " self_buy, " +
  155. " dose, " +
  156. " dose_unit, " +
  157. " dose_unit_name = (select name " +
  158. " from yp_zd_unit with (NOLOCK) " +
  159. " where dose_unit = code), " +
  160. " drug_occ, " +
  161. " drug_volume, " +
  162. " drug_vol_unit, " +
  163. " exclu_back_time, " +
  164. " exclu_act_order_no, " +
  165. " pay_self, " +
  166. " serial, " +
  167. " group_no, " +
  168. " signer, " +
  169. " cl_code, " +
  170. " doctor_flag, " +
  171. " emergency_flag, " +
  172. " exclu_type='', " +
  173. " end_time_b=end_time, " +
  174. " exec_unit, " +
  175. " dept_code, " +
  176. " ward_code, " +
  177. " new_flag='0', " +
  178. " order_no_pattern=0, " +
  179. " suprice_flag='', " +
  180. " self_flag ='', " +
  181. " pack_size=0.0, " +
  182. " parent_no_c= -1000, " +
  183. " reg_flag, " +
  184. " parent_flag='', " +
  185. " yb_self_flag, " +
  186. " kf_flag, " +
  187. " refer_physician, " +
  188. " consult_physician, " +
  189. " physician_name = (select top (1) rtrim(name) " +
  190. " from a_employee_mi with (NOLOCK) " +
  191. " where code = physician) /* 开这个医嘱的医生 */, " +
  192. " exec_unit_name = (select top (1) rtrim(name) " +
  193. " from zd_unit_code with (NOLOCK) " +
  194. " where code = exec_unit), " +
  195. " /*管床医生*/ " +
  196. " refer_physician_name = (select rtrim(name) " +
  197. " from a_employee_mi with (NOLOCK) " +
  198. " where code = refer_physician), " +
  199. " group_no_name = (select rtrim(group_name) " +
  200. " from yp_zd_group_name with (NOLOCK) " +
  201. " where a.group_no = group_no), " +
  202. " signer_name = (select top (1) rtrim(name) " +
  203. " from a_employee_mi with (NOLOCK) " +
  204. " where code = signer) /*确认人*/, " +
  205. " confirm_time /*确认时间*/, " +
  206. " modifier, " +
  207. " modifier_name = (select top (1) rtrim(name) " +
  208. " from a_employee_mi with (NOLOCK) " +
  209. " where code = modifier) /*停止人*/, " +
  210. " end_time /*停止时间*/," +
  211. " b.new_ward as zkWardCode, " +
  212. " b.new_dept as zkDeptCode," +
  213. " kss.yyfs , kss.ssqk,kss.yysj " +
  214. "from yz_act_order a left join " +
  215. "zy_order_zk b on (a.act_order_no = b.act_order_no) left join " +
  216. "yz_act_record_kss kss on (a.act_order_no = kss.act_order_no) " +
  217. " ${ew.customSqlSegment} ")
  218. List<XinZhenYzActOrder> huoQuYiZhuShuJu(@Param(Constants.WRAPPER) Wrapper<?> wq);
  219. @Select("select act_order_no, " +
  220. "rtrim(status_flag) status_flag," +
  221. "frequ_code," +
  222. "enter_oper," +
  223. "inpatient_no " +
  224. "from yz_act_order " +
  225. "${ew.customSqlSegment}")
  226. List<XinZhenYzActOrder> getOrdersToDelete(@Param(Constants.WRAPPER) Wrapper<?> wq);
  227. @Delete("delete yz_act_order ${ew.customSqlSegment} ")
  228. void deleteMultipleOrders(@Param(Constants.WRAPPER) Wrapper<?> wq);
  229. @Update("<script>" +
  230. "update yz_act_order " +
  231. "set parent_no = null " +
  232. "where inpatient_no = #{patNo} " +
  233. " and admiss_times = #{times} " +
  234. " and parent_no in " +
  235. "<foreach collection='list' item='item' open='(' close=')' separator=','>" +
  236. "#{item}" +
  237. "</foreach>" +
  238. "</script>")
  239. void deleteParentChildRelationship(String patNo,
  240. Integer times,
  241. List<BigDecimal> list);
  242. @Select("<script>" +
  243. "<foreach collection=\"list\" item=\"item\" index=\"index\" separator=\";\">" +
  244. "update yz_act_order " +
  245. "set modifier = #{userCode}, " +
  246. " end_time = #{item.endTime} " +
  247. "where inpatient_no = #{patNo} " +
  248. " and admiss_times = #{times}" +
  249. " and (act_order_no = #{item.actOrderNo} or parent_no = #{item.actOrderNo}) " +
  250. " and end_time is null" +
  251. "</foreach>" +
  252. "</script>")
  253. void setStopTime(List<XinZhenYzActOrder> list,
  254. String userCode,
  255. String patNo,
  256. Integer times);
  257. @Select("SELECT distinct rtrim(a.code) + rtrim(serial) as id, " +
  258. " py_code=a.py_code, " +
  259. " d_code =a.d_code, " +
  260. " order_code =a.code, " +
  261. " order_name =a.name, " +
  262. " drug_specification=a.specification, " +
  263. " order_type =case a.infusion_flag " +
  264. " when '1' then 'i' " +
  265. " else " +
  266. " (case " +
  267. " when a.code >= '30000' and a.code < '50000' then 'z' " +
  268. " else 'd' end) end, " +
  269. " parent_code=null, " +
  270. " exclu_group_type=null, " +
  271. " discription=case a.infusion_flag " +
  272. " when '1' then '大输液' " +
  273. " else (case " +
  274. " when a.code >= '30000' and a.code < '50000' then '中药' " +
  275. " else '西药 ' end) end + convert(char(10), a.pack_retprice) + '元' + '(医保类别:' + " +
  276. " ltrim(rtrim(yb_flag_new)) + ';报销比例:' + ltrim(rtrim(yb_bl_new)) + ';医保说明:' + " +
  277. " ltrim(rtrim(yb_comment_new)) + ')', " +
  278. " serial=a.serial, " +
  279. " group_no=a.group_no, " +
  280. " infusion_flag=a.infusion_flag, " +
  281. " drug_flag =a.drug_flag, " +
  282. " group_name =a.group_name, " +
  283. " pack_size=a.pack_size, " +
  284. " order_class='Y', " +
  285. " spec_pack=a.spec_pack, " +
  286. " jsy_flag =a.jsy_flag, " +
  287. " xnh_flag, " +
  288. " yb_comment, " +
  289. " dosage = a.dosage, " +
  290. " yb_type, " +
  291. " yb_flag_new," +
  292. " father_flag, " +
  293. " manu_name=(select name from yp_zd_manufactory with (NOLOCK) where code *= a.manu_code), " +
  294. " stock_amount=a.stock_amount, " +
  295. " national_code," +
  296. " national_name " +
  297. "FROM view_yp_zd_dict_base_yf a with (NOLOCK) " +
  298. "WHERE isnull(a.visible_flag_zy, '') <> '1' " +
  299. " and (a.py_code like #{code} or a.name like #{code} or code like #{code}) " +
  300. " and group_no = #{groupNo} ")
  301. List<YiZhuMingChen> yiZhuYaoPing(@Param("code") String code,
  302. @Param("groupNo") String groupNo);
  303. @Select("select act_order_no, " +
  304. "rtrim(status_flag) as status_flag," +
  305. "rtrim(frequ_code) as frequ_code," +
  306. "enter_oper," +
  307. "inpatient_no," +
  308. "admiss_times," +
  309. "enter_oper," +
  310. "order_time," +
  311. "rtrim(serial) as serial," +
  312. "start_time," +
  313. "ward_code " +
  314. "from yz_act_order " +
  315. "where act_order_no = #{orderNo} ")
  316. XinZhenYzActOrder getActOrderNoOne(String orderNo);
  317. @Select("select cast(cast(act_order_no as decimal) as varchar) " +
  318. "from yz_act_order " +
  319. "where parent_no = #{orderNo}")
  320. List<String> getParentChildOrders(String orderNo);
  321. @Select("<script>" +
  322. "select * " +
  323. "from zy_detail_charge " +
  324. "where inpatient_no = #{patNo} " +
  325. " and admiss_times = #{times} " +
  326. " and ori_detail_sn is null" +
  327. " and charge_fee > 0 " +
  328. " and order_no in " +
  329. "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
  330. " #{item}" +
  331. "</foreach>" +
  332. "</script>")
  333. List<ZyDetailCharge> getExpenseData(String patNo,
  334. Integer times,
  335. List<String> list);
  336. @Update("<script>" +
  337. "update zy_detail_charge " +
  338. "set ori_detail_sn = -1 " +
  339. "where inpatient_no = #{patNo} " +
  340. " and admiss_times = #{times} " +
  341. " and ori_detail_sn is null " +
  342. " and charge_fee > 0 " +
  343. " and order_no in " +
  344. "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
  345. " #{item}" +
  346. "</foreach>" +
  347. "</script>")
  348. void updateItemFlag(String patNo,
  349. Integer times,
  350. List<String> list);
  351. @Update("update yz_act_order " +
  352. "set status_flag = 6, " +
  353. " end_time = getdate(), " +
  354. " modifier = #{userCode}, " +
  355. " instruction = #{reasonForCancellation} " +
  356. "where act_order_no = #{orderNo}")
  357. void updateVoidedOrders(String orderNo,
  358. String userCode,
  359. String reasonForCancellation);
  360. @Update("update yz_act_order " +
  361. "set status_flag = 6, " +
  362. " end_time = getdate(), " +
  363. " modifier = #{userCode}, " +
  364. " instruction = #{reasonForCancellation} " +
  365. "where parent_no = #{orderNo}")
  366. void updateChildOrders(String orderNo,
  367. String userCode,
  368. String reasonForCancellation);
  369. /**
  370. * 获取医生下面的病区
  371. *
  372. * @param deptCode 科室编码
  373. * @return
  374. */
  375. @Select("select dept " +
  376. "from zd_dept_all " +
  377. "where small_dept = #{deptCode} " +
  378. " and dept is not null")
  379. List<String> getTheDoctorSDepartment(String deptCode);
  380. /**
  381. * 获取已经确认收费的医嘱
  382. *
  383. * @param orderNo 医嘱号
  384. * @return
  385. */
  386. @Select("select count(*) " +
  387. "from yz_zy_patient_fee " +
  388. "where " +
  389. "inpatient_no = #{patNo} and " +
  390. "admiss_times = #{times} and " +
  391. "act_order_no = #{orderNo} and " +
  392. "charge_status = '1'")
  393. Integer getADoctorSOrderWithADefiniteFee(String patNo,
  394. Integer times,
  395. String orderNo);
  396. @Select("select count(*) " +
  397. "from zy_detail_charge " +
  398. "where inpatient_no = '' " +
  399. " and admiss_times = 1 " +
  400. " and order_no = ''" +
  401. " and ori_detail_sn is null" +
  402. " and charge_fee > 0 ")
  403. Integer getDetailChargeFee(String patNo,
  404. Integer times,
  405. String orderNo);
  406. @Update("UPDATE " +
  407. " yz_zy_patient_fee " +
  408. "SET charge_status = '2', " +
  409. " op_id = #{userid}, " +
  410. " op_date = GETDATE() " +
  411. "WHERE act_order_no = #{orderNo} " +
  412. " AND inpatient_no = #{patNo} " +
  413. " AND admiss_times = #{times} ")
  414. void cancelMedicalTechnologyAssuranceFee(String userid,
  415. String orderNo,
  416. String patNo,
  417. Integer times);
  418. /**
  419. * 获取,有未确认和未执行的医嘱
  420. *
  421. * @param patNo 住院号
  422. * @param times 住院次数
  423. * @param orderNo 医嘱号
  424. * @return 数据
  425. */
  426. @Select("select count(1) " +
  427. "from yz_act_order " +
  428. "where inpatient_no = #{patNo} " +
  429. " and admiss_times = #{times} " +
  430. " and status_flag in (1, 2) " +
  431. " and act_order_no <> #{orderNo}")
  432. Integer thereAreUnexecutedOrders(String patNo,
  433. Integer times,
  434. BigDecimal orderNo);
  435. @Update("update yz_act_order " +
  436. "set modifier = #{userCode}, " +
  437. " end_time = #{date} " +
  438. "where inpatient_no = #{patNo} " +
  439. " and admiss_times = #{times}" +
  440. " and frequ_code != 'ONCE' " +
  441. " AND status_flag IN (3, 4, 5) " +
  442. " and isnull(end_time, dateadd(day, 1, #{date})) >= #{date} ")
  443. void stopOrder(String patNo,
  444. Integer times,
  445. Date date,
  446. String userCode);
  447. @Update("<script>" +
  448. "<foreach collection='list' item='item' separator=';'>" +
  449. "update yz_act_order " +
  450. "set confirm_time =getdate(), " +
  451. " signer = #{userCode}, " +
  452. " status_time =getdate(), " +
  453. " status_flag ='2' " +
  454. "where inpatient_no = #{patNo} " +
  455. " and admiss_times = #{times} " +
  456. " and act_order_no = #{item}" +
  457. "</foreach>" +
  458. "</script>")
  459. void confirmOrders(List<BigDecimal> list,
  460. String userCode,
  461. String patNo,
  462. Integer times);
  463. @Delete("delete yz_act_record_kss where act_order_no =#{orderNo}; " +
  464. "delete zy_order_zk where act_order_no =#{orderNo};" +
  465. "delete op_record where inpatient_no = #{patNo} and act_order_no =#{orderNo};" +
  466. "delete ysh_yj_req where inpatient_no =#{patNo} and act_order_no =#{orderNo};" +
  467. "DELETE FROM yz_act_order WHERE act_order_no = #{orderNo}; ")
  468. void toDeleteAnOrder(String orderNo, String patNo);
  469. @Update("UPDATE yz_act_order SET parent_no = NULL WHERE parent_no = #{orderNo} ")
  470. void deleteGroup(String orderNo);
  471. @Delete("delete yz_act_order where " +
  472. "act_order_no = #{orderNo} and inpatient_no = #{patNo} and admiss_times = #{times}")
  473. void deleteOrderNo(String orderNo,
  474. String patNo,
  475. Integer times);
  476. @Insert("INSERT INTO yz_act_order (order_code, order_name, frequ_code, instruction, discription, infant_flag, order_time, " +
  477. " /*录入人*/physician, start_time, drug_specification, drug_quan, supply_code, act_order_no, inpatient_no, " +
  478. " admiss_times, drug_flag/*药品中找这个是 药品的类型 a i d*/, enter_oper, /*录入时间*/ " +
  479. " enter_time, " +
  480. " mini_unit /*药品中找 最小包装规格*/, " +
  481. " drug_weight/*药品的重量*/, drug_weight_unit/*药品重量单位*/, " +
  482. " status_flag/*1*/, self_buy, dose, dose_unit, drug_occ, drug_volume/*药品中的 volum 找*/, " +
  483. " drug_vol_unit/* 药品中的 vol_unit */, pay_self/*0*/, " +
  484. " serial/*前端传*/, group_no/*药房 */, doctor_flag/*写死为 1*/, exec_unit, dept_code/* 在院病人表中的 dept */, " +
  485. " ward_code /* 在院病人表中的 zk_ward*/, " +
  486. " reg_flag/* 0 */, " +
  487. " yb_self_flag/*医保自费标志*/, emergency_flag, " +
  488. " kf_flag /*饭前饭后*/, parent_no, refer_physician/*患者的管床医生*/, end_time) " +
  489. "values (#{pa.orderCode}, #{pa.orderName}, #{pa.frequCode}, #{pa.instruction}, #{pa.discription}, #{patInfo.infantFlag}, " +
  490. " #{pa.orderTime}, #{userCode}, " +
  491. " #{pa.startTime}, #{pa.drugSpecification}, #{pa.drugQuan,jdbcType=REAL}, #{pa.supplyCode}, #{pa.actOrderNo,jdbcType=REAL}, #{patInfo.inpatientNo}, " +
  492. " #{patInfo.admissTimes}, #{pa.drugFlag}, #{userCode}, getdate(), " +
  493. " #{pa.miniUnit}, #{pa.drugWeight,jdbcType = REAL}, #{pa.drugWeightUnit,jdbcType=REAL}, '1', #{pa.selfBuy}, " +
  494. " #{pa.dose ,jdbcType = REAL}, #{pa.doseUnit}, #{pa.drugOcc ,jdbcType = REAL}, " +
  495. " #{pa.drugVolume,jdbcType=REAL}, #{pa.drugVolUnit}, '0', #{pa.serial}, #{pa.groupNo}, '1', #{pa.execUnit}, " +
  496. " #{patInfo.deptCode}, #{patInfo.deptCode}, '0', #{pa.ybSelfFlag}, #{pa.emergencyFlag}, " +
  497. " #{pa.kfFlag}, #{pa.parentNo,jdbcType=REAL}, #{patInfo.referPhysician}, #{pa.endTime})")
  498. void insertEntryOrder(XinZhenYiZhu patInfo, XinZhenYzActOrder pa, String userCode);
  499. @Select("SELECT rtrim(a.order_code) + '00' as id," +
  500. "a.py_code, " +
  501. " a.d_code, " +
  502. " a.order_code , " +
  503. " rtrim(a.order_name) order_name, " +
  504. " drug_specification='诊疗项目', " +
  505. " order_type = isnull(operation,'o') , " +
  506. " a.parent_code , " +
  507. " a.exclu_group_type, " +
  508. " discription=a.discription + ' ' + a.yb_comment, " +
  509. " serial ='00', " +
  510. " group_no='00', " +
  511. " infusion_flag='', " +
  512. " drug_flag ='', " +
  513. " group_name ='', " +
  514. " pack_size=1, " +
  515. " order_class=a.order_class, " +
  516. " spec_pack='', " +
  517. " jsy_flag ='', " +
  518. " xnh_flag='', " +
  519. " yb_comment =null, " +
  520. " dosage='', " +
  521. " yb_type='', " +
  522. " father_flag='0', " +
  523. " manu_name='', " +
  524. " stock_amount=0 " +
  525. "FROM yz_order_item a with (NOLOCK) " +
  526. "WHERE isnull(a.del_flag, '') <> '1' " +
  527. " and (py_code like #{code} or order_name like #{code} or order_code like #{code}) " +
  528. " and order_code not in (select zy_order_code from jc_zd_item) " +
  529. " and isnull(exec_dept, '') <> '2010000' ")
  530. List<YiZhuMingChen> yiZhuXiangMu(String code);
  531. @Select("SELECT a.py_code, " +
  532. " a.d_code, " +
  533. " a.pattern_code as order_code, " +
  534. " a.pattern_name as order_name, " +
  535. " specification=' ', " +
  536. " order_type ='t', " +
  537. " parent_code=space(7), " +
  538. " exclu_group_type=space(1), " +
  539. " discription='成组医嘱', " +
  540. " serial ='0000', " +
  541. " group_no='0000', " +
  542. " infusion_flag='', " +
  543. " drug_flag ='', " +
  544. " group_name ='', " +
  545. " pack_size =1, " +
  546. " order_class ='', " +
  547. " spec_pack='', " +
  548. " jsy_flag ='', " +
  549. " exclu_group_type='', " +
  550. " xnh_flag='', " +
  551. " yb_comment =null, " +
  552. " dosage = '', " +
  553. " yb_type='', " +
  554. " father_flag='0', " +
  555. " manu_name='', " +
  556. " stock_amount=0 " +
  557. "FROM yz_OrderPattern a " +
  558. "where (py_code like #{code} or " +
  559. "pattern_name like #{code} or " +
  560. "d_code like #{code}) and dept_code = #{deptCode} ")
  561. List<YiZhuMingChen> composeOrders(String code, String deptCode);
  562. @Select("SELECT act_order_no, " +
  563. " order_name " +
  564. "FROM yz_act_order " +
  565. "WHERE inpatient_no = #{patNo} " +
  566. " AND admiss_times = #{times} " +
  567. " AND isnull(parent_no, 0) = 0 " +
  568. " and status_flag = '1' " +
  569. " and serial <> '00' ")
  570. List<XinZhenYzActOrder> getParentOrders(String patNo, String times);
  571. @Select("SELECT cast(rtrim(isnull(nullif(del_flag, " +
  572. " ''), " +
  573. " 0)) as int) as del_flag, " +
  574. " national_code as national_code, " +
  575. " name as order_name " +
  576. "FROM yz_order_occurence a with (NOLOCK), " +
  577. " zd_charge_item b with (NOLOCK) " +
  578. "where a.occ_code = b.code " +
  579. " and a.order_code = #{code}")
  580. List<XinZhenYzActOrder> huoQuXiangMu(String code);
  581. @Select("select isnull(exclu_group_type, 0) " +
  582. "from yz_order_item with (NOLOCK) where order_code = #{code}")
  583. Integer shiFouPaiChiYiZhu(String code);
  584. @Select("select " +
  585. " /* 毒麻标志 */ drug_flag, " +
  586. " a.serial, " +
  587. " /* 医保自费 */ " +
  588. " cast(isnull(NULLIF(self_flag_yb, " +
  589. " ''), " +
  590. " 0) as int) as self_flag_yb, " +
  591. " /* 重量 */ " +
  592. " weight, " +
  593. " /* 重量单位 */ " +
  594. " weigh_unit, " +
  595. " weigh_unit_name = (select name " +
  596. " from yp_zd_unit with (NOLOCK) " +
  597. " where code = weigh_unit), " +
  598. " /*体积*/ " +
  599. " volum, " +
  600. " /*体积单位*/ " +
  601. " vol_unit, " +
  602. " vol_unit_name = (select name " +
  603. " from yp_zd_unit with (NOLOCK) " +
  604. " where code = vol_unit), " +
  605. " /*包装体积*/ " +
  606. " pack_size, " +
  607. " /*包装单位*/ " +
  608. " pack_unit, " +
  609. " pack_unit_name = (select name " +
  610. " from yp_zd_unit with (NOLOCK) " +
  611. " where code = pack_unit), " +
  612. " /*最小单位*/ " +
  613. " mini_unit, " +
  614. " mini_unit_name = (select name " +
  615. " from yp_zd_unit with (NOLOCK) " +
  616. " where code = mini_unit), " +
  617. " /* 需要判断医生的权限 在 select " +
  618. " doctor_xz_yp " +
  619. " from " +
  620. " a_employee_mi */ " +
  621. " cast(isnull(NULLIF(yp_level, " +
  622. " ''), " +
  623. " 0) as int) as yp_level, " +
  624. " /*需要皮试*/ " +
  625. " cast(isnull(NULLIF(ps_flag, " +
  626. " ''), " +
  627. " 0) as int) as ps_flag, " +
  628. " cast(isnull(NULLIF(kss_flag, " +
  629. " ''), " +
  630. " 0) as int) as kss_flag, " +
  631. " cast(isnull(NULLIF(kjyw_flag, " +
  632. " ''), " +
  633. " 0) as int) as kjyw_flag, " +
  634. " code as order_code, " +
  635. " name as order_name, " +
  636. " frequency as frequCode, " +
  637. " (select isnull(rtrim(comm), " +
  638. " '') " +
  639. " from yz_order_frequency " +
  640. " where yz_order_frequency.code = frequency) as frequCodeName, " +
  641. " supply_type as supply_code, " +
  642. " supply_code_name = (select supply_name " +
  643. " from yz_supply_type with (NOLOCK) " +
  644. " where yz_supply_type.supply_code = supply_type), " +
  645. " national_code, " +
  646. " stock_amount," +
  647. " cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy " +
  648. "from yp_zd_dict a with (NOLOCK) " +
  649. " left join yp_base_yf b on (code = b.charge_code and a.serial = b.serial) " +
  650. "where rtrim(code) + rtrim(a.serial) = #{code} " +
  651. " and cast(isnull(NULLIF(del_flag, ''), 0) as int) = 0 " +
  652. " and group_no = #{groupNo} ")
  653. YaoPinXinXi huoQuYaoPin(@Param("code") String code,
  654. @Param("groupNo") String groupNo);
  655. @Select("select count(1) " +
  656. "from yp_zd_dept " +
  657. "where charge_code = #{code} " +
  658. " and dept_code = #{dept} ")
  659. Integer restrictedUseInTheDepartment(@Param("code") String code,
  660. @Param("dept") String dept);
  661. @Select("select cast(isnull(NULLIF(doctor_xz_yp, ''), 0) as int) from a_employee_mi with (NOLOCK) where code = #{code}")
  662. Integer huoQuYiShenDengJi(String code);
  663. /**
  664. * 出院带药数量
  665. *
  666. * @param patNo 住院号
  667. * @param times 住院次数
  668. * @return
  669. */
  670. @Select("select count(*) " +
  671. "from yz_act_order " +
  672. "where inpatient_no = #{patNo} " +
  673. " and admiss_times = #{times} " +
  674. " and self_buy = '4' " +
  675. " and status_flag in ('1', '2') ")
  676. int obtainTheNumberOfDischargedDrugs(String patNo, Integer times);
  677. @Select("select rtrim(supply_code) code,rtrim(supply_name) name " +
  678. "from yz_supply_type with (NOLOCK) " +
  679. "where ps_flag in ('1', '0')")
  680. List<GetDropdownBox> piShiGeiYaoFangShi();
  681. @Select("select rtrim(code) code, rtrim(comm) name " +
  682. "from yz_order_frequency with (NOLOCK) " +
  683. "where (code like #{code} or comm like #{code})")
  684. List<GetDropdownBox> huoQuZhuYuanPinLv(String code);
  685. @Select("select rtrim(supply_code) code, rtrim(supply_name) name " +
  686. "from yz_supply_type with (NOLOCK) " +
  687. "where (supply_code like #{code} or supply_name like #{code} or py_code like #{code} )")
  688. List<GetDropdownBox> huoQuGeiYaoFangShi(String code);
  689. @Select("SELECT a.code code, " +
  690. " a.name name " +
  691. "FROM zd_unit_code a with (NOLOCK), " +
  692. " zd_dept_all b with (NOLOCK) " +
  693. "where isnull(a.del_flag, '0') <> '1' " +
  694. " and a.code = b.small_dept " +
  695. " and (a.code like #{code} or a.name like #{code} or py_code like #{code}) " +
  696. "group by code,name")
  697. List<GetDropdownBox> huoQuZhiXinKeShi(String code);
  698. @Select("<script>" +
  699. "select rtrim(code) order_code, " +
  700. " rtrim(a.serial) serial, " +
  701. " rtrim(name) order_name," +
  702. " case infusion_flag " +
  703. " when '1' then 'i' " +
  704. " else " +
  705. " (case " +
  706. " when rtrim(code) &gt;= '30000' and rtrim(code) &lt; '50000' then 'z' " +
  707. " else 'd' end) end as drug_flag, " +
  708. " mini_unit, " +
  709. " isnull(weight,1) drug_weight, " +
  710. " weigh_unit drug_weight_unit, " +
  711. " isnull(volum,1) drug_volume, " +
  712. " vol_unit drug_vol_unit," +
  713. " isnull(pack_size,1) pack_size, " +
  714. " pack_unit," +
  715. " a.pack_retprice, " +
  716. " national_code," +
  717. " cast(isnull(NULLIF(kjyw_flag, ''), 0) as int) as kjyw_flag," +
  718. " cast(isnull(NULLIF(yp_level, ''), 0) as int) as yp_level," +
  719. " cast(isnull(NULLIF(del_flag, ''), 0) as int) as del_flag, " +
  720. " stock_amount," +
  721. " cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy," +
  722. " deptRestrictions = (select count(1) from yp_zd_dept where code = yp_zd_dept.charge_code and dept_code = '${dept}') " +
  723. " from yp_zd_dict a with (NOLOCK) " +
  724. " left join yp_base_yf b on ( code = b.charge_code and a.serial = b.serial) " +
  725. "where rtrim(code) + rtrim(a.serial) in " +
  726. "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +
  727. "#{item}" +
  728. "</foreach>" +
  729. " and group_no = #{groupNo} " +
  730. "</script>")
  731. List<XinZhenYzActOrder> huoQuYaoPinXinXi(@Param("code") Set<String> code,
  732. @Param("groupNo") String groupNo,
  733. @Param("dept") String dept);
  734. @Select("<script>" +
  735. "select b.order_code, " +
  736. " rtrim(c.name) order_name, " +
  737. " national_code, " +
  738. " kjyw_flag = 0, " +
  739. " cast(rtrim(isnull(nullif(c.del_flag, " +
  740. " ''), " +
  741. " 0)) as int) del_flag " +
  742. " from " +
  743. " yz_order_occurence b with (NOLOCK) , " +
  744. " zd_charge_item c with (NOLOCK) " +
  745. "where b.order_code in " +
  746. "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +
  747. "#{item}" +
  748. "</foreach>" +
  749. " and b.occ_code = c.code" +
  750. "</script>")
  751. List<XinZhenYzActOrder> huoQuXiangMuXinXi(Set<String> code);
  752. @Select("select rtrim(inpatient_no) as inpatient_no, " +
  753. " admiss_times, " +
  754. " rtrim(name) as name, " +
  755. " rtrim(dept) as dept_code, " +
  756. " rtrim(zk_ward) as ward_code, " +
  757. " refer_physician, " +
  758. " times_billed, " +
  759. " admiss_date, " +
  760. " small_dept, " +
  761. " bed_no, " +
  762. " ledger_sn = (select max(ledger_sn) " +
  763. " from zy_ledger_file with (NOLOCK) " +
  764. " where zy_actpatient.inpatient_no = zy_ledger_file.inpatient_no " +
  765. " and zy_actpatient.admiss_times = zy_ledger_file.admiss_times) " +
  766. " from zy_actpatient with (NOLOCK) " +
  767. "where inpatient_no = #{patNo} " +
  768. " and admiss_times = #{times} ")
  769. XinZhenYiZhu huoQuHuanZheXinXi(@Param("patNo") String patNo,
  770. @Param("times") Integer times);
  771. @Delete("<script>" +
  772. "delete yz_act_record_kss " +
  773. "where act_order_no in " +
  774. "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
  775. "#{item.actOrderNo}" +
  776. "</foreach>" +
  777. "</script>")
  778. void shanChuYuanKuangJunYaoWu(List<YzActRecordKss> list);
  779. @Insert("<script>" +
  780. "insert into yz_act_record_kss (act_order_no, charge_code, input_id, inpatient_no, admiss_times, yyfs, ssqk, yysj) " +
  781. "values " +
  782. "<foreach collection='list' item='item' separator=','>" +
  783. "(#{item.actOrderNo},#{item.chargeCode},#{inputId},#{patNo},#{times},#{item.yyfs},#{item.ssqk},#{item.yysj})" +
  784. "</foreach>" +
  785. "</script>")
  786. void chaRuKuangJunYaoWuXinXi(@Param("patNo") String patNo,
  787. @Param("times") Integer times,
  788. @Param("inputId") String inputId,
  789. @Param("list") List<YzActRecordKss> list);
  790. @Insert("<script>" +
  791. "INSERT INTO yz_act_order (order_code, order_name, frequ_code, instruction, discription, infant_flag, order_time, " +
  792. " /*录入人*/physician, start_time, drug_specification, drug_quan, supply_code, act_order_no, inpatient_no, " +
  793. " admiss_times, drug_flag/*药品中找这个是 药品的类型 a i d*/, enter_oper, /*录入时间*/ enter_time, " +
  794. " mini_unit /*药品中找 最小包装规格*/, " +
  795. " drug_weight/*药品的重量*/, drug_weight_unit/*药品重量单位*/, " +
  796. " status_flag/*2*/, self_buy, dose, dose_unit, /*这个是算出来的 输入的 dose 除以选中的单位 */drug_occ, drug_volume/*药品中的 volum 找*/, " +
  797. " drug_vol_unit/* 药品中的 vol_unit */, pay_self/*0*/, " +
  798. " serial/*前端传*/, group_no/*药房 */, doctor_flag/*写死为 1*/, exec_unit, dept_code/* 在院病人表中的 dept */, " +
  799. " ward_code /* 在院病人表中的 zk_ward*/, " +
  800. " reg_flag/* 0 */, " +
  801. " yb_self_flag/*医保自费标志*/,emergency_flag, " +
  802. " kf_flag /*饭前饭后*/,parent_no, refer_physician/*患者的管床医生*/, confirm_time/*确认时间*/, signer/*确认人*/,end_time,modifier) " +
  803. "VALUES " +
  804. "<foreach collection='list' item='item' separator=','>" +
  805. "(#{item.orderCode,jdbcType=VARCHAR}, #{item.orderName,jdbcType=VARCHAR}, #{item.frequCode,jdbcType=VARCHAR}," +
  806. " #{item.instruction,jdbcType=VARCHAR}, #{item.discription,jdbcType=VARCHAR}, #{infantFlag,jdbcType=VARCHAR}, " +
  807. "#{item.orderTime,jdbcType=VARCHAR}, " +
  808. " #{inputCode,jdbcType=TIMESTAMP}, #{item.startTime,jdbcType=TIMESTAMP}, #{item.drugSpecification}, " +
  809. "#{item.drugQuan,jdbcType=DECIMAL}," +
  810. " #{item.supplyCode}," +
  811. " #{item.actOrderNo,jdbcType=DECIMAL}, #{patNo}, #{times}, " +
  812. "#{item.drugFlag}," +
  813. " #{inputCode}, " +
  814. " getdate(), #{item.miniUnit}, " +
  815. "#{item.drugWeight,jdbcType=DECIMAL}, " +
  816. "#{item.drugWeightUnit}, '2', #{item.selfBuy}, " +
  817. "cast(#{item.dose,jdbcType=DECIMAL} as decimal(10,2))," +
  818. " #{item.doseUnit}, " +
  819. "cast(#{item.drugOcc,jdbcType=DECIMAL} as decimal(10,2))," +
  820. "cast(#{item.drugVolume,jdbcType=DECIMAL} as decimal(10,2))," +
  821. " #{item.drugVolUnit}, 0, #{item.serial}, " +
  822. "#{item.groupNo}," +
  823. "'1', #{item.execUnit}, " +
  824. "#{deptCode}, #{wardCode}, '0', #{item.ybSelfFlag},#{item.emergencyFlag}, #{item.kfFlag}," +
  825. "#{item.parentNo,jdbcType=DECIMAL}," +
  826. " #{referPhysician}, getdate(), #{inputCode},#{item.endTime,jdbcType=TIMESTAMP},#{item.modifier})" +
  827. "</foreach>" +
  828. "</script>")
  829. void chaRuYiZhu(@Param("patNo") String patNo,
  830. @Param("times") Integer times,
  831. @Param("inputCode") String inputCode,
  832. @Param("infantFlag") Integer infantFlag,
  833. @Param("deptCode") String deptCode,
  834. @Param("wardCode") String wardCode,
  835. @Param("referPhysician") String referPhysician,
  836. @Param("list") List<XinZhenYzActOrder> list);
  837. @Select("<script>" +
  838. "select top 20 * from (" +
  839. "SELECT row_number() over (order by pattern_code ) row_number," +
  840. " rtrim(pattern_code) pattern_code, " +
  841. " rtrim(pattern_name) pattern_name," +
  842. " rtrim(input_id) input_id," +
  843. " input_date," +
  844. " rtrim(input_type) input_type, " +
  845. " sort_no," +
  846. " yiBeiShouCang = (select count(1) from yz_OrderPattern b with (NOLOCK) where b.collect_code = a.pattern_code " +
  847. " and b.input_id = #{inputId})," +
  848. " collect_code " +
  849. "FROM yz_OrderPattern a with (NOLOCK) " +
  850. "where 1=1 " +
  851. "<if test=\"code != null and code != '' \">" +
  852. "and (py_code like #{code} " +
  853. " or pattern_code like #{code} " +
  854. " or pattern_name like #{code}) " +
  855. "</if>" +
  856. "<if test=\"muBanLeiXing == 2 \">" +
  857. " and dept_code = #{deptCode} AND input_type = '2' " +
  858. "</if>" +
  859. "<if test=\"muBanLeiXing == 3 \">" +
  860. " and input_id = #{inputId} AND input_type = '3' " +
  861. "</if>" +
  862. "<if test=\"muBanLeiXing == 1\">" +
  863. " and input_type = '1' " +
  864. "</if>" +
  865. "<if test=\"muBanLeiXing == 4\">" +
  866. " and input_id = #{inputId} AND input_type = '4' " +
  867. "</if>" +
  868. "<if test=\"muBanLeiXing == 0\">" +
  869. " AND input_type &lt;&gt; '4' " +
  870. "</if>" +
  871. ") temp where row_number > (${currentPage} - 1) * 20 " +
  872. "<if test=\"muBanLeiXing == 3 \">" +
  873. " order by sort_no desc " +
  874. "</if>" +
  875. "</script>")
  876. List<YzOrderPattern> huoQuMuBan(@Param("code") String code,
  877. @Param("inputId") String inputId,
  878. @Param("deptCode") String deptCode,
  879. @Param("muBanLeiXing") Integer muBanLeiXing,
  880. @Param("currentPage") long currentPage);
  881. @Select("select max(sort_no + 1) " +
  882. "from yz_OrderPattern " +
  883. "where input_id = #{code}")
  884. Integer getMyTemplateMaxSortNo(String code);
  885. @Select("<script>" +
  886. "SELECT count(*) " +
  887. "FROM yz_OrderPattern with (NOLOCK) " +
  888. "where 1=1 " +
  889. "<if test=\"code != null and code != '' \">" +
  890. "and (py_code like #{code} " +
  891. " or pattern_code like #{code} " +
  892. " or pattern_name like #{code}) " +
  893. "</if>" +
  894. "<if test=\"muBanLeiXing == 2 \">" +
  895. " and dept_code = #{deptCode} AND input_type = '2' " +
  896. "</if>" +
  897. "<if test=\"muBanLeiXing == 3 \">" +
  898. " and input_id = #{inputId} AND input_type = '3' " +
  899. "</if>" +
  900. "<if test=\"muBanLeiXing == 1\">" +
  901. " and input_type = '1' " +
  902. "</if>" +
  903. "<if test=\"muBanLeiXing == 4\">" +
  904. " and input_id = #{inputId} AND input_type = '4' " +
  905. "</if>" +
  906. "<if test=\"muBanLeiXing == 0\">" +
  907. " AND input_type &lt;&gt; '4' " +
  908. "</if>" +
  909. "</script>")
  910. long huoQuMuBanTotal(@Param("code") String code,
  911. @Param("inputId") String inputId,
  912. @Param("deptCode") String deptCode,
  913. @Param("muBanLeiXing") Integer muBanLeiXing);
  914. @Select("SELECT cast(cast(act_order_no as decimal) as varchar) id, " +
  915. " act_order_no, " +
  916. " rtrim(a.order_name) order_name, " +
  917. " rtrim(a.order_code) order_code, " +
  918. " a.frequ_code, " +
  919. " frequ_code_name = (select rtrim(comm) " +
  920. " from yz_order_frequency with (NOLOCK) " +
  921. " where yz_order_frequency.code = a.frequ_code), " +
  922. " a.drug_specification, " +
  923. " a.supply_code, " +
  924. " supply_code_name = (select rtrim(supply_name) " +
  925. " from yz_supply_type with (NOLOCK) " +
  926. " where yz_supply_type.supply_code = a.supply_code), " +
  927. " a.drug_quan, " +
  928. " a.instruction, " +
  929. " a.mini_unit, " +
  930. " mini_unit_name = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = mini_unit), " +
  931. " a.drug_weight, " +
  932. " a.drug_weight_unit, " +
  933. " a.parent_no, " +
  934. " a.drug_volume, " +
  935. " a.drug_vol_unit, " +
  936. " a.dose, " +
  937. " a.dose_unit, " +
  938. " dose_unit_name = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = dose_unit), " +
  939. " a.exclu_act_order_no, " +
  940. " a.discription, " +
  941. " a.pattern_code, " +
  942. " a.order_type, " +
  943. " a.serial, " +
  944. " self_buy=isnull(a.self_buy, '0'), " +
  945. " del_flag=isnull(b.del_flag, ''), " +
  946. " a.drug_flag, " +
  947. " suprice_flag='', " +
  948. " self_flag ='', " +
  949. " parent_flag='', " +
  950. " a.exec_unit, " +
  951. " exec_unit_name = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_unit) " +
  952. "FROM yz_pattern_order a with (NOLOCK), " +
  953. " yz_order_item b with (NOLOCK) " +
  954. "WHERE a.pattern_code = #{code} " +
  955. " and isnull(a.group_no, '00') = '00' " +
  956. " and a.order_code = b.order_code " +
  957. "UNION " +
  958. "SELECT cast(cast(act_order_no as decimal) as varchar) id," +
  959. " act_order_no, " +
  960. " a.order_name, " +
  961. " a.order_code, " +
  962. " a.frequ_code, " +
  963. " frequ_code_name = (select rtrim(comm) " +
  964. " from yz_order_frequency with (NOLOCK) " +
  965. " where yz_order_frequency.code = a.frequ_code), " +
  966. " a.drug_specification, " +
  967. " a.supply_code, " +
  968. " supply_code_name = (select rtrim(supply_name) " +
  969. " from yz_supply_type with (NOLOCK) " +
  970. " where yz_supply_type.supply_code = a.supply_code), " +
  971. " a.drug_quan, " +
  972. " a.instruction, " +
  973. " a.mini_unit, " +
  974. " mini_unit_name = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = mini_unit), " +
  975. " a.drug_weight, " +
  976. " a.drug_weight_unit, " +
  977. " a.parent_no, " +
  978. " a.drug_volume, " +
  979. " a.drug_vol_unit, " +
  980. " a.dose, " +
  981. " a.dose_unit, " +
  982. " dose_unit_name = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = dose_unit), " +
  983. " a.exclu_act_order_no, " +
  984. " a.discription, " +
  985. " a.pattern_code, " +
  986. " a.order_type, " +
  987. " a.serial, " +
  988. " self_buy=isnull(a.self_buy, case when b.jsy_flag = '1' then '3' else '0' end), " +
  989. " del_flag=isnull(b.visible_flag_zy, ''), " +
  990. " a.drug_flag, " +
  991. " suprice_flag=b.suprice_flag, " +
  992. " self_flag =b.self_flag, " +
  993. " parent_flag='', " +
  994. " a.exec_unit, " +
  995. " exec_unit_name = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_unit) " +
  996. "FROM yz_pattern_order a with (NOLOCK), " +
  997. " view_yp_zd_dict_base_yf b with (NOLOCK) " +
  998. "WHERE a.pattern_code = #{code} " +
  999. " and a.group_no = b.group_no " +
  1000. " and a.order_code = b.code " +
  1001. " and a.serial = b.serial " +
  1002. " and isnull(b.visible_flag_zy, '') <> '1'")
  1003. List<YzActOrder> huoQuMuBanShuJu(String code);
  1004. @Select("select pattern_code," +
  1005. " rtrim(input_type) as input_type," +
  1006. " input_id " +
  1007. "from yz_OrderPattern with (NOLOCK) " +
  1008. "where pattern_name = #{patternName} " +
  1009. " and input_id = #{inputId}" +
  1010. " and input_type <> 4 ")
  1011. YzOrderPattern yuanLaiDeMuBanBianMa(@Param("patternName") String patternName,
  1012. @Param("inputId") String inputId);
  1013. @Select("select top 1 * " +
  1014. "from yz_OrderPattern with (NOLOCK) " +
  1015. "where pattern_code = #{patternCode} " +
  1016. " and input_id = #{inputId}" +
  1017. " and input_type <> 4 ")
  1018. YzOrderPattern getDataAccordingToTemplateCode(@Param("patternCode") String patternCode,
  1019. @Param("inputId") String input);
  1020. @Select("select pattern_code," +
  1021. " rtrim(input_type) input_type," +
  1022. " input_id " +
  1023. "from yz_OrderPattern with (NOLOCK) " +
  1024. "where pattern_name = #{patternName} " +
  1025. "and input_type not in ('3','4') ")
  1026. YzOrderPattern gongGongMuBan(@Param("patternName") String patternName);
  1027. @Delete("<script>" +
  1028. "delete yz_OrderPattern " +
  1029. "where pattern_code = #{patternCode}; " +
  1030. "delete yz_pattern_order " +
  1031. "where pattern_code = #{patternCode} " +
  1032. "</script>")
  1033. void shanChuLaoMuBan(@Param("patternCode") String patternCode);
  1034. @Insert("insert yz_OrderPattern (pattern_code, pattern_name, py_code, d_code, dept_code, " +
  1035. " ward_code, input_id, " +
  1036. " input_type, input_date, sort_no) " +
  1037. "values (#{patternCode},#{patternName},#{pyCode},#{dCode},#{deptCode},#{deptCode}," +
  1038. "#{inputId},#{inputType}," +
  1039. "getdate(),#{sortNo})")
  1040. void chaRuMuBan(YzOrderPattern param);
  1041. @Select("select count(1) " +
  1042. "from yz_OrderPattern " +
  1043. "where pattern_name = #{name} and input_id = #{userCode} ")
  1044. Integer duplicateTemplateName(@Param("name") String name,
  1045. @Param("userCode") String userCode);
  1046. @Insert("<script>" +
  1047. "INSERT INTO yz_pattern_order (act_order_no, order_code, frequ_code, drug_flag, supply_code, drug_quan, instruction, " +
  1048. " drug_specification, mini_unit, drug_weight, drug_weight_unit, parent_no, drug_volume, " +
  1049. " drug_vol_unit, dose, dose_unit, drug_occ, order_name, discription, " +
  1050. " pattern_code, serial, self_buy, exec_unit) " +
  1051. "VALUES " +
  1052. "<foreach collection='list' item='item' separator=','>" +
  1053. "(#{item.actOrderNo}, #{item.orderCode}, #{item.frequCode}," +
  1054. "<if test=\"item.drugFlag !=null and item.drugFlag != '' \">" +
  1055. "#{item.drugFlag}," +
  1056. "</if>" +
  1057. "<if test=\"item.drugFlag == null or item.drugFlag == '' \">" +
  1058. "'o'," +
  1059. "</if>" +
  1060. " #{item.supplyCode}," +
  1061. "<if test=\"item.drugQuan != null \">" +
  1062. "#{item.drugQuan}," +
  1063. "</if>" +
  1064. "<if test=\"item.drugQuan == null \">" +
  1065. "null," +
  1066. "</if>" +
  1067. "#{item.instruction}, #{item.drugSpecification}, #{item.miniUnit}, " +
  1068. "<if test=\"item.drugWeight != null\">" +
  1069. "#{item.drugWeight}, " +
  1070. "</if>" +
  1071. "<if test=\"item.drugWeight == null\">" +
  1072. "null, " +
  1073. "</if>" +
  1074. "#{item.drugWeightUnit}, " +
  1075. "<if test=\"item.parentNo != null \">" +
  1076. "#{item.parentNo}," +
  1077. "</if>" +
  1078. "<if test=\"item.parentNo == null \">" +
  1079. "null," +
  1080. "</if>" +
  1081. "<if test=\"item.drugVolume != null\">" +
  1082. "cast(#{item.drugVolume,jdbcType=DECIMAL} as decimal(10,2))," +
  1083. "</if>" +
  1084. "<if test=\"item.drugVolume == null\">" +
  1085. "null," +
  1086. "</if>" +
  1087. " #{item.drugVolUnit}, " +
  1088. "<if test=\"item.dose != null\">" +
  1089. "cast(#{item.dose,jdbcType=DECIMAL} as decimal(10,2))," +
  1090. "</if>" +
  1091. "<if test=\"item.dose == null\">" +
  1092. "null," +
  1093. "</if>" +
  1094. "#{item.doseUnit}," +
  1095. "<if test=\"item.drugOcc != null \">" +
  1096. "cast(#{item.drugOcc,jdbcType=DECIMAL} as decimal(10,2))," +
  1097. "</if>" +
  1098. "<if test=\"item.drugOcc == null \">" +
  1099. "null," +
  1100. "</if>" +
  1101. " #{item.orderName},#{item.discription},#{patternCode},#{item.serial},#{item.selfBuy},#{item.execUnit})" +
  1102. "</foreach>" +
  1103. "</script>")
  1104. void chaRuMuBanShuJu(List<XinZhenYzActOrder> list, String patternCode);
  1105. @Select("select * " +
  1106. "from yz_OrderPattern with (NOLOCK) " +
  1107. "where pattern_code = #{code}")
  1108. YzOrderPattern huoQuMuBanXinXi(@Param("code") String code);
  1109. @Update("update yz_OrderPattern " +
  1110. "set pattern_name = #{patternName}, " +
  1111. " py_code = #{pyCode}, " +
  1112. " d_code = #{dCode}, " +
  1113. " input_date = getdate()," +
  1114. " sort_no = #{sortNo} " +
  1115. "where pattern_code = #{patternCode} ")
  1116. void genXingMuBan(@Param("patternName") String patternName,
  1117. @Param("pyCode") String pyCode,
  1118. @Param("dCode") String dCode,
  1119. @Param("patternCode") String patternCode,
  1120. @Param("sortNo") Integer sortNo);
  1121. @Select("select rtrim(dept_code) from a_employee_mi where code = '${code}'")
  1122. String userDeptCode(@Param("code") String code);
  1123. @Delete("/* 父模板 */ " +
  1124. "delete yz_OrderPattern " +
  1125. "where pattern_code = #{patternCode}; " +
  1126. "/* 模板下面的数据 */ " +
  1127. "delete yz_pattern_order " +
  1128. "where pattern_code = #{patternCode} ")
  1129. void shanChuMuBan(@Param("patternCode") String patternCode);
  1130. @Select("select pattern_code " +
  1131. "from yz_OrderPattern " +
  1132. "where collect_code = #{patternCode} and input_id = #{userId}")
  1133. String whetherToSaveTheDoctorSOrderTemplate(@Param("patternCode") String patternCode,
  1134. @Param("userId") String userId);
  1135. @Select("select collect_code " +
  1136. "from yz_OrderPattern with (NOLOCK) " +
  1137. "where input_id = #{inputId} " +
  1138. " and collect_code = #{collectCode} ")
  1139. String chongFuShouCang(@Param("inputId") String inputId,
  1140. @Param("collectCode") String collectCode);
  1141. @Insert("insert into yz_OrderPattern (pattern_code, pattern_name, py_code, d_code, dept_code, ward_code, " +
  1142. " input_id, input_type, input_date, sort_no, collect_code) " +
  1143. "values (#{patternCode},#{patternName},#{pyCode},#{dCode},#{deptCode},#{deptCode},#{inputId},'4',getdate(),0,#{collectCode});")
  1144. void chaRuShouCang(@Param("patternCode") String patternCode,
  1145. @Param("patternName") String patternName,
  1146. @Param("pyCode") String pyCode,
  1147. @Param("dCode") String dCode,
  1148. @Param("deptCode") String deptCode,
  1149. @Param("inputId") String inputId,
  1150. @Param("collectCode") String collectCode);
  1151. @Select("select * " +
  1152. "from yz_act_order with (NOLOCK) " +
  1153. "where act_order_no = #{actOrderNo} ")
  1154. YzActOrder chaXunYiZhuXinXin(BigDecimal actOrderNo);
  1155. @Update("update yz_act_order set emergency_flag = #{emergencyFlag} " +
  1156. "where act_order_no = #{actOrderNo} ")
  1157. void sheZhiJinJi(@Param("actOrderNo") BigDecimal actOrderNo,
  1158. @Param("emergencyFlag") String emergencyFlag);
  1159. @Insert("insert into yz_erase_order_comm (act_order_no, inpatient_no, admiss_times, comment, order_code, sys_date) " +
  1160. "values (#{actOrderNo}, #{patNo}, #{times}, #{content}, #{orderCode}, getdate())")
  1161. void chaRuCheXiaoYuanYin(@Param("actOrderNo") BigDecimal actOrderNo,
  1162. @Param("patNo") String patNo,
  1163. @Param("times") Integer times,
  1164. @Param("content") String content,
  1165. @Param("orderCode") String orderCode);
  1166. @Delete("/*删除费用*/ " +
  1167. "delete yz_zy_patient_fee " +
  1168. "where act_order_no = #{actOrderNo} " +
  1169. " and charge_status = '3';" +
  1170. "/*删除药品的药单*/ " +
  1171. "delete yz_yp_zy_order " +
  1172. "where act_order_no = #{actOrderNo} " +
  1173. " and status_flag = '1';" +
  1174. "/*删除医嘱表*/" +
  1175. "DELETE " +
  1176. "FROM yz_act_order " +
  1177. "WHERE act_order_no = #{actOrderNo};" +
  1178. "/*删除医技*/ " +
  1179. "delete ysh_yj_req " +
  1180. "where act_order_no = #{actOrderNo};")
  1181. void cheXiaoYiZhu(@Param("actOrderNo") BigDecimal actOrderNo);
  1182. @Insert("insert into yz_erase_order " +
  1183. "select * " +
  1184. "from yz_act_order " +
  1185. "where act_order_no = #{actOrderNo}")
  1186. void chaRuShanChuBiao(@Param("actOrderNo") BigDecimal actOrderNo);
  1187. @Update("update yz_erase_order " +
  1188. "set modifier =#{userCode}, " +
  1189. " status_time =getdate(), " +
  1190. " print_order_change =case when isnull(print_order_change, '') = '' then 'd' else '' end " +
  1191. "where act_order_no = #{actOrderNo};" +
  1192. "update op_record " +
  1193. "set status ='d' " +
  1194. "where act_order_no = #{actOrderNo};")
  1195. void genXingShanChuBiaoZhi(@Param("userCode") String userCode,
  1196. @Param("actOrderNo") BigDecimal actOrderNo);
  1197. @Update("update yz_act_order " +
  1198. "set modifier = #{userCode}, " +
  1199. " end_time = #{endTime} " +
  1200. "where act_order_no = #{actOrderNo} ")
  1201. void sheZhiTingZhiShiJian(@Param("userCode") String userCode,
  1202. @Param("actOrderNo") BigDecimal actOrderNo,
  1203. @Param("endTime") String endTime);
  1204. @Select("<script>" +
  1205. "select * from yz_act_order with (NOLOCK) where act_order_no in " +
  1206. "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
  1207. " #{item} " +
  1208. "</foreach>" +
  1209. "</script>")
  1210. List<YzActOrder> yiZhuXinXiJiHe(@Param("list") List<BigDecimal> list);
  1211. @Update("<script>" +
  1212. "<foreach collection='list' item='item' separator=';'>" +
  1213. "update yz_act_order " +
  1214. "set modifier = #{userCode}, " +
  1215. " end_time = #{endTime} " +
  1216. " where act_order_no = #{item} " +
  1217. "</foreach>" +
  1218. "</script>")
  1219. void piLiangSheZhiTingZhiShiJian(@Param("list") List<BigDecimal> actOrderNo,
  1220. @Param("userCode") String userCode,
  1221. @Param("endTime") String endTime);
  1222. @Delete("delete yz_act_record_kss where act_order_no = #{orderNo}")
  1223. void deleteAntimicrobialInformation(String orderNo);
  1224. @Insert("insert into yz_act_record_kss " +
  1225. "(act_order_no, charge_code, input_id, inpatient_no, " +
  1226. "admiss_times, yyfs, ssqk, yysj)" +
  1227. "values " +
  1228. "(#{orderNo},#{kss.chargeCode},#{userCode},#{patNo}," +
  1229. "#{times},#{kss.yyfs},#{kss.ssqk},#{kss.yysj})")
  1230. void insertAntimicrobialInformation(String orderNo,
  1231. YzActRecordKss kss,
  1232. String userCode,
  1233. String patNo,
  1234. Integer times);
  1235. @Delete("delete zy_order_zk where act_order_no = #{orderNo}")
  1236. void deleteTransferOrder(String orderNo);
  1237. @Insert("insert into zy_order_zk (act_order_no, old_ward, " +
  1238. "old_dept, new_ward, new_dept) " +
  1239. "values (#{actOrderNo},#{oldWard},#{oldDept},#{newWard},#{newDept})")
  1240. void insertDoctorSOrder(ZyOrderZk zk);
  1241. @Select("execute dbo.xc_zy_order_fee;1 @in_no = #{patNo}, @in_times = #{times}")
  1242. List<DoctorSOrderFee> expensesForGettingADoctorSOrder(@Param("patNo") String patNo,
  1243. @Param("times") Integer times);
  1244. @Select("select admiss_date " +
  1245. "from zy_actpatient " +
  1246. "where inpatient_no = #{patNo}")
  1247. Date patientAdmissionTime(String patNo);
  1248. @Select("<script>" +
  1249. "select act_order_no, " +
  1250. " inpatient_no, " +
  1251. " admiss_times, " +
  1252. " order_code, " +
  1253. " order_time, " +
  1254. " frequ_code, " +
  1255. " enter_time, " +
  1256. " enter_oper, " +
  1257. " start_time, " +
  1258. " end_time, " +
  1259. " infant_flag, " +
  1260. " drug_flag, " +
  1261. " supply_code, " +
  1262. " performance_time, " +
  1263. " physician, " +
  1264. " confirm_time, " +
  1265. " signer, " +
  1266. " modifier, " +
  1267. " status_flag, " +
  1268. " status_time, " +
  1269. " drug_quan, " +
  1270. " instruction, " +
  1271. " drug_specification, " +
  1272. " mini_unit, " +
  1273. " drug_weight, " +
  1274. " drug_weight_unit, " +
  1275. " print_order_change, " +
  1276. " parent_no, " +
  1277. " self_buy, " +
  1278. " eat_card_flag, " +
  1279. " drug_volume, " +
  1280. " drug_vol_unit, " +
  1281. " dose, " +
  1282. " dose_unit, " +
  1283. " drug_occ, " +
  1284. " print_order, " +
  1285. " print_order_once, " +
  1286. " print_order_anew, " +
  1287. " print_infusion, " +
  1288. " exclu_back_time, " +
  1289. " exclu_act_order_no, " +
  1290. " order_name, " +
  1291. " discription, " +
  1292. " del_flag, " +
  1293. " pay_self, " +
  1294. " serial, " +
  1295. " group_no, " +
  1296. " ward_code, " +
  1297. " yb_self_flag, " +
  1298. " doctor_flag, " +
  1299. " dept_code, " +
  1300. " exec_unit, " +
  1301. " cl_code, " +
  1302. " zy_serial_no, " +
  1303. " executer1, " +
  1304. " executer2, " +
  1305. " reg_flag, " +
  1306. " msg_flag, " +
  1307. " exec_time, " +
  1308. " exec_id, " +
  1309. " ps_status, " +
  1310. " ps_oper, " +
  1311. " ps_time, " +
  1312. " exec_id2, " +
  1313. " act_order_no2, " +
  1314. " print_page, " +
  1315. " print_page_once, " +
  1316. " print_order_change_end, " +
  1317. " emergency_flag, " +
  1318. " req_receive_flag, " +
  1319. " inspect_stuff, " +
  1320. " charge_status, " +
  1321. " ps_result_time, " +
  1322. " kf_flag, " +
  1323. " modifier_oper, " +
  1324. " pass_flag, " +
  1325. " pass_id, " +
  1326. " pass_date, " +
  1327. " pass_comment, " +
  1328. " refer_physician, " +
  1329. " consult_physician " +
  1330. "from yz_act_order " +
  1331. "where act_order_no in " +
  1332. "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
  1333. "#{item} " +
  1334. "</foreach>" +
  1335. "</script>")
  1336. List<YzActOrder> getOriginalOrderData(List<String> list);
  1337. @Insert("<script>" +
  1338. "insert into yz_act_order (act_order_no, inpatient_no, admiss_times, order_code, order_time, frequ_code, enter_time, " +
  1339. " enter_oper, start_time, end_time, infant_flag, drug_flag, supply_code, performance_time, " +
  1340. " physician, confirm_time, signer, modifier, status_flag, status_time, drug_quan, instruction, " +
  1341. " drug_specification, mini_unit, drug_weight, drug_weight_unit, parent_no, " +
  1342. " self_buy, eat_card_flag, drug_volume, drug_vol_unit, dose, dose_unit, drug_occ, " +
  1343. " order_name, discription, del_flag, pay_self, serial, group_no, ward_code, yb_self_flag, " +
  1344. " doctor_flag, dept_code, exec_unit, zy_serial_no, kf_flag, refer_physician, consult_physician) " +
  1345. "values " +
  1346. "<foreach collection='list' item='item' separator=','>" +
  1347. "(#{item.actOrderNo, jdbcType = REAL}, #{item.inpatientNo}, #{item.admissTimes}, '06054', getdate(), 'ONCE', " +
  1348. " getdate(), #{userCode}, GETDATE(), GETDATE(),#{item.infantFlag}, 'o', #{item.supplyCode}, getdate(), " +
  1349. " #{item.physician}, getdate(), #{userCode}, " +
  1350. " #{userCode}, 2, getdate(), " +
  1351. " #{item.drugQuan ,jdbcType = REAL}, #{item.instruction}, #{item.drugSpecification}, #{item.miniUnit}, #{item.drugWeight ,jdbcType = REAL}, " +
  1352. " #{item.drugWeightUnit}, #{item.parentNo ,jdbcType = REAL} , #{item.selfBuy}, #{item.eatCardFlag}, #{item.drugVolume ,jdbcType = REAL},#{item.drugVolUnit},#{item.dose ,jdbcType = REAL},#{item.doseUnit}, " +
  1353. " #{item.drugOcc ,jdbcType = REAL},'退药: ${item.orderName}',#{item.discription},#{item.delFlag},#{item.paySelf},#{item.serial},#{item.groupNo},#{item.wardCode},#{item.ybSelfFlag}, " +
  1354. " #{item.doctorFlag},#{item.deptCode},#{item.execUnit},#{item.zySerialNo},#{item.kfFlag},#{item.referPhysician},#{item.consultPhysician})" +
  1355. "</foreach>" +
  1356. "</script>")
  1357. void insertAReturnOrder(@Param("userCode") String userCode,
  1358. @Param("list") List<YzActOrder> list);
  1359. @Update("UPDATE zy_actpatient " +
  1360. "SET refer_physician = #{param.referPhysician}, " +
  1361. " consult_physician = #{param.consultPhysician}, " +
  1362. " dept_director = #{param.deptDirector} " +
  1363. "WHERE inpatient_no = #{param.inpatientNo} " +
  1364. " AND admiss_times = #{param.admissTimes} ")
  1365. void updateTheThirdLevelDoctor(@Param("param") Overview param);
  1366. /**
  1367. * 插入药品汇总单
  1368. *
  1369. * @param pageNo 药单好
  1370. * @param patInfo 患者信息
  1371. * @param userCode 插入数据
  1372. * @param groupNo 药房
  1373. */
  1374. @Insert("insert into yz_yp_page_no (page_no, dept_code, ward_code, submit_time, " +
  1375. " submit_name, submit_flag, " +
  1376. " page_class, page_name, " +
  1377. " start_date, end_date, group_no) " +
  1378. "values (#{pageNo}, '#{patInfo.deptCode}', #{patInfo.wardCode}, getdate()," +
  1379. " #{userCode}, 1, 1, '出院带药', getdate(), getdate(), #{groupNo})")
  1380. void summarySheetOfDrugs(Integer pageNo, XinZhenYiZhu patInfo, String userCode, String groupNo);
  1381. @Insert("insert into yz_yp_zy_order (inpatient_no, admiss_times, name, bed_no, dept_code, ward_code, charge_code, " +
  1382. " amount,\n" +
  1383. " retprice, charge_date, infant_flag, drawer, always_flag, status_flag/*1*/, drug_class,\n" +
  1384. " serail/*0*/,\n" +
  1385. " occ_time, act_order_no, page_no, pay_self/*0*/, serial/*serial*/,\n" +
  1386. " group_no, doctor_name, page_class, yb_self_flag)\n" +
  1387. "values ();")
  1388. void insertDetailedMedicineList();
  1389. }