ZyDetailChargeDao.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package thyyxxk.webserver.dao.his.datamodify;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import org.apache.ibatis.annotations.Mapper;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.apache.ibatis.annotations.Select;
  6. import org.apache.ibatis.annotations.Update;
  7. import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
  8. /**
  9. * <p>
  10. * Mapper 接口
  11. * </p>
  12. *
  13. * @author 肖蟾
  14. * @description: 住院费用修改
  15. * @since 2021-03-13
  16. */
  17. @Mapper
  18. public interface ZyDetailChargeDao {
  19. /**
  20. * 修改单个住院费用的 金额
  21. *
  22. * @param data 需要修改的数据
  23. * @return 数据
  24. */
  25. @Update("update zy_detail_charge set charge_fee = #{newChargeFee} " +
  26. "where inpatient_no=#{inpatientNo} and detail_sn=#{detailSn} " +
  27. "and admiss_times=#{admissTimes} and ledger_sn=#{ledgerSn} ")
  28. boolean totalModify(ZyDetailCharge data);
  29. /**
  30. * 根据条件 来查询 住院费用
  31. *
  32. * @param page 分页的条件
  33. * @param chargeCodeMx 收费项目码
  34. * @param inpatientNo 住院号
  35. */
  36. @Select("select admiss_times,ledger_sn,detail_sn,charge_date,rtrim(inpatient_no) as inpatient_no," +
  37. "a.serial,infant_flag,charge_status, " +
  38. "op_id_code=rtrim((select name from a_employee_mi where code=op_id_code)), " +
  39. "case when ((select name from zd_charge_item where code = charge_code_mx) is null) then (b.name) " +
  40. "else (select name from zd_charge_item where code = charge_code_mx ) " +
  41. "end as charge_code, " +
  42. "charge_fee,a.self_flag, " +
  43. "ward_code=(select name from zd_unit_code where code = ward_code), " +
  44. "dept_code=(select name from zd_unit_code where code = dept_code), " +
  45. "order_no,ope_flag, " +
  46. "exec_unit=(select name from zd_unit_code where code=exec_unit), " +
  47. "gen_time,a.charge_code_mx,charge_amount " +
  48. "from zy_detail_charge as a " +
  49. "inner join yp_zd_dict as b on (a.charge_code_mx = code and a.serial = b.serial) " +
  50. "where inpatient_no=#{inpatientNo} and charge_code_mx=#{chargeCodeMx} and " +
  51. "admiss_times=(select admiss_times from zy_actpatient where inpatient_no=a.inpatient_no) " +
  52. "and ledger_sn=(select max(ledger_sn) from zy_ledger_file where inpatient_no=a.inpatient_no and admiss_times=a.admiss_times)")
  53. void queryHospitalizationExpenses(IPage<ZyDetailCharge> page,
  54. @Param("inpatientNo") String inpatientNo,
  55. @Param("chargeCodeMx") String chargeCodeMx);
  56. }