|
@@ -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">
|