fix rem_reg
This commit is contained in:
parent
edefbba4e1
commit
05412e8ecc
1 changed files with 10 additions and 3 deletions
|
|
@ -814,8 +814,7 @@ COUNT(CASE WHEN d.extra_info ->> 'cause' = 'notAlive' THEN 1 END) AS death, --
|
|||
COUNT(CASE WHEN (d.extra_info ->> 'cause' IS NULL OR d.extra_info ->> 'cause' NOT IN ('ageLimit', 'notAlive')) THEN 1 END) AS other,
|
||||
ROUND(COUNT(CASE WHEN d.extra_info ->> 'cause' = 'ageLimit' THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0), 2) AS age_limit_percent,
|
||||
ROUND(COUNT(CASE WHEN d.extra_info ->> 'cause' = 'notAlive' THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0), 2) AS death_percent,
|
||||
ROUND(COUNT(CASE WHEN (d.extra_info ->> 'cause' IS NULL OR d.extra_info ->> 'cause' NOT IN ('ageLimit', 'notAlive')) THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0), 2) AS other_percent,
|
||||
'00' AS recruitment_id
|
||||
ROUND(COUNT(CASE WHEN (d.extra_info ->> 'cause' IS NULL OR d.extra_info ->> 'cause' NOT IN ('ageLimit', 'notAlive')) THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0), 2) AS other_percent
|
||||
FROM public.recruit AS r
|
||||
JOIN public.decision AS d
|
||||
ON d.recruit_id = r.id
|
||||
|
|
@ -823,8 +822,16 @@ JOIN public.decision_type AS dt
|
|||
ON dt.id = d.type_id
|
||||
WHERE r.system_pgs_status = '1.3'
|
||||
AND r.current_recruitment IS NOT NULL
|
||||
AND r.target_recruitment IS NOT NULL
|
||||
AND dt.code in ('9','10')
|
||||
AND (
|
||||
'${VK_ARRAY}' IS NULL
|
||||
OR '${VK_ARRAY}' = ''
|
||||
OR r.target_recruitment = ANY (
|
||||
string_to_array(
|
||||
trim(both '{}' FROM replace('${VK_ARRAY}', ' ', '')), ','
|
||||
)::uuid[]
|
||||
)
|
||||
)
|
||||
)
|
||||
SELECT
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue