@tricoteuses/senat 2.20.23 → 2.20.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/model/ameli.js +10 -4
- package/package.json +1 -1
package/lib/model/ameli.js
CHANGED
|
@@ -22,12 +22,16 @@ function auteurs(amendementId) {
|
|
|
22
22
|
])
|
|
23
23
|
.orderBy("ameli.amdsen.rng", "asc"));
|
|
24
24
|
}
|
|
25
|
-
function scrutin(amendementNum, sesann) {
|
|
25
|
+
function scrutin(amendementNum, sesann, lecassidt) {
|
|
26
26
|
return dbSenat
|
|
27
27
|
.selectFrom("dosleg.amescr")
|
|
28
|
-
.leftJoin("dosleg.scr",
|
|
28
|
+
.leftJoin("dosleg.scr", (join) => join
|
|
29
|
+
.onRef("dosleg.amescr.scrnum", "=", "dosleg.scr.scrnum")
|
|
30
|
+
.onRef("dosleg.amescr.sesann", "=", "dosleg.scr.sesann"))
|
|
31
|
+
.leftJoin("dosleg.date_seance", "dosleg.scr.code", "dosleg.date_seance.code")
|
|
29
32
|
.where("dosleg.amescr.amescrnum", "=", amendementNum)
|
|
30
33
|
.where("dosleg.amescr.sesann", "=", sesann)
|
|
34
|
+
.where("dosleg.date_seance.lecidt", "=", lecassidt)
|
|
31
35
|
.select(["dosleg.amescr.scrnum as scrutin_num"])
|
|
32
36
|
.limit(1)
|
|
33
37
|
.as("scrutin_num");
|
|
@@ -43,7 +47,9 @@ const findAllAmendementsQuery = dbSenat
|
|
|
43
47
|
.leftJoin("ameli.typses", "ameli.typses.id", "ameli.ses.typid")
|
|
44
48
|
.leftJoin("ameli.nat", "ameli.txt_ameli.natid", "ameli.nat.id")
|
|
45
49
|
.leftJoin("ameli.lec_ameli", "ameli.txt_ameli.lecid", "ameli.lec_ameli.id")
|
|
46
|
-
.leftJoin("dosleg.texte",
|
|
50
|
+
.leftJoin("dosleg.texte", (join) => join
|
|
51
|
+
.onRef("ameli.ses.ann", "=", "dosleg.texte.sesann")
|
|
52
|
+
.onRef("ameli.txt_ameli.numabs", "=", "dosleg.texte.texnum"))
|
|
47
53
|
.leftJoin("dosleg.lecass", "dosleg.texte.lecassidt", "dosleg.lecass.lecassidt")
|
|
48
54
|
.leftJoin("ameli.mot", "ameli.amd.motid", "ameli.mot.id")
|
|
49
55
|
.leftJoin("ameli.avicom", "ameli.amd.avcid", "ameli.avicom.id")
|
|
@@ -127,7 +133,7 @@ const findAllAmendementsQuery = dbSenat
|
|
|
127
133
|
"ameli.grppol_ameli.lilcou as au_nom_de_groupe_politique",
|
|
128
134
|
"ameli.com_ameli.lil as au_nom_de_commission",
|
|
129
135
|
eb.case().when("ameli.cab.entid", "is not", null).then(true).else(false).end().as("auteur_est_gouvernement"),
|
|
130
|
-
scrutin(ref("ameli.amd.num"), ref("ameli.ses.ann")),
|
|
136
|
+
scrutin(ref("ameli.amd.num"), ref("ameli.ses.ann"), ref("dosleg.texte.lecassidt")),
|
|
131
137
|
auteurs(ref("ameli.amd.id")).as("auteurs"),
|
|
132
138
|
]);
|
|
133
139
|
export function findAllAmendements(fromSession) {
|