Commit 83e499aa authored by chenzhao's avatar chenzhao

统计首页开发

parent f7c1bf3a
......@@ -204,8 +204,9 @@
<select id="acceptanceStatusTotal" resultType="map">
SELECT
COUNT( * ) total,
CASE WHEN acceptance_check_status = '15' THEN '待提交'
COUNT(*) AS total,
CASE
WHEN acceptance_check_status = '15' THEN '待提交'
WHEN acceptance_check_status = '2' THEN '审核中'
WHEN acceptance_check_status = '3' THEN '已完成'
WHEN acceptance_check_status = '4' THEN '未通过'
......@@ -215,8 +216,17 @@
WHEN acceptance_check_status = '12' THEN '审核中'
WHEN acceptance_check_status = '13' THEN '审核中'
WHEN acceptance_check_status = '14' THEN '审核中'
ELSE '待整改' END AS statusText,
ROUND( COALESCE ( SUM ( ei.real_scale ), 0 ), 2 ) AS realScale
ELSE '待整改'
END AS statusText,
ROUND(COALESCE(SUM(ei.real_scale), 0), 2) AS realScale
FROM
hygf_acceptance_check
LEFT JOIN
hygf_work_order_power_station ps ON ps.sequence_nbr = hygf_acceptance_check.work_order_power_station_id
LEFT JOIN
hygf_power_station_engineering_info ei ON ei.work_order_power_station_id = ps.sequence_nbr
LEFT JOIN
hygf_peasant_household ON hygf_acceptance_check.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
......@@ -240,7 +250,7 @@
SELECT
COUNT( * ) AS total,
status AS statusText,
ROUND( COALESCE ( SUM ( ei.real_scale ), 0 ), 2 ) AS realScale
ROUND(COALESCE(SUM(ei.real_scale), 0), 2) AS realScale
FROM
hygf_financing_info
LEFT JOIN hygf_work_order_power_station ps ON ps.peasant_household_id = hygf_financing_info.peasant_household_id
......@@ -268,12 +278,12 @@
<select id="inverterTotal" resultType="map">
SELECT
COUNT ( * ) total,
COUNT(*) total,
'接入逆变器' AS statusText
FROM
hygf_jp_inverter ji
LEFT JOIN hygf_jp_station jp ON jp.third_station_id = ji.third_station_id
LEFT JOIN privilege_company pc on jp.regional_companies_code = pc.ORG_CODE
LEFT JOIN hygf_jp_station jp ON jp.third_station_id = ji.third_station_id
LEFT JOIN privilege_company pc on jp.regional_companies_code = pc.ORG_CODE
WHERE
jp.regional_companies_code IS NOT NULL
AND jp.amos_company_code IS NOT NULL
......@@ -290,15 +300,15 @@
</foreach>
</if>
UNION ALL
SELECT FLOOR(SUM
( ( LENGTH ( construction_inverter_info ) - LENGTH ( REPLACE ( construction_inverter_info, 'id', '' ) ) ) ) / LENGTH ( 'id' )) AS total,
'户用开发逆变器' AS statusText
SELECT
FLOOR(SUM((LENGTH(construction_inverter_info)-LENGTH(REPLACE(construction_inverter_info,'id',''))))/LENGTH('id')) AS total,
'户用开发逆变器' AS statusText
FROM
hygf_power_station_construction_data
LEFT JOIN
hygf_work_order_power_station on hygf_power_station_construction_data.work_order_power_station_id =hygf_work_order_power_station.sequence_nbr
LEFT JOIN
hygf_peasant_household ON hygf_work_order_power_station.peasant_household_id = hygf_peasant_household.sequence_nbr;
hygf_peasant_household ON hygf_work_order_power_station.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment