
            select
             count(  * ) AS cnt 
            from
             -- from
                v_WorkGraph WG
                left join v_MedStaffFact MSF  on MSF.MedStaffFact_id = WG.MedStaffFact_id
                left join v_pmUserCache PUC  on PUC.PMUser_id = WG.pmUser_insID
                
                INNER JOIN LATERAL(

                    select WGLS.WorkGraphLpuSection_id
                    from v_WorkGraphLpuSection WGLS
                    inner join v_LpuSection LS  on (LS.LpuSection_id = WGLS.LpuSection_id and LS.LpuBuilding_id = 450101000000410)
                     and  WGLS.LpuSection_id = 450101000004450
                    where WGLS.WorkGraph_id = WG.WorkGraph_id
                ) B on true
            
            -- end from
            where
            -- where
            (1=1)
             and MSF.Lpu_id = '25'
            -- end where
            
        
