FROM house_pv_data.td_hygf_jp_station_power_history where created_time <![CDATA[>=]]> today()-8h and created_time <![CDATA[<]]> today()+1d-8h GROUP BY third_station_id
( SELECT POINT_NAME FROM idx_biz_pv_point_process_variable_classification WHERE GATEWAY_ID = idx_biz_pv_warning_record.GATEWAY_ID AND INDEX_ADDRESS = idx_biz_pv_warning_record.INDEX_ADDRESS ) AS pointName,
WARNING_NAME AS warningName,
count( 1 ) AS num
FROM
idx_biz_pv_warning_record
<where>
<iftest="areaCode != null and areaCode != ''">
ARAE = #{areaCode}
</if>
</where>
GROUP BY
pointName,
WARNING_NAME UNION ALL
SELECT
( SELECT POINT_NAME FROM idx_biz_fan_point_process_variable_classification WHERE GATEWAY_ID = idx_biz_fan_warning_record.GATEWAY_ID AND INDEX_ADDRESS = idx_biz_fan_warning_record.INDEX_ADDRESS ) AS pointName,