--"set dateformat  dmy;  select * from han_StickListPS ("+params["paramLpu"].value+","+params["paramLpuBuilding"].value+","+params["paramLpuUnit"].value+","+params["paramLpuSection"].value+","+params["paramLpuRegion"].value+","+params["paramMedStaffFactStac"].value+","+params["paramPayType"].value+","+params["paramOrg"].value+",dbo.GetDiagCodeByID("+params["paramBegDiag"].value+"),dbo.GetDiagCodeByID("+params["paramEndDiag"].value+"),"+params["paramStickCause"].value+","+params["paramStickType"].value+","+params["paramDataOtchStick"].value+","+params["paramStickLeaveType"].value+",'"+params["paramBegDate"].value+"','"+params["paramEndDate"].value+"')"

select *
from rpt.han_sticklistps_pg(
cast($1 as int8), 
cast($2 as int8), 
cast($3 as int8), 
cast($4 as int8), 
cast($5 as int8), 
cast($6 as int8), 
cast($7 as int8), 
cast($8 as int8), 
$9, 
$10, 
cast($11 as int8), 
cast($12 as int8), 
cast($13 as int8), 
cast($14 as int8), 
cast(to_timestamp($15,'dd.mm.yyyy') as timestamp), 
cast(to_timestamp($16,'dd.mm.yyyy') as timestamp))
