فهرست منبع

fix:
修改了一些bug

18339543638 1 سال پیش
والد
کامیت
116661cb1f
1فایلهای تغییر یافته به همراه57 افزوده شده و 47 حذف شده
  1. 57 47
      nb-service/web-service/src/main/resources/mapper/bus/BusPatientMapper.xml

+ 57 - 47
nb-service/web-service/src/main/resources/mapper/bus/BusPatientMapper.xml

@@ -115,55 +115,65 @@
     </resultMap>
 
     <select id="selectRepeatDevice" resultMap="repeatDeviceResult">
-                     SELECT
-                     p.id as patient_id,
-             p.code as code,
-             p.infusion_id as master_infusion_id,
-             c.patient_gender  as gender,
-             c.`patient_name` as name,
-             c.patient_age as age,
-             c.ward,
-             c.bed_no,
-             c.id as clinic_id,
-             c.`surgery_name` as clinic_name,
-             i.device_id as device_id,
-             i.id as infusion_id,
-             d.alias as device_alias,
-             i.run_state as device_run_state,
-             i.alarm as device_alarm,
-             i.start_time as infusion_start_time
-            FROM (SELECT `name`,gender,infusion_id,CODE,id FROM bus_patient WHERE bus_patient.`alarm`=1) AS p
-            join  (select * from bus_infusion_history where is_undo=0 and finished=0) as i on i.patient_id=p.id
-            join (select device_id,alias from bus_device) as d on d.device_id=i.device_id
-            join  (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON  c.`patient_id`=p.id;
-        </select>
+        SELECT
+        p.id as patient_id,
+        p.code as code,
+        p.infusion_id as master_infusion_id,
+        c.patient_gender  as gender,
+        c.`patient_name` as name,
+        c.patient_age as age,
+        c.ward,
+        c.bed_no,
+        c.id as clinic_id,
+        c.`surgery_name` as clinic_name,
+        i.device_id as device_id,
+        i.id as infusion_id,
+        d.alias as device_alias,
+        i.run_state as device_run_state,
+        i.alarm as device_alarm,
+        i.start_time as infusion_start_time
+        FROM (SELECT `name`,gender,infusion_id,CODE,id,tenant_id FROM bus_patient WHERE bus_patient.`alarm`=1) AS p
+        join  (select * from bus_infusion_history where is_undo=0 and finished=0) as i on i.patient_id=p.id
+        join (select device_id,alias from bus_device) as d on d.device_id=i.device_id
+        join  (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON  c.`patient_id`=p.id;
+        <where>
+            <if test="query.tenantId!=null">
+                and p.tenant_id=#{query.tenantId}
+            </if>
+        </where>
+    </select>
 
     <select id="selectNoneDevice" resultMap="deviceNone">
-            SELECT
-             p.id as patient_id,
-             p.code as code,
-             c.id as clinic_id,
-             c.patient_gender as gender,
-             c.`patient_name` as name,
-             c.patient_age as age,
-             c.ward as ward,
-             c.bed_no as bed_no,
-             c.`surgery_name` as surgery_name,
-             c.weight as weight,
-             c.height as height,
-             c.ana_doctor as ana_doctor,
-             c.ana_type as ana_type,
-             c.anal_type as anal_type,
-             c.surgery_doctor as surgery_doctor,
-             c.asa as asa,
-             c.formula as formula,
-             c.finished as finished,
-             c.monitor_start_time as monitor_start_time,
-             c.config_person as config_person
-            FROM (SELECT `name`,gender,CODE,tenant_id,id FROM bus_patient WHERE bus_patient.`alarm`=2 ) AS p
-            join  (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON  c.`patient_id`=p.id
-            order by c.monitor_start_time desc;
-        </select>
+        SELECT
+            p.id as patient_id,
+            p.code as code,
+            c.id as clinic_id,
+            c.patient_gender as gender,
+            c.`patient_name` as name,
+            c.patient_age as age,
+            c.ward as ward,
+            c.bed_no as bed_no,
+            c.`surgery_name` as surgery_name,
+            c.weight as weight,
+            c.height as height,
+            c.ana_doctor as ana_doctor,
+            c.ana_type as ana_type,
+            c.anal_type as anal_type,
+            c.surgery_doctor as surgery_doctor,
+            c.asa as asa,
+            c.formula as formula,
+            c.finished as finished,
+            c.monitor_start_time as monitor_start_time,
+            c.config_person as config_person
+        FROM (SELECT `name`,gender,CODE,tenant_id,id,tenant_id FROM bus_patient WHERE bus_patient.`alarm`=2 ) AS p
+                 join  (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON  c.`patient_id`=p.id
+        <where>
+            <if test="query.tenantId!=null">
+                and p.tenant_id=#{query.tenantId}
+            </if>
+        </where>
+        order by c.monitor_start_time desc;
+    </select>
 
     <select id="selectMonitor" resultMap="monitorResult" parameterType="com.nb.web.api.feign.query.PatientMonitorQuery">
         select