Untitled

mail@pastecode.io avatar
unknown
sql
7 months ago
1.3 kB
9
Indexable
Never
SELECT
	users.identifier AS identifier_evaluado,
	users.name AS nombre,
	users.lastname AS apellido,
	enterprise_areas.name AS area,
	evaluators.identifier AS identifier_evaluador,
	dimensions.identifier_code AS codigo_dimension,
	evaluation_user_dimensions.score AS score
FROM
	evaluation_user_dimensions
JOIN users ON (
	users.id = evaluation_user_dimensions.user_id
)
JOIN process_dimensions ON (
	process_dimensions.id = evaluation_user_dimensions.process_dimension_id
)
JOIN dimensions ON (
	process_dimensions.dimension_id = dimensions.id
)
JOIN user_enterprise_processes ON (
	user_enterprise_processes.id = evaluation_user_dimensions.user_enterprise_process_id
)
LEFT JOIN users AS evaluators ON (user_enterprise_processes.evaluator_id=evaluators.id)
LEFT JOIN user_enterprise_areas ON (
	users. ID = user_enterprise_areas.user_id
)
LEFT JOIN enterprise_areas ON (
	user_enterprise_areas.enterprise_area_id = enterprise_areas.id
)
WHERE
	user_enterprise_processes.enterprise_process_id = 4597
AND evaluation_user_dimensions.dimension_type = 'competence'
AND process_dimensions.enterprise_process_id = 4597
AND user_enterprise_processes.autoevaluation IS FALSE
AND user_enterprise_processes.evaluation_category_process_id = 6319
AND enterprise_areas.enterprise_process_id= 4597;