Auto Processing Claim

select c.claimId, c.readyToAudit, c.readyTOClear, c.claimStatus from tbl_TPM_Claims c with (nolock) where c.ownerId = and c.ownerType = and not exists ( select * from tbl_TPM_ProofOfDelivery epod with (nolock) where epod.ownerId = c.ownerId and epod.ownerType = c.ownerType and epod.claimId = c.claimId and epod.skuId is null ) and c.claimId = select c.claimId, c.readyToAudit, c.readyTOClear, c.claimStatus from tbl_TPM_Claims c with (nolock) where c.ownerId = and c.ownerType = and not exists ( select * from tbl_TPM_ProofOfDelivery epod with (nolock) where epod.ownerId = c.ownerId and epod.ownerType = c.ownerType and epod.claimId = c.claimId and epod.skuId is null ) and c.claimId =