Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSE
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
open-source
OSE
Commits
dd9f64c3
Commit
dd9f64c3
authored
Sep 1, 2021
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Meilleure gestion des non autorisés / Autres
parent
40a61627
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/Connecteurs-Import/Générique/SRC_INTERVENANT.sql
+6
-1
6 additions, 1 deletion
doc/Connecteurs-Import/Générique/SRC_INTERVENANT.sql
with
6 additions
and
1 deletion
doc/Connecteurs-Import/Générique/SRC_INTERVENANT.sql
+
6
−
1
View file @
dd9f64c3
...
...
@@ -57,7 +57,7 @@ FROM (
CASE
-- Cas 1 : Si on est sur un statut multiple avec un non-autorisé et un autre statut, alors le non autorisé est supprimé
WHEN
statut_
intervenant
_nautorise
=
1
AND
intervenant_local
=
0
AND
nb_intervenants
>
1
AND
intervenant_histo
=
0
THEN
'drop'
WHEN
statut_
source
_nautorise
=
1
AND
nb_sources
>
1
THEN
'drop'
-- Cas 2 : Si on est sur les mêmes fiches, alors on synchronise tout le temps
...
...
@@ -152,6 +152,9 @@ FROM (
-- Si le nouveau statut est de type différent, alors on ajoute une nouvelle fiche
WHEN
types_identiques
=
0
THEN
'insert'
-- Si on a AUTRE+ NA en source et NA en intervenant => on transforme
WHEN
nb_statut_source_nautorise
>
0
AND
statut_intervenant_nautorise
=
1
THEN
'update'
-- Sinon, on ne prend pas en compte pour éviter tout problème
ELSE
'drop'
...
...
@@ -268,6 +271,8 @@ FROM (
COUNT
(
DISTINCT
ssi
.
id
)
OVER
(
PARTITION
BY
s
.
code
,
a
.
id
)
nb_sources
,
COUNT
(
DISTINCT
i
.
id
)
OVER
(
PARTITION
BY
i
.
code
,
i
.
annee_id
)
nb_intervenants
,
SUM
(
CASE
WHEN
ssi
.
id
=
i
.
statut_id
THEN
1
ELSE
0
END
)
OVER
(
PARTITION
BY
s
.
code
,
a
.
id
)
nb_statuts_egaux
,
COUNT
(
CASE
WHEN
ssi
.
code
=
'AUTRES'
THEN
1
ELSE
0
END
)
OVER
(
PARTITION
BY
s
.
code
,
a
.
id
)
nb_statut_source_autre
,
COUNT
(
CASE
WHEN
ssi
.
code
=
'NON_AUTORISE'
THEN
1
ELSE
0
END
)
OVER
(
PARTITION
BY
s
.
code
,
a
.
id
)
nb_statut_source_nautorise
,
MAX
(
CASE
WHEN
ssi
.
id
=
i
.
statut_id
THEN
ssi
.
id
ELSE
0
END
)
OVER
(
PARTITION
BY
s
.
code
,
a
.
id
)
statuts_egaux_id
FROM
mv_intervenant
s
...
...
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