EmergencyRescueDao.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package thyyxxk.webserver.dao.his.medicalinsurance;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Select;
  4. import org.apache.ibatis.annotations.Update;
  5. import thyyxxk.webserver.entity.dictionary.CodeName;
  6. import thyyxxk.webserver.entity.medicalinsurance.inpatient.FeeDtle;
  7. import thyyxxk.webserver.entity.medicalinsurance.inpatient.SiChargeTemp;
  8. import thyyxxk.webserver.entity.medicalinsurance.outpatient.MzPatientInfo;
  9. import java.util.List;
  10. @Mapper
  11. public interface EmergencyRescueDao {
  12. @Select("select count(1) from t_mt_receipt where patient_id=#{patNo} and times=#{times}")
  13. int checkGeneratedFees(MzPatientInfo mzptnt);
  14. @Select("select code=b.si_caty,name=b.si_caty_name from mz_visit_table a,zd_unit_code b " +
  15. "where patient_id=#{patNo} and times=#{times} and b.code=a.visit_dept_code")
  16. CodeName getSiCaty(String patNo, int times);
  17. @Select("select item_no as feedetlSn,order_no as drordNo,quantity as cnt, " +
  18. "input_date as feeOcurTime,his_item_code as medinsListCodg, " +
  19. "charge_fee as detItemFeeSumamt,pric=charge_fee/quantity, " +
  20. "tcmdrugUsedWay=(case when medi_item_type=2 then '1' else '' end), " +
  21. "hosp_appr_flag,bilgDrName=input_man, " +
  22. "mdtrtId=(select mdtrt_id from t_si_pat_info b where b.pat_no=patient_id and b.times=a.times), " +
  23. "psnNo=(select psn_no from t_si_pat_info b where b.pat_no=patient_id and b.times=a.times), " +
  24. "medType=(select med_type from t_si_pat_info b where b.pat_no=patient_id and b.times=a.times), " +
  25. "medListCodg=case when a.medi_item_type=0 then " +
  26. "(select isnull(national_code_27, national_code) from zd_charge_item where code=his_item_code) else " +
  27. "(select max(national_code) from yp_zd_dict where code=his_item_code) end, " +
  28. "bilgDrCodg=(select rtrim(yb_code) from a_employee_mi where code=input_staff) " +
  29. "from t_mt_receipt a where patient_id=#{patNo} and times=#{times} and yb_trans_flag=0")
  30. List<FeeDtle> getFeeList(String patNo, int times);
  31. @Update("<script>" +
  32. "update t_mt_receipt set yb_trans_flag=1 where patient_id=#{patNo} and " +
  33. "times=#{times} and item_no in " +
  34. "<foreach collection='tempList' item='fee' separator=',' open='(' close=')'>" +
  35. "#{fee.feedetlSn}</foreach>" +
  36. "</script>")
  37. void updateTransFlag(String patNo, Integer times, List<SiChargeTemp> tempList);
  38. @Select("select rtrim(social_no) from mz_patient_mi where patient_id=#{patNo}")
  39. String getMzSocialNo(String patNo);
  40. }