Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
grade
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Yushko
grade
Commits
991e3a40
Commit
991e3a40
authored
10 years ago
by
PavelBegunkov
Browse files
Options
Downloads
Patches
Plain Diff
Split sql getRoadmap
parent
6f27bcaa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
db/StoredProcedures.sql
+52
-0
52 additions, 0 deletions
db/StoredProcedures.sql
with
52 additions
and
0 deletions
db/StoredProcedures.sql
+
52
−
0
View file @
991e3a40
...
...
@@ -1225,6 +1225,7 @@ END //
#
TODO
:
too
long
output
names
#
TODO
:
order
hardcode
#
TODO
:
deprecated
DROP
PROCEDURE
IF
EXISTS
GetRoadmap
//
CREATE
PROCEDURE
`GetRoadmap`
(
IN
`pDisciplineID`
INT
,
...
...
@@ -1256,6 +1257,57 @@ BEGIN
END
//
DROP
PROCEDURE
IF
EXISTS
Discipline_GetModules
//
CREATE
PROCEDURE
`Discipline_GetModules`
(
IN
`pDisciplineID`
INT
,
IN
`pType`
enum
(
'exam'
,
'rate'
,
'all'
)
)
NO
SQL
BEGIN
SELECT
modules
.
ID
,
modules
.
Name
,
modules
.
Type
FROM
`modules`
WHERE
modules
.
DisciplineID
=
pDisciplineID
AND
CASE
pType
WHEN
'exam'
THEN
modules
.
Type
=
'exam'
OR
modules
.
Type
=
'extra'
WHEN
'rate'
THEN
modules
.
Type
!=
'exam'
ELSE
TRUE
END
ORDER
BY
CASE
pType
WHEN
'exam'
THEN
InternalOrderModuleTypesForSession
(
modules
.
Type
)
WHEN
'rate'
THEN
modules
.
Type
^
1
#
1
,
3
,
2
,
4
ASC
ELSE
TRUE
END
ASC
,
modules
.
OrderNum
ASC
;
END
//
DROP
PROCEDURE
IF
EXISTS
Discipline_GetSubmodules
//
CREATE
PROCEDURE
`Discipline_GetSubmodules`
(
IN
`pDisciplineID`
INT
,
IN
`pType`
enum
(
'exam'
,
'rate'
,
'all'
)
)
NO
SQL
BEGIN
SELECT
view_roadmap
.
ModuleID
,
view_roadmap
.
SubmoduleID
AS
'ID'
,
view_roadmap
.
SubmoduleName
AS
'Name'
,
view_roadmap
.
SubmoduleRate
AS
'Rate'
,
view_roadmap
.
SubmoduleType
AS
'Type'
FROM
`view_roadmap`
WHERE
view_roadmap
.
DisciplineID
=
pDisciplineID
AND
CASE
pType
WHEN
'exam'
THEN
view_roadmap
.
ModuleType
=
'exam'
OR
view_roadmap
.
ModuleType
=
'extra'
WHEN
'rate'
THEN
view_roadmap
.
ModuleType
!=
'exam'
OR
view_roadmap
.
SubmoduleOrderNum
=
1
ELSE
TRUE
END
ORDER
BY
view_roadmap
.
ModuleOrderNum
ASC
,
view_roadmap
.
SubmoduleOrderNum
ASC
;
END
//
#
-------------------------------------------------------------------------------------------
#
Label
:
recovery
#
-------------------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment