Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

update query for groups #502

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion queries/check_is_related_with_challenge
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SELECT
INNER JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id
INNER JOIN user_group_xref ugx ON ugx.group_id = gce.group_id
WHERE ce.contest_id = @challengeId@
AND ugx.login_id = @user_id@) AS has_access
AND ((ugx.login_id = @user_id@ AND gce.group_id < 2000000) OR gce.group_id >= 2000000)) AS has_access
, (SELECT
1
FROM contest_eligibility ce
Expand Down
2 changes: 1 addition & 1 deletion queries/get_open_challenges_count
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AND p.project_category_id = pcl.project_category_id
-- Filter out the challenge that user is not belong to.
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
where x.login_id = @user_id@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = @user_id@) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id
AND ce.contest_id = p.project_id))
AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest.
-- start of parameters
Expand Down
2 changes: 1 addition & 1 deletion queries/get_past_challenges_count
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @pr
-- Filter out the challenge that user is not belong to.
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
where x.login_id = @user_id@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = @user_id@) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id
AND ce.contest_id = p.project_id))
AND not exists (select 1 from resource r, project_info pi82 where r.project_id = p.project_id and r.resource_role_id = 1 and p.project_id = pi82.project_id and project_info_type_id = 82 and pi82.value = 1)
2 changes: 1 addition & 1 deletion queries/search_past_software_studio_challenges
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ AND NVL((cmc_task_id.value), '') = DECODE('@cmc@', '', NVL((cmc_task_id.value),
-- Filter out the challenge that user is not belong to.
AND (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id)
OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
WHERE x.login_id = @userId@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
WHERE ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = @user_id@) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id
AND ce.contest_id = p.project_id))
and pp.actual_end_time > '2012-01-01 00:00:00'

Expand Down
2 changes: 1 addition & 1 deletion queries/search_past_software_studio_challenges_count
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ INNER JOIN project_category_lu pcl on pcl.project_category_id = p.project_catego
LEFT JOIN project_info pi1 ON pi1.project_id = p.project_id AND pi1.project_info_type_id = 1
WHERE (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id)
OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
WHERE x.login_id = 22655028 AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
WHERE ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id
AND ce.contest_id = p.project_id))
AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest.
AND p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11)
Expand Down
2 changes: 1 addition & 1 deletion queries/search_software_studio_challenges
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ FIRST @pageSize@
-- Filter out the challenge that user is not belong to.
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
where x.login_id = @userId@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id
AND ce.contest_id = p.project_id))
AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest.
-- start of parameters
Expand Down
2 changes: 1 addition & 1 deletion queries/search_software_studio_challenges_count
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SELECT count(*) AS total
-- Filter out the challenge that user is not belong to.
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
where x.login_id = @userId@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id
AND ce.contest_id = p.project_id))
AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest.
AND pstatus.project_status_id IN (@project_status_id@)
Expand Down