yuliang 5 năm trước cách đây
mục cha
commit
cc0e65feff
1 tập tin đã thay đổi với 22 bổ sung3 xóa
  1. 22 3
      whepi-web/src/main/resources/mapper/RbMapper.xml

+ 22 - 3
whepi-web/src/main/resources/mapper/RbMapper.xml

@@ -9,7 +9,13 @@
         mss.medical,mss.temperature,mss.cough,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult,tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other
         from sys_uptown_house suh
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
-        INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
+        INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and
+        <if test="date!=null and date!=''">
+            msr.report_date = #{date}
+        </if>
+        <if test="date==null or date==''">
+            msr.report_date = curdate()
+        </if>
         left join ms_report msr on msr.house_id = suh.house_id and msr.report_date = #{date}
         left join ms_suspected mss on mss.report_id=msr.report_id
         left join ms_trip tr on mss.suspected_id=trip_id
@@ -30,7 +36,13 @@
         from sys_uptown_house suh
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
         INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
-        left join ms_report msr on msr.house_id = suh.house_id and msr.report_date = #{date}
+        left join ms_report msr on msr.house_id = suh.house_id and
+        <if test="date!=null and date!=''">
+            msr.report_date = #{date}
+        </if>
+        <if test="date==null or date==''">
+            msr.report_date = curdate()
+        </if>
         left join ms_suspected mss on mss.report_id=msr.report_id
         left join ms_trip tr on mss.suspected_id=trip_id
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1
@@ -42,6 +54,7 @@
                 and (suho.linkman like concat('%',#{queryProperties},'%')
                 or suho.phone like concat('%',#{queryProperties},'%'))
             </if>
+
         </where>
         order by suu.unit_id asc,suho.linkman
     </select>
@@ -55,7 +68,13 @@
         from sys_uptown_house suh
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
         INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
-        left join ms_report msr on msr.house_id = suh.house_id and msr.report_date = #{date}
+        left join ms_report msr on msr.house_id = suh.house_id and
+        <if test="date!=null and date!=''">
+            msr.report_date = #{date}
+        </if>
+        <if test="date==null or date==''">
+            msr.report_date = curdate()
+        </if>
         left join ms_suspected mss on mss.report_id=msr.report_id
         left join ms_trip tr on mss.suspected_id=trip_id
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1