Browse Source

关键条目sql调整

chengyao 3 years ago
parent
commit
895947f955
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/main/resources/mapper/BehospitalInfoMapper.xml

+ 6 - 4
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -6770,7 +6770,7 @@
         GROUP BY
         c.doctorId,
         c.doctorName
-        having  sum( d.cases_entry_id = 2511 ) is not null
+        having  sum( d.cases_entry_id = 2511 ) is not null and sum( d.cases_entry_id = 2511 ) != 0
         ) UNION
         (
         SELECT
@@ -6853,7 +6853,9 @@
         GROUP BY
         d.doctor_id,
         d.doctor_name
-        having  sum( e.cases_entry_id = 2594 ) is not null and sum( e.cases_entry_id = 2973 ) is not null and sum( e.cases_entry_id = 2930 )is not null
+        having  sum( e.cases_entry_id = 2594 ) is not null and sum( e.cases_entry_id = 2594 ) != 0
+        and sum( e.cases_entry_id = 2973 ) is not null and sum( e.cases_entry_id = 2973 ) != 0
+         and sum( e.cases_entry_id = 2930 )is not null and sum( e.cases_entry_id = 2930 ) != 0
         ) UNION
         (
         SELECT
@@ -6932,7 +6934,7 @@
         GROUP BY
         c.doctor_id,
         c.doctor_name
-        having  sum( d.cases_entry_id = 2419 ) is not null
+        having  sum( d.cases_entry_id = 2419 ) is not null and sum( d.cases_entry_id = 2419 ) != 0
         ) UNION
         (
         SELECT
@@ -7011,7 +7013,7 @@
         GROUP BY
         b.doctor_id,
         b.doctor_name
-        having  sum(c.cases_entry_id = 2495) is not null
+        having  sum(c.cases_entry_id = 2495) is not null sum(c.cases_entry_id = 2495)!= 0
         ) UNION
         (
         SELECT