源生堂导出sql.txt 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. SELECT
  2. his_order.psn_name AS '姓名',
  3. count(his_order.id) AS '次数',
  4. sum(his_order.medfee_sumamt) AS '医疗费总额',
  5. sum(his_order.fund_pay_sumamt) AS '基金支付金额',
  6. sum(his_order.acct_pay) AS '个人账户支付',
  7. sum(his_order.psn_cash_pay) AS '个人支付金额',
  8. sum(his_order.hifp_pay) AS '基金统筹支付金额',
  9. sum(his_order.hifob_pay) AS '大额基金支付金额',
  10. sum(his_order.maf_pay) AS '医疗救助基金',
  11. sum(his_order.hifes_pay) AS '企业补充医疗保险基金支出',
  12. sum(his_order.hifmi_pay) AS '居民大病基金支出',
  13. sum(his_order.medfee_sumamt) AS '费用总额',
  14. sum(his_order.fulamt_ownpay_amt) AS '全自费总额',
  15. sum(his_order.overlmt_self_pay) AS '超限价自费费用',
  16. sum(his_order.preselfpay_amt) AS '先行自付费用',
  17. sum(his_order.psn_part_amt) AS '个人负担',
  18. sum(his_order.acct_pay) AS '个人账户支出',
  19. sum(his_order.psn_cash_pay) AS '个人现金支出',
  20. sum(his_order.hosp_part_amt) AS '医院负担金额',
  21. sum(his_order.acct_mulaid_pay) AS '个人账户共计支付',
  22. sum(his_order.oth_pay) AS '其他支付'
  23. FROM
  24. his_order
  25. WHERE
  26. his_order.user_org_id = 10088
  27. AND his_order.order_status = 2
  28. AND his_order.setl_time >= '2023-01-01 00:00:00'
  29. AND his_order.setl_time <= '2023-01-31 23:59:59'
  30. AND his_order.STATUS = 1
  31. GROUP BY
  32. his_order.patient_id