

-- MATCH (contract:/mingdao1/contract WHERE attr15 > 1e+06)-[:is_contract_of_project*1..1]->(project:/mingdao1/project WHERE attr40 like '已完成%' AND attr45 >= '2024-01-01' AND attr45 <= '2024-12-31')<-[:is_admin_of_project*1..1]-(staff:/mingdao1/staff), (staff:/mingdao1/staff)-[:is_solve_person_of_case*1..1]->(case:/mingdao1/case) RETURN staff.id AS "员工ID", staff.attr1 AS "员工姓名", count(case.id) AS "解决案例数量" GROUP BY staff.id, staff.attr1


MATCH (case:/mingdao1/case WHERE attr30 between '2024-01-01' AND '2024-12-31')-[:is_case_of_project*1..1]->(project:/mingdao1/project WHERE attr33 = '南区事业部'), (staff:/mingdao1/staff)-[:is_solve_person_of_case*1..1]->(case:/mingdao1/case WHERE attr30 between '2024-01-01' AND '2024-12-31') RETURN staff.attr24 AS "department", staff.attr1 AS "staff_name", case.attr0 AS "case_id" INTO temp_result;
 
SELECT t.department AS "部门", t.staff_name AS "员工姓名", count(t.case_id) AS "解决CASE数量" FROM temp_result t GROUP BY t.department, t.staff_name ORDER BY 解决CASE数量 DESC
/**
output()
**/
;
