IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[privateview_20]') AND type = 'V')
DROP VIEW [dbo].[privateview_20]
GO
CREATE VIEW [dbo].[privateview_20]
AS
select dp_id objid,dp_depart [部门名称],dp_code [部门编号],
dp_bcid [公司id],dp_note [门店类型],dp_status[门店状态],
dp_location[门店地址]
from mps_depart 
where 
(dp_note = '' or dp_note = '直营门店') 
and 
(dp_status = '' or dp_status = '正常营业')