Skip to content

Commit

Permalink
#3032 Simplify sql statement
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalizer committed Jan 9, 2025
1 parent e45efde commit a08ee3d
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions service/src/main/java/skills/storage/repos/UserPointsRepo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -878,19 +878,7 @@ interface UserPointsRepo extends CrudRepository<UserPoints, Integer> {
FROM user_performed_skill upa
WHERE upa.skill_ref_id in (
select case when copied_from_skill_ref is not null then copied_from_skill_ref else id end as id from skill_definition
where type = 'Skill' and project_id = :projectId and exists (select 1 from subj_skills s_s where s_s.id = id)
) and upa.skill_id in (
select child.skill_id as id
from skill_definition parent,
skill_relationship_definition rel,
skill_definition child
where parent.project_id = :projectId
and parent.skill_id = :subjectId
and rel.parent_ref_id = parent.id
and rel.child_ref_id = child.id
and rel.type in ('RuleSetDefinition', 'GroupSkillToSubject')
and child.type = 'Skill'
and child.enabled = 'true'
where type = 'Skill' and project_id = :projectId and id in (select s_s.id from subj_skills s_s where s_s.id = id)
)
GROUP BY upa.user_id
) upa ON upa.user_id = up.user_id
Expand Down

0 comments on commit a08ee3d

Please sign in to comment.