select h.*,i.staff_name person_name from (SELECT
a.ec_id AS ec_id,
a.region_id AS region_id,
e.region_name AS region_name,
a.production_process_id as production_process_id,
a.production_process_name as production_process_name,
a.production_process_type as production_process_type,
g.entry_name as production_process_type_name,
a.entity_id AS entity_id,
a.create_time as create_time,
a.create_id as create_id,
a.status as status,
max(IF ((d.tag = 'BeginTime'),b.attr_value,NULL)) AS begin_time,
max(IF ((d.tag = 'EndTime'),b.attr_value,NULL)) AS end_time,
max(IF ((d.tag = 'Person'),b.attr_value,NULL)) AS person,
max(IF ((d.tag = 'Event'),b.attr_value,NULL)) AS event
FROM erp_production_process a
LEFT JOIN (select * from entity_attr_value where inure_time <&#