select 'vnra' organization,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_a_duongsatngoaiga','diemlytrinhdau',null,'vnra','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r1.vnra_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra') as chieudaithucte,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_rayduongsat::varchar,'vnra_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_rayduongsat::varchar,'vnra_a_duongsatngoaiga','rayduongsat','chieudairay','vnra','vi') as chieudairay,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_nenduongsat::varchar,'vnra_a_duongsatngoaiga','nenduongsat',null,'vnra','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r1.vnra_a_duongsatngoaiga_namxaydung::varchar,2,'vnra') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r1.vidagis_id::varchar,'vnra_a_duongsatngoaiga','thongtinsuachua','vnra',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_a_duongsatngoaiga','chatluongbaotri',null,'vnra','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r1.vnra_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra','vi') as vitriquymolanchiemhlatgt_phai,r1.vnra_a_duongsatngoaiga_donvibaotri as donvibaotri,r1.vnra_a_duongsatngoaiga_donviquanly as donviquanly from vnra.vidagis_a_vnra_a_duongsatngoaiga_report r1 join vnra.vidagis_a_assetentry a on a.vidagis_id = r1.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r1.vidagis_id left join vnra.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r1.vidagis_id and s.vidagis_organizationid='vnra' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_vnr' organization,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_vnr_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_vnr','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_vnr_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_vnr','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r2.vnra_vnr_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_vnr') as chieudaithucte,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_rayduongsat::varchar,'vnra_vnr_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_vnr','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_rayduongsat::varchar,'vnra_vnr_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_vnr','vi') as chieudairay,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_vnr_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_vnr','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_vnr_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_vnr','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_vnr_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_vnr','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_vnr_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_vnr','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_nenduongsat::varchar,'vnra_vnr_a_duongsatngoaiga','nenduongsat',null,'vnra_vnr','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r2.vnra_vnr_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_vnr') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r2.vidagis_id::varchar,'vnra_vnr_a_duongsatngoaiga','thongtinsuachua','vnra_vnr',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_vnr_a_duongsatngoaiga','chatluongbaotri',null,'vnra_vnr','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_vnr_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_vnr','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_vnr_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_vnr','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_vnr_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_vnr','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r2.vnra_vnr_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_vnr_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_vnr','vi') as vitriquymolanchiemhlatgt_phai,r2.vnra_vnr_a_duongsatngoaiga_donvibaotri as donvibaotri,r2.vnra_vnr_a_duongsatngoaiga_donviquanly as donviquanly from vnra_vnr.vidagis_a_vnra_vnr_a_duongsatngoaiga_report r2 join vnra_vnr.vidagis_a_assetentry a on a.vidagis_id = r2.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_vnr.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r2.vidagis_id left join vnra_vnr.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r2.vidagis_id and s.vidagis_organizationid='vnra_vnr' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_ttth_bg' organization,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_ttth_bg','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_ttth_bg','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_ttth_bg') as chieudaithucte,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_ttth_bg','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_ttth_bg','vi') as chieudairay,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_ttth_bg','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_ttth_bg','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_ttth_bg','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_ttth_bg','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_ttth_bg','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_ttth_bg') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r3.vidagis_id::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','thongtinsuachua','vnra_mis_ttth_bg',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_ttth_bg','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_ttth_bg','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_ttth_bg','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_ttth_bg','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r3.vnra_mis_ttth_bg_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_ttth_bg_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_ttth_bg','vi') as vitriquymolanchiemhlatgt_phai,r3.vnra_mis_ttth_bg_a_duongsatngoaiga_donvibaotri as donvibaotri,r3.vnra_mis_ttth_bg_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_ttth_bg.vidagis_a_vnra_mis_ttth_bg_a_duongsatngoaiga_report r3 join vnra_mis_ttth_bg.vidagis_a_assetentry a on a.vidagis_id = r3.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_ttth_bg.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r3.vidagis_id left join vnra_mis_ttth_bg.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r3.vidagis_id and s.vidagis_organizationid='vnra_mis_ttth_bg' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_hanoi' organization,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_hanoi','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_hanoi','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r4.vnra_mis_hanoi_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_hanoi') as chieudaithucte,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_hanoi','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_hanoi','vi') as chieudairay,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_hanoi','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_hanoi','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_hanoi','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_hanoi','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_hanoi','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r4.vnra_mis_hanoi_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_hanoi') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r4.vidagis_id::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','thongtinsuachua','vnra_mis_hanoi',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_hanoi','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_hanoi','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_hanoi','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_hanoi','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r4.vnra_mis_hanoi_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_hanoi_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_hanoi','vi') as vitriquymolanchiemhlatgt_phai,r4.vnra_mis_hanoi_a_duongsatngoaiga_donvibaotri as donvibaotri,r4.vnra_mis_hanoi_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_hanoi.vidagis_a_vnra_mis_hanoi_a_duongsatngoaiga_report r4 join vnra_mis_hanoi.vidagis_a_assetentry a on a.vidagis_id = r4.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_hanoi.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r4.vidagis_id left join vnra_mis_hanoi.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r4.vidagis_id and s.vidagis_organizationid='vnra_mis_hanoi' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_ttth_sg' organization,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_ttth_sg','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_ttth_sg','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_ttth_sg') as chieudaithucte,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_ttth_sg','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_ttth_sg','vi') as chieudairay,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_ttth_sg','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_ttth_sg','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_ttth_sg','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_ttth_sg','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_ttth_sg','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_ttth_sg') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r5.vidagis_id::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','thongtinsuachua','vnra_mis_ttth_sg',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_ttth_sg','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_ttth_sg','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_ttth_sg','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_ttth_sg','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r5.vnra_mis_ttth_sg_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_ttth_sg_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_ttth_sg','vi') as vitriquymolanchiemhlatgt_phai,r5.vnra_mis_ttth_sg_a_duongsatngoaiga_donvibaotri as donvibaotri,r5.vnra_mis_ttth_sg_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_ttth_sg.vidagis_a_vnra_mis_ttth_sg_a_duongsatngoaiga_report r5 join vnra_mis_ttth_sg.vidagis_a_assetentry a on a.vidagis_id = r5.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_ttth_sg.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r5.vidagis_id left join vnra_mis_ttth_sg.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r5.vidagis_id and s.vidagis_organizationid='vnra_mis_ttth_sg' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_ttth_vinh' organization,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_ttth_vinh','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_ttth_vinh','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_ttth_vinh') as chieudaithucte,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_ttth_vinh','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_ttth_vinh','vi') as chieudairay,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_ttth_vinh','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_ttth_vinh','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_ttth_vinh','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_ttth_vinh','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_ttth_vinh','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_ttth_vinh') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r6.vidagis_id::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','thongtinsuachua','vnra_mis_ttth_vinh',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_ttth_vinh','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_ttth_vinh','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_ttth_vinh','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_ttth_vinh','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_ttth_vinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_ttth_vinh','vi') as vitriquymolanchiemhlatgt_phai,r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_donvibaotri as donvibaotri,r6.vnra_mis_ttth_vinh_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_ttth_vinh.vidagis_a_vnra_mis_ttth_vinh_a_duongsatngoaiga_report r6 join vnra_mis_ttth_vinh.vidagis_a_assetentry a on a.vidagis_id = r6.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_ttth_vinh.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r6.vidagis_id left join vnra_mis_ttth_vinh.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r6.vidagis_id and s.vidagis_organizationid='vnra_mis_ttth_vinh' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_ttth_danang' organization,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_ttth_danang','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_ttth_danang','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_ttth_danang') as chieudaithucte,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_ttth_danang','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_ttth_danang','vi') as chieudairay,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_ttth_danang','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_ttth_danang','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_ttth_danang','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_ttth_danang','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_ttth_danang','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_ttth_danang') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r7.vidagis_id::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','thongtinsuachua','vnra_mis_ttth_danang',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_ttth_danang','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_ttth_danang','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_ttth_danang','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_ttth_danang','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r7.vnra_mis_ttth_danang_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_ttth_danang_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_ttth_danang','vi') as vitriquymolanchiemhlatgt_phai,r7.vnra_mis_ttth_danang_a_duongsatngoaiga_donvibaotri as donvibaotri,r7.vnra_mis_ttth_danang_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_ttth_danang.vidagis_a_vnra_mis_ttth_danang_a_duongsatngoaiga_report r7 join vnra_mis_ttth_danang.vidagis_a_assetentry a on a.vidagis_id = r7.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_ttth_danang.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r7.vidagis_id left join vnra_mis_ttth_danang.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r7.vidagis_id and s.vidagis_organizationid='vnra_mis_ttth_danang' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_btt' organization,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_btt_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_btt','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_btt_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_btt','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r8.vnra_mis_btt_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_btt') as chieudaithucte,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_btt_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_btt','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_btt_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_btt','vi') as chieudairay,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_btt_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_btt','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_btt_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_btt','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_btt_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_btt','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_btt_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_btt','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_btt_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_btt','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r8.vnra_mis_btt_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_btt') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r8.vidagis_id::varchar,'vnra_mis_btt_a_duongsatngoaiga','thongtinsuachua','vnra_mis_btt',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_btt_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_btt','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_btt_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_btt','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_btt_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_btt','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_btt_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_btt','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r8.vnra_mis_btt_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_btt_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_btt','vi') as vitriquymolanchiemhlatgt_phai,r8.vnra_mis_btt_a_duongsatngoaiga_donvibaotri as donvibaotri,r8.vnra_mis_btt_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_btt.vidagis_a_vnra_mis_btt_a_duongsatngoaiga_report r8 join vnra_mis_btt.vidagis_a_assetentry a on a.vidagis_id = r8.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_btt.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r8.vidagis_id left join vnra_mis_btt.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r8.vidagis_id and s.vidagis_organizationid='vnra_mis_btt' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_hahai' organization,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_hahai_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_hahai','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_hahai_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_hahai','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r9.vnra_mis_hahai_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_hahai') as chieudaithucte,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_hahai_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_hahai','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_hahai_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_hahai','vi') as chieudairay,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hahai_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_hahai','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hahai_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_hahai','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hahai_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_hahai','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hahai_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_hahai','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_hahai_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_hahai','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r9.vnra_mis_hahai_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_hahai') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r9.vidagis_id::varchar,'vnra_mis_hahai_a_duongsatngoaiga','thongtinsuachua','vnra_mis_hahai',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_hahai_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_hahai','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_hahai_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_hahai','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_hahai_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_hahai','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_hahai_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_hahai','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r9.vnra_mis_hahai_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_hahai_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_hahai','vi') as vitriquymolanchiemhlatgt_phai,r9.vnra_mis_hahai_a_duongsatngoaiga_donvibaotri as donvibaotri,r9.vnra_mis_hahai_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_hahai.vidagis_a_vnra_mis_hahai_a_duongsatngoaiga_report r9 join vnra_mis_hahai.vidagis_a_assetentry a on a.vidagis_id = r9.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_hahai.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r9.vidagis_id left join vnra_mis_hahai.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r9.vidagis_id and s.vidagis_organizationid='vnra_mis_hahai' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_halang' organization,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_halang_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_halang','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_halang_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_halang','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r10.vnra_mis_halang_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_halang') as chieudaithucte,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_halang_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_halang','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_halang_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_halang','vi') as chieudairay,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_halang_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_halang','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_halang_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_halang','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_halang_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_halang','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_halang_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_halang','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_halang_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_halang','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r10.vnra_mis_halang_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_halang') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r10.vidagis_id::varchar,'vnra_mis_halang_a_duongsatngoaiga','thongtinsuachua','vnra_mis_halang',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_halang_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_halang','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_halang_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_halang','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_halang_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_halang','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_halang_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_halang','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r10.vnra_mis_halang_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_halang_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_halang','vi') as vitriquymolanchiemhlatgt_phai,r10.vnra_mis_halang_a_duongsatngoaiga_donvibaotri as donvibaotri,r10.vnra_mis_halang_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_halang.vidagis_a_vnra_mis_halang_a_duongsatngoaiga_report r10 join vnra_mis_halang.vidagis_a_assetentry a on a.vidagis_id = r10.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_halang.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r10.vidagis_id left join vnra_mis_halang.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r10.vidagis_id and s.vidagis_organizationid='vnra_mis_halang' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_haninh' organization,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_haninh_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_haninh','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_haninh_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_haninh','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r11.vnra_mis_haninh_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_haninh') as chieudaithucte,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_haninh_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_haninh','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_haninh_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_haninh','vi') as chieudairay,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_haninh_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_haninh','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_haninh_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_haninh','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_haninh_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_haninh','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_haninh_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_haninh','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_haninh_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_haninh','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r11.vnra_mis_haninh_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_haninh') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r11.vidagis_id::varchar,'vnra_mis_haninh_a_duongsatngoaiga','thongtinsuachua','vnra_mis_haninh',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_haninh_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_haninh','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_haninh_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_haninh','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_haninh_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_haninh','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_haninh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_haninh','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r11.vnra_mis_haninh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_haninh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_haninh','vi') as vitriquymolanchiemhlatgt_phai,r11.vnra_mis_haninh_a_duongsatngoaiga_donvibaotri as donvibaotri,r11.vnra_mis_haninh_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_haninh.vidagis_a_vnra_mis_haninh_a_duongsatngoaiga_report r11 join vnra_mis_haninh.vidagis_a_assetentry a on a.vidagis_id = r11.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_haninh.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r11.vidagis_id left join vnra_mis_haninh.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r11.vidagis_id and s.vidagis_organizationid='vnra_mis_haninh' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_hathai' organization,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_hathai_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_hathai','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_hathai_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_hathai','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r12.vnra_mis_hathai_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_hathai') as chieudaithucte,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_hathai_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_hathai','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_hathai_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_hathai','vi') as chieudairay,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hathai_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_hathai','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hathai_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_hathai','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hathai_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_hathai','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_hathai_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_hathai','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_hathai_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_hathai','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r12.vnra_mis_hathai_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_hathai') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r12.vidagis_id::varchar,'vnra_mis_hathai_a_duongsatngoaiga','thongtinsuachua','vnra_mis_hathai',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_hathai_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_hathai','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_hathai_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_hathai','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_hathai_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_hathai','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_hathai_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_hathai','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r12.vnra_mis_hathai_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_hathai_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_hathai','vi') as vitriquymolanchiemhlatgt_phai,r12.vnra_mis_hathai_a_duongsatngoaiga_donvibaotri as donvibaotri,r12.vnra_mis_hathai_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_hathai.vidagis_a_vnra_mis_hathai_a_duongsatngoaiga_report r12 join vnra_mis_hathai.vidagis_a_assetentry a on a.vidagis_id = r12.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_hathai.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r12.vidagis_id left join vnra_mis_hathai.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r12.vidagis_id and s.vidagis_organizationid='vnra_mis_hathai' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_nghiabinh' organization,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_nghiabinh','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_nghiabinh','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_nghiabinh') as chieudaithucte,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_nghiabinh','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_nghiabinh','vi') as chieudairay,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_nghiabinh','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_nghiabinh','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_nghiabinh','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_nghiabinh','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_nghiabinh','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_nghiabinh') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r13.vidagis_id::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','thongtinsuachua','vnra_mis_nghiabinh',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_nghiabinh','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_nghiabinh','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_nghiabinh','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_nghiabinh','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r13.vnra_mis_nghiabinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_nghiabinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_nghiabinh','vi') as vitriquymolanchiemhlatgt_phai,r13.vnra_mis_nghiabinh_a_duongsatngoaiga_donvibaotri as donvibaotri,r13.vnra_mis_nghiabinh_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_nghiabinh.vidagis_a_vnra_mis_nghiabinh_a_duongsatngoaiga_report r13 join vnra_mis_nghiabinh.vidagis_a_assetentry a on a.vidagis_id = r13.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_nghiabinh.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r13.vidagis_id left join vnra_mis_nghiabinh.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r13.vidagis_id and s.vidagis_organizationid='vnra_mis_nghiabinh' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_nghetinh' organization,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_nghetinh','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_nghetinh','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r14.vnra_mis_nghetinh_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_nghetinh') as chieudaithucte,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_nghetinh','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_nghetinh','vi') as chieudairay,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_nghetinh','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_nghetinh','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_nghetinh','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_nghetinh','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_nghetinh','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r14.vnra_mis_nghetinh_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_nghetinh') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r14.vidagis_id::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','thongtinsuachua','vnra_mis_nghetinh',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_nghetinh','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_nghetinh','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_nghetinh','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_nghetinh','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r14.vnra_mis_nghetinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_nghetinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_nghetinh','vi') as vitriquymolanchiemhlatgt_phai,r14.vnra_mis_nghetinh_a_duongsatngoaiga_donvibaotri as donvibaotri,r14.vnra_mis_nghetinh_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_nghetinh.vidagis_a_vnra_mis_nghetinh_a_duongsatngoaiga_report r14 join vnra_mis_nghetinh.vidagis_a_assetentry a on a.vidagis_id = r14.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_nghetinh.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r14.vidagis_id left join vnra_mis_nghetinh.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r14.vidagis_id and s.vidagis_organizationid='vnra_mis_nghetinh' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_phukhanh' organization,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_phukhanh','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_phukhanh','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r15.vnra_mis_phukhanh_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_phukhanh') as chieudaithucte,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_phukhanh','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_phukhanh','vi') as chieudairay,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_phukhanh','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_phukhanh','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_phukhanh','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_phukhanh','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_phukhanh','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r15.vnra_mis_phukhanh_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_phukhanh') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r15.vidagis_id::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','thongtinsuachua','vnra_mis_phukhanh',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_phukhanh','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_phukhanh','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_phukhanh','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_phukhanh','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r15.vnra_mis_phukhanh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_phukhanh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_phukhanh','vi') as vitriquymolanchiemhlatgt_phai,r15.vnra_mis_phukhanh_a_duongsatngoaiga_donvibaotri as donvibaotri,r15.vnra_mis_phukhanh_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_phukhanh.vidagis_a_vnra_mis_phukhanh_a_duongsatngoaiga_report r15 join vnra_mis_phukhanh.vidagis_a_assetentry a on a.vidagis_id = r15.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_phukhanh.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r15.vidagis_id left join vnra_mis_phukhanh.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r15.vidagis_id and s.vidagis_organizationid='vnra_mis_phukhanh' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_quangbinh' organization,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_quangbinh','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_quangbinh','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r16.vnra_mis_quangbinh_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_quangbinh') as chieudaithucte,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_quangbinh','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_quangbinh','vi') as chieudairay,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_quangbinh','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_quangbinh','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_quangbinh','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_quangbinh','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_quangbinh','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r16.vnra_mis_quangbinh_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_quangbinh') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r16.vidagis_id::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','thongtinsuachua','vnra_mis_quangbinh',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_quangbinh','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_quangbinh','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_quangbinh','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_quangbinh','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r16.vnra_mis_quangbinh_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_quangbinh_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_quangbinh','vi') as vitriquymolanchiemhlatgt_phai,r16.vnra_mis_quangbinh_a_duongsatngoaiga_donvibaotri as donvibaotri,r16.vnra_mis_quangbinh_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_quangbinh.vidagis_a_vnra_mis_quangbinh_a_duongsatngoaiga_report r16 join vnra_mis_quangbinh.vidagis_a_assetentry a on a.vidagis_id = r16.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_quangbinh.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r16.vidagis_id left join vnra_mis_quangbinh.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r16.vidagis_id and s.vidagis_organizationid='vnra_mis_quangbinh' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_quangnamdanang' organization,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_quangnamdanang','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_quangnamdanang','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_quangnamdanang') as chieudaithucte,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_quangnamdanang','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_quangnamdanang','vi') as chieudairay,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_quangnamdanang','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_quangnamdanang','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_quangnamdanang','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_quangnamdanang','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_quangnamdanang','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_quangnamdanang') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r17.vidagis_id::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','thongtinsuachua','vnra_mis_quangnamdanang',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_quangnamdanang','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_quangnamdanang','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_quangnamdanang','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_quangnamdanang','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_quangnamdanang_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_quangnamdanang','vi') as vitriquymolanchiemhlatgt_phai,r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_donvibaotri as donvibaotri,r17.vnra_mis_quangnamdanang_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_quangnamdanang.vidagis_a_vnra_mis_quangnamdanang_a_duongsatngoaiga_report r17 join vnra_mis_quangnamdanang.vidagis_a_assetentry a on a.vidagis_id = r17.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_quangnamdanang.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r17.vidagis_id left join vnra_mis_quangnamdanang.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r17.vidagis_id and s.vidagis_organizationid='vnra_mis_quangnamdanang' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_saigon' organization,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_saigon_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_saigon','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_saigon_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_saigon','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r18.vnra_mis_saigon_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_saigon') as chieudaithucte,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_saigon_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_saigon','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_saigon_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_saigon','vi') as chieudairay,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_saigon_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_saigon','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_saigon_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_saigon','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_saigon_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_saigon','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_saigon_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_saigon','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_saigon_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_saigon','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r18.vnra_mis_saigon_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_saigon') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r18.vidagis_id::varchar,'vnra_mis_saigon_a_duongsatngoaiga','thongtinsuachua','vnra_mis_saigon',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_saigon_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_saigon','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_saigon_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_saigon','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_saigon_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_saigon','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_saigon_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_saigon','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r18.vnra_mis_saigon_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_saigon_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_saigon','vi') as vitriquymolanchiemhlatgt_phai,r18.vnra_mis_saigon_a_duongsatngoaiga_donvibaotri as donvibaotri,r18.vnra_mis_saigon_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_saigon.vidagis_a_vnra_mis_saigon_a_duongsatngoaiga_report r18 join vnra_mis_saigon.vidagis_a_assetentry a on a.vidagis_id = r18.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_saigon.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r18.vidagis_id left join vnra_mis_saigon.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r18.vidagis_id and s.vidagis_organizationid='vnra_mis_saigon' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_thanhhoa' organization,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_thanhhoa','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_thanhhoa','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_thanhhoa') as chieudaithucte,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_thanhhoa','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_thanhhoa','vi') as chieudairay,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_thanhhoa','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_thanhhoa','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_thanhhoa','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_thanhhoa','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_thanhhoa','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_thanhhoa') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r19.vidagis_id::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','thongtinsuachua','vnra_mis_thanhhoa',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_thanhhoa','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_thanhhoa','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_thanhhoa','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_thanhhoa','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r19.vnra_mis_thanhhoa_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_thanhhoa_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_thanhhoa','vi') as vitriquymolanchiemhlatgt_phai,r19.vnra_mis_thanhhoa_a_duongsatngoaiga_donvibaotri as donvibaotri,r19.vnra_mis_thanhhoa_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_thanhhoa.vidagis_a_vnra_mis_thanhhoa_a_duongsatngoaiga_report r19 join vnra_mis_thanhhoa.vidagis_a_assetentry a on a.vidagis_id = r19.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_thanhhoa.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r19.vidagis_id left join vnra_mis_thanhhoa.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r19.vidagis_id and s.vidagis_organizationid='vnra_mis_thanhhoa' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_thuanhai' organization,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_thuanhai','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_thuanhai','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r20.vnra_mis_thuanhai_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_thuanhai') as chieudaithucte,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_thuanhai','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_thuanhai','vi') as chieudairay,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_thuanhai','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_thuanhai','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_thuanhai','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_thuanhai','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_thuanhai','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r20.vnra_mis_thuanhai_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_thuanhai') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r20.vidagis_id::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','thongtinsuachua','vnra_mis_thuanhai',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_thuanhai','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_thuanhai','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_thuanhai','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_thuanhai','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r20.vnra_mis_thuanhai_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_thuanhai_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_thuanhai','vi') as vitriquymolanchiemhlatgt_phai,r20.vnra_mis_thuanhai_a_duongsatngoaiga_donvibaotri as donvibaotri,r20.vnra_mis_thuanhai_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_thuanhai.vidagis_a_vnra_mis_thuanhai_a_duongsatngoaiga_report r20 join vnra_mis_thuanhai.vidagis_a_assetentry a on a.vidagis_id = r20.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_thuanhai.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r20.vidagis_id left join vnra_mis_thuanhai.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r20.vidagis_id and s.vidagis_organizationid='vnra_mis_thuanhai' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_vinhphu' organization,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_vinhphu','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_vinhphu','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r21.vnra_mis_vinhphu_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_vinhphu') as chieudaithucte,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_vinhphu','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_vinhphu','vi') as chieudairay,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_vinhphu','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_vinhphu','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_vinhphu','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_vinhphu','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_vinhphu','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r21.vnra_mis_vinhphu_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_vinhphu') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r21.vidagis_id::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','thongtinsuachua','vnra_mis_vinhphu',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_vinhphu','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_vinhphu','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_vinhphu','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_vinhphu','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r21.vnra_mis_vinhphu_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_vinhphu_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_vinhphu','vi') as vitriquymolanchiemhlatgt_phai,r21.vnra_mis_vinhphu_a_duongsatngoaiga_donvibaotri as donvibaotri,r21.vnra_mis_vinhphu_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_vinhphu.vidagis_a_vnra_mis_vinhphu_a_duongsatngoaiga_report r21 join vnra_mis_vinhphu.vidagis_a_assetentry a on a.vidagis_id = r21.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_vinhphu.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r21.vidagis_id left join vnra_mis_vinhphu.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r21.vidagis_id and s.vidagis_organizationid='vnra_mis_vinhphu' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_yenlao' organization,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_yenlao','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_yenlao','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r22.vnra_mis_yenlao_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_yenlao') as chieudaithucte,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_yenlao','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_yenlao','vi') as chieudairay,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_yenlao','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_yenlao','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_yenlao','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_yenlao','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_yenlao','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r22.vnra_mis_yenlao_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_yenlao') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r22.vidagis_id::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','thongtinsuachua','vnra_mis_yenlao',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_yenlao','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_yenlao','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_yenlao','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_yenlao','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r22.vnra_mis_yenlao_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_yenlao_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_yenlao','vi') as vitriquymolanchiemhlatgt_phai,r22.vnra_mis_yenlao_a_duongsatngoaiga_donvibaotri as donvibaotri,r22.vnra_mis_yenlao_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_yenlao.vidagis_a_vnra_mis_yenlao_a_duongsatngoaiga_report r22 join vnra_mis_yenlao.vidagis_a_assetentry a on a.vidagis_id = r22.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_yenlao.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r22.vidagis_id left join vnra_mis_yenlao.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r22.vidagis_id and s.vidagis_organizationid='vnra_mis_yenlao' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_vidagis' organization,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_vidagis','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_vidagis','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r23.vnra_mis_vidagis_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_vidagis') as chieudaithucte,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_vidagis','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_vidagis','vi') as chieudairay,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_vidagis','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_vidagis','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_vidagis','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_vidagis','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_vidagis','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r23.vnra_mis_vidagis_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_vidagis') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r23.vidagis_id::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','thongtinsuachua','vnra_mis_vidagis',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_vidagis','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_vidagis','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_vidagis','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_vidagis','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r23.vnra_mis_vidagis_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_vidagis_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_vidagis','vi') as vitriquymolanchiemhlatgt_phai,r23.vnra_mis_vidagis_a_duongsatngoaiga_donvibaotri as donvibaotri,r23.vnra_mis_vidagis_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_vidagis.vidagis_a_vnra_mis_vidagis_a_duongsatngoaiga_report r23 join vnra_mis_vidagis.vidagis_a_assetentry a on a.vidagis_id = r23.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_vidagis.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r23.vidagis_id left join vnra_mis_vidagis.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r23.vidagis_id and s.vidagis_organizationid='vnra_mis_vidagis' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' union all select 'vnra_mis_vidagis_branch' organization,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_diemlytrinhdau::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','diemlytrinhdau',null,'vnra_mis_vidagis_branch','vi') as diemlytrinhdau,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_diemlytrinhcuoi::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','diemlytrinhcuoi',null,'vnra_mis_vidagis_branch','vi') as diemlytrinhcuoi,public.vidagis_func_formatext_to_number(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_chieudaithucte::varchar,3,'vnra_mis_vidagis_branch') as chieudaithucte,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','rayduongsat','loairayduongsat','vnra_mis_vidagis_branch','vi') as loairayduongsat,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_rayduongsat::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','rayduongsat','chieudairay','vnra_mis_vidagis_branch','vi') as chieudairay,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','tavetduongsat','loaitavetduongsat','vnra_mis_vidagis_branch','vi') as loaitavetduongsat,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','tavetduongsat','kieutavetduongsat','vnra_mis_vidagis_branch','vi') as kieutavetduongsat,(coalesce(public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','tavetduongsat','soluongtavet_tot','vnra_mis_vidagis_branch','vi')::float8,0) + coalesce(public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_tavetduongsat::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','tavetduongsat','soluongtavet_xau','vnra_mis_vidagis_branch','vi')::float8,0)) as soluongtavet,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_nenduongsat::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','nenduongsat',null,'vnra_mis_vidagis_branch','vi') as nenduongsat,public.vidagis_func_formatext_to_number(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_namxaydung::varchar,2,'vnra_mis_vidagis_branch') as namxaydung,public.vidagis_func_get_display_thongtinsuachua(r24.vidagis_id::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','thongtinsuachua','vnra_mis_vidagis_branch',null)::varchar as thongtinsuachua,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_chatluongbaotri::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','chatluongbaotri',null,'vnra_mis_vidagis_branch','vi') as chatluongbaotri,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_phamvi_hlangtds_bentrai::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','phamvi_hlangtds_bentrai',null,'vnra_mis_vidagis_branch','vi') as phamvi_hlangtds_bentrai,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_phamvi_hlangtds_benphai::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','phamvi_hlangtds_benphai',null,'vnra_mis_vidagis_branch','vi') as phamvi_hlangtds_benphai,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_vitriquymolanchiemhlatgt_trai::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','vitriquymolanchiemhlatgt_trai',null,'vnra_mis_vidagis_branch','vi') as vitriquymolanchiemhlatgt_trai,public.vidagis_func_get_display_value_field(r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_vitriquymolanchiemhlatgt_phai::varchar,'vnra_mis_vidagis_branch_a_duongsatngoaiga','vitriquymolanchiemhlatgt_phai',null,'vnra_mis_vidagis_branch','vi') as vitriquymolanchiemhlatgt_phai,r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_donvibaotri as donvibaotri,r24.vnra_mis_vidagis_branch_a_duongsatngoaiga_donviquanly as donviquanly from vnra_mis_vidagis_branch.vidagis_a_vnra_mis_vidagis_branch_a_duongsatngoaiga_report r24 join vnra_mis_vidagis_branch.vidagis_a_assetentry a on a.vidagis_id = r24.vidagis_id and a.vidagis_is_delete=false and a.vidagis_is_transfer <> true left join vnra_mis_vidagis_branch.vidagis_a_assetentry_kilometrage k on k.vidagis_id = r24.vidagis_id left join vnra_mis_vidagis_branch.vidagis_v_organization_railway railway on railway.railway_id = k.vidagis_railway_id left join public.vidagis_a_entry_state s on s.vidagis_id = r24.vidagis_id and s.vidagis_organizationid='vnra_mis_vidagis_branch' and s.vidagis_type='asset' where (s.vidagis_state <> 'Drafting' or s.vidagis_state is null) and k.vidagis_railway_id='01' order by organization,diemlytrinhdau limit 10 offset ((1 - 1) * 10)