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

Commit e629991

Browse files
committed
Merge pull request #398 from flytoj2ee/dev
TC API - Get Rounds API
2 parents 808ed5e + 873c362 commit e629991

22 files changed

+2882
-3
lines changed

actions/rounds.js

Lines changed: 426 additions & 0 deletions
Large diffs are not rendered by default.

apiary.apib

Lines changed: 357 additions & 0 deletions
Large diffs are not rendered by default.

queries/get_data_round_type_lu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SELECT DISTINCT round_type_desc AS name
2+
, round_type_id AS id
3+
FROM round_type_lu
4+
ORDER BY name ASC;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name" : "get_data_round_type_lu",
3+
"db" : "informixoltp",
4+
"sqlfile" : "get_data_round_type_lu"
5+
}

queries/get_round_terms_by_ids

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
select round_id, terms_content from round_terms where round_id in (@roundIdList@)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name" : "get_round_terms_by_ids",
3+
"db" : "informixoltp",
4+
"sqlfile" : "get_round_terms_by_ids"
5+
}

queries/get_rounds

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
SELECT
2+
SKIP @firstRowIndex@
3+
FIRST @pageSize@
4+
r.round_id as id,
5+
r.name as name,
6+
r.short_name as short_name,
7+
rt.round_type_desc,
8+
CASE WHEN (UPPER(r.status) = 'A') THEN
9+
'Active'
10+
WHEN (UPPER(r.status) = 'P') THEN
11+
'Past'
12+
WHEN (UPPER(r.status) = 'F') THEN
13+
'Draft'
14+
ELSE NULL
15+
END AS round_status,
16+
r.registration_limit,
17+
CASE WHEN (r.invitational = 0) THEN
18+
'Not'
19+
WHEN (r.invitational = 1) THEN
20+
'Normal'
21+
WHEN (r.invitational = 2) THEN
22+
'Negate'
23+
ELSE NULL
24+
END AS invitational,
25+
reg.region_name,
26+
rs1.start_time as start_time_1,
27+
rs1.end_time as end_time_1,
28+
CASE WHEN (UPPER(rs1.status) = 'A') THEN
29+
'Active'
30+
WHEN (UPPER(rs1.status) = 'P') THEN
31+
'Past'
32+
WHEN (UPPER(rs1.status) = 'F') THEN
33+
'Draft'
34+
ELSE NULL
35+
END as status_1,
36+
((select segment_desc from segment where segment_id = 1) || ' Phase') as name_1,
37+
rs2.start_time as start_time_2,
38+
rs2.end_time as end_time_2,
39+
CASE WHEN (UPPER(rs2.status) = 'A') THEN
40+
'Active'
41+
WHEN (UPPER(rs2.status) = 'P') THEN
42+
'Past'
43+
WHEN (UPPER(rs2.status) = 'F') THEN
44+
'Draft'
45+
ELSE NULL
46+
END as status_2,
47+
(select segment_desc from segment where segment_id = 2) as name_2,
48+
rs3.start_time as start_time_3,
49+
rs3.end_time as end_time_3,
50+
CASE WHEN (UPPER(rs3.status) = 'A') THEN
51+
'Active'
52+
WHEN (UPPER(rs3.status) = 'P') THEN
53+
'Past'
54+
WHEN (UPPER(rs3.status) = 'F') THEN
55+
'Draft'
56+
ELSE NULL
57+
END as status_3,
58+
(select segment_desc from segment where segment_id = 3) as name_3,
59+
rs4.start_time as start_time_4,
60+
rs4.end_time as end_time_4,
61+
CASE WHEN (UPPER(rs4.status) = 'A') THEN
62+
'Active'
63+
WHEN (UPPER(rs4.status) = 'P') THEN
64+
'Past'
65+
WHEN (UPPER(rs4.status) = 'F') THEN
66+
'Draft'
67+
ELSE NULL
68+
END as status_4,
69+
(select segment_desc from segment where segment_id = 4) as name_4,
70+
rs5.start_time as start_time_5,
71+
rs5.end_time as end_time_5,
72+
CASE WHEN (UPPER(rs5.status) = 'A') THEN
73+
'Active'
74+
WHEN (UPPER(rs5.status) = 'P') THEN
75+
'Past'
76+
WHEN (UPPER(rs5.status) = 'F') THEN
77+
'Draft'
78+
ELSE NULL
79+
END as status_5,
80+
(select segment_desc from segment where segment_id = 5) as name_5,
81+
rs6.start_time as start_time_6,
82+
rs6.end_time as end_time_6,
83+
CASE WHEN (UPPER(rs6.status) = 'A') THEN
84+
'Active'
85+
WHEN (UPPER(rs6.status) = 'P') THEN
86+
'Past'
87+
WHEN (UPPER(rs6.status) = 'F') THEN
88+
'Draft'
89+
ELSE NULL
90+
END as status_6,
91+
(select segment_desc from segment where segment_id = 6) as name_6,
92+
rs7.start_time as start_time_7,
93+
rs7.end_time as end_time_7,
94+
CASE WHEN (UPPER(rs7.status) = 'A') THEN
95+
'Active'
96+
WHEN (UPPER(rs7.status) = 'P') THEN
97+
'Past'
98+
WHEN (UPPER(rs7.status) = 'F') THEN
99+
'Draft'
100+
ELSE NULL
101+
END as status_7,
102+
(select segment_desc from segment where segment_id = 7) as name_7
103+
FROM (round r
104+
LEFT OUTER JOIN round_type_lu rt
105+
ON r.round_type_id=rt.round_type_id
106+
LEFT OUTER JOIN region reg
107+
ON r.region_id=reg.region_id
108+
LEFT OUTER JOIN round_segment rs1
109+
ON r.round_id=rs1.round_id and rs1.segment_id = 1
110+
LEFT OUTER JOIN round_segment rs2
111+
ON r.round_id=rs2.round_id and rs2.segment_id = 2
112+
LEFT OUTER JOIN round_segment rs3
113+
ON r.round_id=rs3.round_id and rs3.segment_id = 3
114+
LEFT OUTER JOIN round_segment rs4
115+
ON r.round_id=rs4.round_id and rs4.segment_id = 4
116+
LEFT OUTER JOIN round_segment rs5
117+
ON r.round_id=rs5.round_id and rs5.segment_id = 5
118+
LEFT OUTER JOIN round_segment rs6
119+
ON r.round_id=rs6.round_id and rs6.segment_id = 6
120+
LEFT OUTER JOIN round_segment rs7
121+
ON r.round_id=rs7.round_id and rs7.segment_id = 7
122+
)
123+
WHERE @filterCondition@
124+
ORDER BY @sortColumn@ @sortOrder@

queries/get_rounds.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name" : "get_rounds",
3+
"db" : "informixoltp",
4+
"sqlfile" : "get_rounds"
5+
}

queries/get_rounds_count

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
SELECT
2+
count(*) as total_count
3+
FROM (round r
4+
LEFT OUTER JOIN round_type_lu rt
5+
ON r.round_type_id=rt.round_type_id
6+
LEFT OUTER JOIN region reg
7+
ON r.region_id=reg.region_id
8+
LEFT OUTER JOIN round_segment rs1
9+
ON r.round_id=rs1.round_id and rs1.segment_id = 1
10+
LEFT OUTER JOIN round_segment rs2
11+
ON r.round_id=rs2.round_id and rs2.segment_id = 2
12+
LEFT OUTER JOIN round_segment rs3
13+
ON r.round_id=rs3.round_id and rs3.segment_id = 3
14+
LEFT OUTER JOIN round_segment rs4
15+
ON r.round_id=rs4.round_id and rs4.segment_id = 4
16+
LEFT OUTER JOIN round_segment rs5
17+
ON r.round_id=rs5.round_id and rs5.segment_id = 5
18+
LEFT OUTER JOIN round_segment rs6
19+
ON r.round_id=rs6.round_id and rs6.segment_id = 6
20+
LEFT OUTER JOIN round_segment rs7
21+
ON r.round_id=rs7.round_id and rs7.segment_id = 7
22+
)
23+
WHERE @filterCondition@

queries/get_rounds_count.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name" : "get_rounds_count",
3+
"db" : "informixoltp",
4+
"sqlfile" : "get_rounds_count"
5+
}

0 commit comments

Comments
 (0)