
            select
                count(M.Message_id)
            from
                -- from
                msg.v_Message M

                --left join msg.v_NoticeType NT  on NT.NoticeType_id = M.NoticeType_id

                left join msg.v_MessageRecipient MR  on MR.Message_id = M.Message_id
                left join pmUserCache PUC  on PUC.PMUser_id = M.UserSend_ID

                left join v_Lpu_all LPU  on LPU.Lpu_id = PUC.Lpu_id

                left join v_MedPersonal MP  on MP.MedPersonal_id = PUC.MedPersonal_id

                left join msg.v_messagerecipient vmr on (M.message_id = vmr.message_id and vmr.userrecipient_id = '391167313326')


                    and PUC.Lpu_id = MP.Lpu_id
                -- end from
            where
                -- where

                 M.Evn_id is not null and MR.UserRecipient_id = '391167313326' and M.Message_isSent is not null and MR.Message_isRead is null
                -- end where
        
