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

Commit a0b6b3b

Browse files
authored
update query for groups (#502)
1 parent 092c69d commit a0b6b3b

7 files changed

+7
-7
lines changed

queries/check_is_related_with_challenge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SELECT
55
INNER JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id
66
INNER JOIN user_group_xref ugx ON ugx.group_id = gce.group_id
77
WHERE ce.contest_id = @challengeId@
8-
AND ugx.login_id = @user_id@) AS has_access
8+
AND ((ugx.login_id = @user_id@ AND gce.group_id < 2000000) OR gce.group_id >= 2000000)) AS has_access
99
, (SELECT
1010
1
1111
FROM contest_eligibility ce

queries/get_open_challenges_count

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AND p.project_category_id = pcl.project_category_id
1616
-- Filter out the challenge that user is not belong to.
1717
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
1818
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
19-
where x.login_id = @user_id@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
19+
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
2020
AND ce.contest_id = p.project_id))
2121
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.
2222
-- start of parameters

queries/get_past_challenges_count

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @pr
2828
-- Filter out the challenge that user is not belong to.
2929
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
3030
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
31-
where x.login_id = @user_id@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
31+
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
3232
AND ce.contest_id = p.project_id))
3333
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)

queries/search_past_software_studio_challenges

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ AND NVL((cmc_task_id.value), '') = DECODE('@cmc@', '', NVL((cmc_task_id.value),
105105
-- Filter out the challenge that user is not belong to.
106106
AND (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id)
107107
OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
108-
WHERE x.login_id = @userId@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
108+
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
109109
AND ce.contest_id = p.project_id))
110110
and pp.actual_end_time > '2012-01-01 00:00:00'
111111

queries/search_past_software_studio_challenges_count

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ INNER JOIN project_category_lu pcl on pcl.project_category_id = p.project_catego
1111
LEFT JOIN project_info pi1 ON pi1.project_id = p.project_id AND pi1.project_info_type_id = 1
1212
WHERE (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id)
1313
OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
14-
WHERE x.login_id = 22655028 AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
14+
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
1515
AND ce.contest_id = p.project_id))
1616
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.
1717
AND p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11)

queries/search_software_studio_challenges

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ FIRST @pageSize@
104104
-- Filter out the challenge that user is not belong to.
105105
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
106106
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
107-
where x.login_id = @userId@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
107+
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
108108
AND ce.contest_id = p.project_id))
109109
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.
110110
-- start of parameters

queries/search_software_studio_challenges_count

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ SELECT count(*) AS total
5151
-- Filter out the challenge that user is not belong to.
5252
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)
5353
or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x
54-
where x.login_id = @userId@ AND x.group_id = gce.group_id AND gce.contest_eligibility_id = ce.contest_eligibility_id
54+
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
5555
AND ce.contest_id = p.project_id))
5656
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.
5757
AND pstatus.project_status_id IN (@project_status_id@)

0 commit comments

Comments
 (0)