Загрузка данных


atc.id is not null and (uat.activity_rus_type = 'ПДС' or uat.activity_rus_type = 'НПО') and
1=1
#if  
   (("$!fl_first_name" == "") 
    && ("$!fl_last_name" == "")
	 && ("$!fl_middle_name" == "")
	 && ("$!cert_number" == "")
	 && ("$!cert_series" == "")
	  && ("$!insurance_number_fl" == "")
	 && ("$!fl_contract_number" == "")
	 && ("$!fl_birth_date" == "")
	 && ("$!fl_sh_number" == ""))
  and 1 = 0
#end

#if ("$!fl_first_name" != "")
    and i.first_name ILIKE '%' || :fl_first_name || '%'
#end

#if ("$!fl_last_name" != "")
    and i.last_name ILIKE '%' || :fl_last_name || '%'
#end

#if ("$!fl_middle_name" != "")
    and i.middle_name ILIKE '%' || :fl_middle_name || '%'
#end

#if ("$!cert_number" != "")
    and i.certificate_number ILIKE '%' || :cert_number || '%'
#end

#if ("$!cert_series" != "")
    and i.certificate_series ILIKE '%' || :cert_series || '%'
#end

#if ("$!insurance_number_fl" != "")
    and i.insurance_number ILIKE '%' || :insurance_number_fl || '%'
#end

#if ("$!fl_contract_number" != "")
    and contract.number ILIKE '%' || replace(:fl_contract_number, chr(92), chr(92) || chr(92)) || '%' ESCAPE chr(92)
#end

#if ("$!fl_birth_date" != "")
    and to_char(i.birth_date, 'DD.MM.YYYY') = :fl_birth_date
#end 

#if ("$!fl_sh_number" != "")
    and sh.number ILIKE '%' || :fl_sh_number || '%'
#end