a.ApointTime, a.ApointCount, a.AccoLeader,
a.OurLeader, a.ApointScence, a.DinnerType,
a.ActivityName, a.UndertakeUnit, a.CarSite,
a.Contract, a.Concierge, a.PayType,
a.IsPhotography,a.IsBand, a.Security,
a.Note,
a.ModifyDate, (case when a.UseStatus = 200 then '录入'
when a.UseStatus = 0 then '确认'
when a.UseStatus = 100 then '取消'
else '其它' end) UseStatus,
b.EmpName ,a.SecurityLevel, isnull( a.IsProtect, 0) as IsProtect, isnull( a.IsHuanMu,0) as IsHuanMu
from TbbVip a,TgbEmployee b, TbbSysParams d
where a.OptrId *= b.EmpId
and a.ApointDate = c
onvert( datetime, @currDate )
and a.Item = d.ParamValue
and d.ParamType = 600
and a.UseStatus = 0
order by VipNo,ApointTime