fix marital_status
This commit is contained in:
parent
f47355f466
commit
82cbd45c99
1 changed files with 20 additions and 2 deletions
|
|
@ -263,7 +263,7 @@ recruit_data AS (
|
|||
r.gender,
|
||||
CASE
|
||||
WHEN r.vu_current_info->>'recruitmentCommercialInfo' = 'true' THEN 'CONVICT'
|
||||
ELSE 'ALL'
|
||||
ELSE 'NOTCONVICT'
|
||||
END AS convicts,
|
||||
coalesce (r.current_recruitment_id, rh.current_recruitment_id) AS recruitment_id
|
||||
FROM public.recruits AS r
|
||||
|
|
@ -275,6 +275,24 @@ recruit_data AS (
|
|||
and rh.id in (SELECT recruit_history_id FROM registered)
|
||||
--and r.vu_current_info->>'recruitmentCommercialInfo' = 'true'
|
||||
and coalesce(r.current_recruitment_id,rh.current_recruitment_id) ::uuid IN (SELECT recruitment_id FROM ids)
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
ri.recruit_id,
|
||||
ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh' AS sem_pol,
|
||||
r.gender,
|
||||
'ALL' AS convicts,
|
||||
coalesce (r.current_recruitment_id, rh.current_recruitment_id) AS recruitment_id
|
||||
FROM public.recruits AS r
|
||||
JOIN public.recruits_info AS ri ON ri.recruit_id = r.id
|
||||
JOIN public.recruits_history rh on rh.recruit_id=r.id
|
||||
WHERE
|
||||
r.gender IN ('MALE', 'FEMALE')
|
||||
AND r.id in (SELECT recruit_id FROM registered)
|
||||
and rh.id in (SELECT recruit_history_id FROM registered)
|
||||
--and r.vu_current_info->>'recruitmentCommercialInfo' = 'true'
|
||||
and coalesce(r.current_recruitment_id,rh.current_recruitment_id) ::uuid IN (SELECT recruitment_id FROM ids)
|
||||
),
|
||||
married_counts AS (
|
||||
-- Считаем значения для каждого гендера
|
||||
|
|
@ -332,7 +350,7 @@ SELECT
|
|||
ac.gender,
|
||||
current_date AS recording_date,
|
||||
ac.recruitment_id
|
||||
FROM all_counts ac;</sql>
|
||||
FROM all_counts ac</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue