MakeDbzFeesDao.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package thyyxxk.webserver.dao.his.makedbzfees;
  2. import org.apache.ibatis.annotations.*;
  3. import thyyxxk.webserver.entity.makedbzfees.InpatientInfo;
  4. import thyyxxk.webserver.entity.makedbzfees.ZyDetailCharge;
  5. import java.util.List;
  6. /**
  7. * @author dj
  8. */
  9. @Mapper
  10. public interface MakeDbzFeesDao {
  11. @Select("select rtrim(mz_no) from a_patient_mi with(nolock) where inpatient_no=#{inpatientNo}")
  12. String getPatientId(@Param("inpatientNo") String inpatientNo);
  13. @Select("select rtrim(inpatient_no) from a_patient_mi with(nolock) where mz_no=#{patientId}")
  14. String getInpatientNo(@Param("patientId") String patientId);
  15. @Select("select rtrim(inpatient_no) inpatientNo, " +
  16. "admiss_times," +
  17. "rtrim(admiss_ward) wardCode, " +
  18. "rtrim(small_dept) deptCode, " +
  19. "rtrim(isnull(operation, '')) as operation, " +
  20. "rtrim(refer_physician) referPhysician, " +
  21. "rtrim(consult_physician) consultPhysician, " +
  22. "ledgerSn=(select max(ledger_sn) from zy_ledger_file with(nolock) " +
  23. "where inpatient_no=a.inpatient_no and admiss_times=a.admiss_times), " +
  24. "maxDetailSn=(select max(detail_sn) from zy_detail_charge with(nolock) " +
  25. "where inpatient_no=a.inpatient_no and admiss_times=a.admiss_times) " +
  26. "from zy_actpatient a with(nolock) where inpatient_no=#{inpatientNo}")
  27. InpatientInfo getInpatientInfo(@Param("inpatientNo") String inpatientNo);
  28. @Insert("<script>" +
  29. "insert into zy_detail_charge (inpatient_no,admiss_times,ledger_sn,detail_sn,charge_date,op_id_code, " +
  30. "charge_code,infant_flag,charge_status,charge_amount,charge_fee,ward_code,dept_code,order_no,ope_flag, " +
  31. "gen_time,charge_code_mx,serial,doctor_code,trans_flag_yb,refer_physician,consult_physician,exec_unit) VALUES " +
  32. "<foreach collection='list' item='fee' separator=',' open='' close=''>" +
  33. "(#{info.inpatientNo}, #{info.admissTimes}, #{info.ledgerSn}, #{fee.detailSn}, getDate(), #{info.staffId}, " +
  34. "#{fee.chargeCode}, 0, 2, #{fee.chargeAmount}, #{fee.chargeFee}, #{info.wardCode}, #{info.deptCode}, 1, " +
  35. "#{info.operation},getDate(), #{fee.chargeCodeMx},#{fee.serial},#{fee.doctorCode},0,#{info.referPhysician}," +
  36. "#{info.consultPhysician},#{fee.execDept})" +
  37. "</foreach>" +
  38. "</script>")
  39. void insertZyDetailChargeForSingleDisease(@Param("info") InpatientInfo info, @Param("list")List<ZyDetailCharge> zyFees);
  40. @Select("select rtrim(specification) from yp_zd_dict with(nolock) where code=#{code} and serial=#{serial}")
  41. String selectSpecification(@Param("code") String code, @Param("serial") String serial);
  42. @Select("select rtrim(supply_name) from mz_zd_supply_type with(nolock) where supply_code=#{code}")
  43. String selectSupplyName(@Param("code") String code);
  44. @Select("select rtrim(charge_unit) from zd_charge_item with(nolock) where code=#{code}")
  45. String selectXmChargeUnit(@Param("code") String code);
  46. @Select("select rtrim(name) from yp_zd_unit with(nolock) where code=#{code}")
  47. String selectDrugUnit(@Param("code") String code);
  48. }