

MATCH (case:/mingdao1/case)
-[:is_case_of_project*1..1]->
(project:/mingdao1/project WHERE attr33 = '南区事业部' AND attr45 >= '2024-01-01' AND attr45 <= '2024-12-31'), 
(staff:/mingdao1/staff)
-[:is_solve_person_of_case*1..1]->
(case:/mingdao1/case)
 RETURN staff.attr25 AS "dept", staff.attr1 AS "staff_name", case.attr0 AS "case_id"
/**
output()
**/
;



MATCH (case:/mingdao1/case)
-[:is_case_of_project*1..1]->
(project:/mingdao1/project WHERE attr33 = '南区事业部' AND attr45 >= '2024-01-01' AND attr45 <= '2024-12-31'), 
(staff:/mingdao1/staff)
-[:is_solve_person_of_case*1..1]->
(case:/mingdao1/case)
 RETURN staff.attr25 AS "dept", staff.attr1 AS "staff_name", case.attr0 AS "case_id" INTO /temp01 ;

select * from /temp01
/**
output()
**/
;


SELECT t1.dept AS "部门", t1.staff_name AS "员工姓名", count(t1.case_id) AS "解决CASE数量" FROM /temp01 t1 GROUP BY t1.dept, t1.staff_name
/**
output()
**/
;


SELECT t1.dept AS "部门", t1.staff_name AS "员工姓名", count(t1.case_id) AS "解决CASE数量" FROM /temp01 t1 GROUP BY t1.dept, t1.staff_name ORDER BY 解决CASE数量 DESC
/**
output()
**/
;

