<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>delta_recruits_info_flow4</name>
    <name_sync_with_filename>Y</name_sync_with_filename>
    <description/>
    <extended_description/>
    <pipeline_version/>
    <pipeline_type>Normal</pipeline_type>
    <pipeline_status>0</pipeline_status>
    <parameters>
      <parameter>
        <name>M_R_CR_DATE</name>
        <default_value/>
        <description/>
      </parameter>
      <parameter>
        <name>M_R_UP_DATE</name>
        <default_value/>
        <description/>
      </parameter>
    </parameters>
    <capture_transform_performance>N</capture_transform_performance>
    <transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
    <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
    <created_user>-</created_user>
    <created_date>2025/05/29 17:05:14.836</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/05/29 17:05:14.836</modified_date>
  </info>
  <notepads>
  </notepads>
  <order>
    <hop>
      <from>Table input</from>
      <to>Insert / update</to>
      <enabled>Y</enabled>
    </hop>
  </order>
  <transform>
    <name>Insert / update</name>
    <type>InsertUpdate</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <commit>100</commit>
    <connection>ervu-dashboard</connection>
    <lookup>
      <key>
        <condition>=</condition>
        <field>recruit_id</field>
        <name>recruit_id</name>
        <name2/>
      </key>
      <schema>ervu_dashboard</schema>
      <table>recruits_info</table>
      <value>
        <name>recruit_id</name>
        <rename>recruit_id</rename>
        <update>N</update>
      </value>
      <value>
        <name>created_at</name>
        <rename>created_at</rename>
        <update>Y</update>
      </value>
      <value>
        <name>updated_at</name>
        <rename>updated_at</rename>
        <update>Y</update>
      </value>
      <value>
        <name>current_recruitment_id</name>
        <rename>current_recruitment_id</rename>
        <update>Y</update>
      </value>
      <value>
        <name>target_recruitment_id</name>
        <rename>target_recruitment_id</rename>
        <update>Y</update>
      </value>
      <value>
        <name>full_name</name>
        <rename>full_name</rename>
        <update>Y</update>
      </value>
      <value>
        <name>gir_import_data_version_id</name>
        <rename>gir_import_data_version_id</rename>
        <update>Y</update>
      </value>
      <value>
        <name>info</name>
        <rename>info</rename>
        <update>Y</update>
      </value>
      <value>
        <name>addresses</name>
        <rename>addresses</rename>
        <update>Y</update>
      </value>
    </lookup>
    <update_bypassed>N</update_bypassed>
    <attributes/>
    <GUI>
      <xloc>848</xloc>
      <yloc>368</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Table input</name>
    <type>TableInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <connection>ervu_person_registry</connection>
    <execute_each_row>N</execute_each_row>
    <limit>0</limit>
    <sql>SELECT
    r.system_create_date AS created_at, 
    r.system_update_date AS updated_at, 
    ri.recruit_id, 
    ri.info, 
    ri.gir_import_data_version_id,
    r.current_recruitment_id, 
    r.target_recruitment_id,
    r.full_name,
    r.addresses
FROM recruits_info ri 
JOIN recruits r ON r.id = ri.recruit_id
WHERE 
    r.system_update_date >= '${M_R_UP_DATE}'::timestamp
    '${ID_F4}' != ''  -- Проверка на пустую строку
    AND COALESCE(current_recruitment_id::text, target_recruitment_id::text) = '${ID_F4}'
    AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
    --AND '${CR_DATE}' &lt; ri.created_at
--ORDER BY ri.created_at ASC;</sql>
    <variables_active>Y</variables_active>
    <attributes/>
    <GUI>
      <xloc>432</xloc>
      <yloc>368</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
  </transform_error_handling>
  <attributes/>
</pipeline>
