END AS licenseOk from tz_base_unit_licence ul where cu.credit_code = ul.unit_code) as strKey
END AS licenseOk from tz_base_unit_licence ul where cu.use_code = ul.unit_code) as strKey
FROM
FROM
tz_cylinder_unit cu
tz_base_enterprise_info cu
where
where
cu.unit_status = '1210'
cu.data_sources = '陕西省内企业'
and cu.region_code like concat('%', #{regionCode}, '%')
AND cu.unit_type LIKE '%充装单位%'
and cu.org_code like concat('%', #{regionCode}, '%')
GROUP BY strKey
GROUP BY strKey
</select>
</select>
...
@@ -41,11 +42,12 @@
...
@@ -41,11 +42,12 @@
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((COUNT(CASE WHEN ci.next_inspection_date <![CDATA[<=]]> now() THEN 1 END) * 100.0 / COUNT(*)), 2) END AS expiredRate
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((COUNT(CASE WHEN ci.next_inspection_date <![CDATA[<=]]> now() THEN 1 END) * 100.0 / COUNT(*)), 2) END AS expiredRate
FROM
FROM
"tz_cylinder_inspection" ci
"tz_cylinder_inspection" ci
LEFT JOIN tz_cylinder_unit cu on ci.app_id = cu.app_id
LEFT JOIN tz_base_enterprise_info cu on ci.app_id = cu.app_id
<where>
<where>
cu.unit_status = '1210'
cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%'
<iftest="regionCode != null and regionCode != ''">
<iftest="regionCode != null and regionCode != ''">
and cu.region_code like concat('%', #{regionCode}, '%')
and cu.org_code like concat(#{regionCode}, '%')
</if>
</if>
<iftest="appId != null and appId != ''">
<iftest="appId != null and appId != ''">
and cu.app_id = #{appId}
and cu.app_id = #{appId}
...
@@ -58,15 +60,85 @@
...
@@ -58,15 +60,85 @@
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((COUNT(CASE WHEN ci.inspection_result = '3123' THEN 1 END) * 100.0 / COUNT(*)), 2) END AS resultRate
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((COUNT(CASE WHEN ci.inspection_result = '3123' THEN 1 END) * 100.0 / COUNT(*)), 2) END AS resultRate
FROM
FROM
"tz_cylinder_inspection" ci
"tz_cylinder_inspection" ci
LEFT JOIN tz_cylinder_unit cu on ci.app_id = cu.app_id
LEFT JOIN tz_base_enterprise_info cu on ci.app_id = cu.app_id
<where>
<where>
cu.unit_status = '1210'
cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%'
<iftest="regionCode != null and regionCode != ''">
<iftest="regionCode != null and regionCode != ''">
and cu.region_code like concat('%', #{regionCode}, '%')