Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADITO_Update_Upgrade
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
ADITO_Update_Upgrade
Commits
45f3e8f8
Commit
45f3e8f8
authored
5 years ago
by
David Büchler
Browse files
Options
Downloads
Patches
Plain Diff
Added Utils Lib to support building the subselect statement in a filterConditionStatement
parent
c6ac276e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
process/FilterCondition_lib/FilterCondition_lib.aod
+9
-0
9 additions, 0 deletions
process/FilterCondition_lib/FilterCondition_lib.aod
process/FilterCondition_lib/process.js
+37
-0
37 additions, 0 deletions
process/FilterCondition_lib/process.js
with
46 additions
and
0 deletions
process/FilterCondition_lib/FilterCondition_lib.aod
0 → 100644
+
9
−
0
View file @
45f3e8f8
<?xml version="1.0" encoding="UTF-8"?>
<process
xmlns=
"http://www.adito.de/2018/ao/Model"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
VERSION=
"1.2.1"
xsi:schemaLocation=
"http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"
>
<name>
FilterCondition_lib
</name>
<majorModelMode>
DISTRIBUTED
</majorModelMode>
<process>
%aditoprj%/process/FilterCondition_lib/process.js
</process>
<variants>
<element>
LIBRARY
</element>
</variants>
</process>
This diff is collapsed.
Click to expand it.
process/FilterCondition_lib/process.js
0 → 100644
+
37
−
0
View file @
45f3e8f8
/**
* Methods to help build filterCondition statements.
* Do not create an instance of this!
*
* @class
*/
function
FilterConditionUtils
()
{}
/**
* Builds a filterConditionStatement.
* The values get concatenated as described below:
* [pStatementFirstPart] where [pWhereCondition] group by [pGroupByFields] having [pHavingCondition] [pStatementLastPart]
*
* @param {String} pStatementFirstPart First part of the subselect e.g. "OFFER.OFFERID in (select OFFERITEM.OFFER_ID from OFFERITEM"
* @param {String} pWhereCondition The where conditions e.g. "OFFERITEM.QUANTITY = 2"
* @param {String} pGroupByFields Fields to be grouped by. Only required if there is a pHavingCondition. e.G. "OFFER_ID"
* @param {String} pHavingCondition The having condition e.g. "MIN( OFFERITEM.PRICE ) > 3"
* @param {String} pStatementLastPart The part that gets added in the end. Contains usually ")" to close of the built subselect.
* @return {String} The string concatenated as described above
*/
FilterConditionUtils
.
buildFilterConditionStatement
=
function
(
pStatementFirstPart
,
pWhereCondition
,
pGroupByFields
,
pHavingCondition
,
pStatementLastPart
)
{
let
statement
=
pStatementFirstPart
;
if
(
pWhereCondition
!=
null
&&
pWhereCondition
.
trim
()
!=
""
)
statement
+=
"
where
"
+
pWhereCondition
;
if
(
pGroupByFields
!=
null
&&
pGroupByFields
.
trim
()
!=
""
&&
pHavingCondition
!=
null
&&
pHavingCondition
.
trim
()
!=
""
)
{
statement
+=
"
group by
"
+
pGroupByFields
+
"
having
"
+
pHavingCondition
}
statement
+=
"
"
+
pStatementLastPart
;
return
statement
;
}
\ No newline at end of file
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