Переглянути джерело

update 周统计 周数改为计算一年周数

A17404李放 3 роки тому
батько
коміт
c6c168f2a7

+ 5 - 5
nb-system/src/main/resources/mapper/bus/BusClinicMapper.xml

@@ -129,15 +129,15 @@
             </if>
         </where>
         ) as c
-        left join (select * from bus_patient
+        left join (select * from bus_patient)
+         as p on c.patient_id = p.id
+        left join  (select clinic_id,count(1) as infusion_count from bus_infusion_history GROUP BY clinic_id) as i on i.clinic_id=c.id
+        left join (select clinic_id,count(1) as eval_count from bus_evaluation  GROUP BY clinic_id) as eval on eval.clinic_id=c.id
         <where>
             <if test="query.patientCode!=null">
-                and code like concat('%',#{query.patientCode},'%')
+                and patient_code like concat('%',#{query.patientCode},'%')
             </if>
         </where>
-        ) as p on c.patient_id = p.id
-        left join  (select clinic_id,count(1) as infusion_count from bus_infusion_history GROUP BY clinic_id) as i on i.clinic_id=c.id
-        left join (select clinic_id,count(1) as eval_count from bus_evaluation  GROUP BY clinic_id) as eval on eval.clinic_id=c.id
         <if test="(query.orderByDesc!=null and query.orderByDesc.size > 0 ) or (query.orderByAsc!=null and query.orderByAsc.size > 0)">
             order by
         </if>

+ 6 - 6
nb-system/src/main/resources/mapper/bus/BusDeviceMapper.xml

@@ -63,12 +63,6 @@
             <if test="query.deviceId!=null">
                 and device_id like concat('%',#{query.deviceId},'%')
             </if>
-            <if test="query.deviceTypes != null and query.deviceTypes.size > 0">
-                and type in
-                <foreach item="type" index="index" collection="query.deviceTypes" open="(" separator="," close=")">
-                    #{type, jdbcType=VARCHAR}
-                </foreach>
-            </if>
             <if test="query.alias!=null">
                 and alias like concat('%',#{query.alias},'%')
             </if>
@@ -79,6 +73,12 @@
         ) AS d
         LEFT JOIN (select * from bus_infusion_history) as i
         on i.id=d.infusion_id
+        <if test="query.deviceTypes != null and query.deviceTypes.size > 0">
+            and type in
+            <foreach item="type" index="index" collection="query.deviceTypes" open="(" separator="," close=")">
+                #{type, jdbcType=VARCHAR}
+            </foreach>
+        </if>
         order by d.create_time desc
     </select>