Selaa lähdekoodia

Merge remote-tracking branch 'origin/feature_zhujian' into feature_zhujian

Memory_LG 1 vuosi sitten
vanhempi
commit
c4ff3ed25b

+ 2 - 2
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionViewMapper.xml

@@ -184,10 +184,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             count(DISTINCT c.id) gpNum,
             count(DISTINCT e.id) aqNum,
             count(DISTINCT f.id) yxNum,
-            sum(b.storage_capacity) storageCapacity
+            b.storage_capacity storageCapacity
         FROM
             centerdata_t_housingconstruction_enterprise a
-            LEFT JOIN centerdata_t_housingconstruction_storagetank b ON a.id = b.enterprise_id
+            LEFT JOIN (select id, enterprise_id,sum(storage_capacity) storage_capacity from centerdata_t_housingconstruction_storagetank GROUP BY enterprise_id) b ON a.id = b.enterprise_id
             left join centerdata_t_housingconstruction_steelcylinder c on a.id = c.enterprise_id
             left join  (SELECT id,storagetank_id, security_state FROM centerdata_t_housingconstruction_storagetank_log
                     WHERE create_time = (SELECT MAX(create_time) FROM centerdata_t_housingconstruction_storagetank_log) and security_state is null) e on b.id = e.storagetank_id and security_state is null