hanfucheng 9 ماه پیش
والد
کامیت
9e095c7205
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionViewMapper.xml

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

@@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.enterprise_name enterpriseName,
             a.enterprise_name enterpriseName,
             IFNULL(sum( CASE WHEN state = 'state_4' THEN 1 ELSE 0 END ),0) inUse,
             IFNULL(sum( CASE WHEN state = 'state_4' THEN 1 ELSE 0 END ),0) inUse,
             IFNULL(sum( CASE WHEN state != 'state_4' THEN 1 ELSE 0 END ),0) toUse,
             IFNULL(sum( CASE WHEN state != 'state_4' THEN 1 ELSE 0 END ),0) toUse,
-            IFNULL(round(IFNULL(sum( CASE WHEN state = 'state_4' THEN 1 ELSE 0 END ),0)/IFNULL(sum( CASE WHEN state != 'state_4' THEN 1 ELSE 0 END ),0),2),0) useRate
+            IFNULL(round(IFNULL(sum( CASE WHEN state = 'state_4' THEN 1 ELSE 0 END ),0)/count(b.id),2),0)*100 useRate
         from centerdata_t_housingconstruction_enterprise a
         from centerdata_t_housingconstruction_enterprise a
         left join centerdata_t_housingconstruction_steelcylinder b on a.id = b.enterprise_id
         left join centerdata_t_housingconstruction_steelcylinder b on a.id = b.enterprise_id
         LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
         LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id