Sfoglia il codice sorgente

优化查询速度

LAPTOP-FO2T5SIU\35838 2 mesi fa
parent
commit
b8975d715b

+ 2 - 2
pro-base/src/main/resources/mybatis/customerManagement/CustomerManagementExtendMapper.xml

@@ -84,8 +84,8 @@
 
     <select id="reportList" resultType="com.idea.customerManagement.dto.CustomerManagementDto">
       select p.group_name,p.group_id,f.id discId, f.name disc_name,
-             (select count(1) from mnp_building where disc_id = f.id) buildCount,
-             (select count(1) from park_room where disc_id = f.id) roomCount
+      count(DISTINCT(r.build_id)) buildCount,
+      count(DISTINCT(r.id)) roomCount
       from park_floor_disc f
       left join park_info p on p.id = f.group_id
       left join park_room r on r.disc_id = f.id