Skip to content

Commit

Permalink
exclude companies created recently
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarcoin committed May 15, 2024
1 parent 2d4b0a6 commit 24bc2bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/core/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ from v_summaries s
and (s.etat_administratif = $21 or $21 is null)
and (s.first_alert = $22 or $22 is null)
and (not (s.has_delai = $23) or $23 is null)
and (s.date_creation_entreprise <= $24 or $24 is null)
order by s.alert, s.valeur_score desc, s.siret
limit $2 offset $3`

Expand Down Expand Up @@ -129,9 +130,9 @@ func (p summaryParams) toSQLScoreParams() []interface{} {
p.etatAdministratif,
p.firstAlert,
p.hasntDelai,
p.creationDateThreshold,
// insert new argument before and manually update index of libelleListe
p.libelleListe,
p.creationDateThreshold,
}
}

Expand Down Expand Up @@ -188,7 +189,7 @@ var sqlScore = `select
and (n.code_n1 = any($15) or $15 is null)
and (s.etat_administratif = $21 or $21 is null)
and (not (s.has_delai = $23) or $23 is null)
and ((s.first_list_etablissement = $24 or s.first_red_list_etablissement = $24) and $22 or $22 is null)
and (s.create_date >= $25 or $25 is null)
and (s.date_creation_entreprise <= $24 or $24 is null)
and ((s.first_list_etablissement = $25 or s.first_red_list_etablissement = $25) and $22 or $22 is null)
order by sc.alert, sc.score desc, s.siret
limit $2 offset $3`

0 comments on commit 24bc2bb

Please sign in to comment.