first attempt at contribution metrics
parent
d6048d4f45
commit
eb456449d2
@ -0,0 +1,15 @@
|
||||
CREATE OR REPLACE TABLE engineer_contributions AS
|
||||
SELECT CONCAT(users.lname, ', ', users.fname) AS `Engineer`,
|
||||
project_lifecycle.project_number AS `Project Number`,
|
||||
project_lifecycle.timestamp,
|
||||
substr(new_value, 2) AS `Project Type`,
|
||||
CONCAT(SUBSTR(project_lifecycle.project_number, 1, 3), ' - ',
|
||||
IF(ap.proj_type = 'Warranty', 'Structural', ap.proj_type)) as `Region`,
|
||||
clients.name as `Client`
|
||||
FROM users
|
||||
INNER JOIN project_lifecycle ON pkey = modifier
|
||||
INNER JOIN all_projects ap on project_lifecycle.project_number = ap.refnum
|
||||
INNER JOIN contacts on ap.contact_fkey = contacts.pkey
|
||||
INNER JOIN clients on contacts.cl_fkey = clients.pkey
|
||||
WHERE project_lifecycle.new_value IN ('+SEALED')
|
||||
AND users.priv & POW(2, 25);
|
||||
Loading…
Reference in New Issue