yuliang hace 5 años
padre
commit
6272558002
Se han modificado 1 ficheros con 2 adiciones y 14 borrados
  1. 2 14
      whepi-web/src/main/resources/mapper/RbMapper.xml

+ 2 - 14
whepi-web/src/main/resources/mapper/RbMapper.xml

@@ -30,7 +30,7 @@
         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
+        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
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1
@@ -42,12 +42,6 @@
                 and (suho.linkman like concat('%',#{queryProperties},'%')
                 or suho.phone like concat('%',#{queryProperties},'%'))
             </if>
-            <if test="date!=null and date!=''">
-                and msr.report_date = #{date}
-            </if>
-            <if test="date==null or date==''">
-                and msr.report_date = curdate()
-            </if>
         </where>
         order by suu.unit_id asc,suho.linkman
     </select>
@@ -61,7 +55,7 @@
         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
+        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
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1
@@ -73,12 +67,6 @@
                 and (suho.linkman like concat('%',#{queryProperties},'%')
                 or suho.phone like concat('%',#{queryProperties},'%'))
             </if>
-            <if test="date!=null and date!=''">
-                and msr.report_date = #{date}
-            </if>
-            <if test="date==null or date==''">
-                and msr.report_date = curdate()
-            </if>
         </where>
         order by suu.unit_id asc,suho.linkman
     </select>