Bladeren bron

修复AI sql问题

hsh 1 maand geleden
bovenliggende
commit
3e5be28bfd
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      src/main/java/thyyxxk/webserver/dao/his/highreport/AllStatisticsDao.java

+ 3 - 3
src/main/java/thyyxxk/webserver/dao/his/highreport/AllStatisticsDao.java

@@ -76,9 +76,9 @@ public interface AllStatisticsDao {
             "   join zd_charge_item c on a.charge_code = c.code " +
             "   left join zy_zd_audit_item d on c.audit_code = d.code " +
             "   join zy_zd_audit_report e on d.parent_code = e.code " +
+            "   join zy_patient f on a.inpatient_no = f.inpatient_no and a.admiss_times = f.admiss_times " +
             "   left join zd_unit_code z on (case when isnull(a.exec_unit, '') = '' then " +
             "       (case when isnull(f.zk_ward, '') = '' then a.ward_code else f.zk_ward end) else a.exec_unit end) = z.code " +
-            "   join zy_patient f on a.inpatient_no = f.inpatient_no and a.admiss_times = f.admiss_times " +
             "where " +
             "   a.charge_date >= #{startTime} " +
             "   and a.charge_date <= #{endTime} " +
@@ -120,7 +120,7 @@ public interface AllStatisticsDao {
             "        z.code as ksid, " +
             "        max(d.parent_code) as flm, " +
             "        max(e.name) as flmc, " +
-            "        isnull(sum(round(convert(decimal(18,3),((convert(decimal(18,3),unit_price)) * (quantity * isnull(drug_win,1))),2)),0) as totalCharge, " +
+            "        isnull(sum(round(convert(decimal(18,3),((convert(decimal(18,3),unit_price)) * (quantity * isnull(drug_win,1)))),2)),0) as totalCharge, " +
             "        max(d.name) as hsmc, " +
             "        c.audit_code as hsm " +
             "   from mz_charge_detail a(nolock) " +
@@ -158,7 +158,7 @@ public interface AllStatisticsDao {
             "        z.code as ksid, " +
             "        max(d.parent_code) as flm, " +
             "        max(e.name) as flmc, " +
-            "        isnull(sum(round(convert(decimal(18,3),((convert(decimal(18,3),unit_price)) * (quantity * isnull(drug_win,1))),2)),0) as totalCharge, " +
+            "        isnull(sum(round(convert(decimal(18,3),((convert(decimal(18,3),unit_price)) * (quantity * isnull(drug_win,1)))),2)),0) as totalCharge, " +
             "        max(d.name) as hsmc, " +
             "        c.audit_code as hsm " +
             "   from mz_charge_detail a(nolock) " +