hanfucheng 10 달 전
부모
커밋
bda5c46741
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionViewMapper.xml

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

@@ -6,16 +6,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="getGasCylinderList" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">
         select
+            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) toUse
-        from centerdata_t_housingconstruction_steelcylinder a
+        from centerdata_t_housingconstruction_enterprise a
+        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
         <where>
             <if test="enterpriseId != null and enterpriseId != ''">
-                and a.enterprise_id = #{enterpriseId}
+                and a.id = #{enterpriseId}
             </if>
             ${params.dataScope}
         </where>
+        GROUP BY a.id
     </select>
 
     <select id="getOrderList" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">