Revert "removed technician classification since we can get that table from google sheets"

This reverts commit e3a13374db.
master
dtookey 4 years ago
parent 48dc463cd4
commit 5453cc0c31

@ -33,3 +33,17 @@ ALTER TABLE project_lifecycle
CREATE OR REPLACE INDEX lifecycle_timestamp on project_lifecycle (timestamp);
CREATE OR REPLACE INDEX lifecycle_newval on project_lifecycle (new_value);
######### technician categories ##############
CREATE OR REPLACE TABLE technician_category AS
SELECT DISTINCT users.email,
CONCAT(SUBSTR(ap.refnum, 1, 3), ' - ',
IF(ap.proj_type = 'Warranty', 'Structural', ap.proj_type)) AS flavor,
count(email) AS count
FROM users
INNER JOIN dispatch d ON users.pkey = d.dispatched_to
INNER JOIN all_projects ap ON d.project_fkey = ap.refnum
#where date_dispatched between NOW() - INTERVAL 180 DAY AND NOW()
GROUP BY flavor, email
ORDER BY count DESC;

Loading…
Cancel
Save