IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_g_biztype_auto]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_g_biztype_auto]
GO
CREATE procedure [dbo].[mps_g_biztype_auto](
@cmpid int ,
@style int ,
@bizid int)
as
begin
set nocount on
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
if (@style=0) 
begin
select biz_id,biz_title,biz_auto_interval,biz_auto_unit,biz_auto_starttime,biz_auto_webservice 
from mps_biztype with(nolock) where biz_cmpid=@cmpid and biz_id=@bizid

select * from mps_extsqljs with(nolock) where cd_objid=@bizid and cd_name='crm.import'
select * from mps_extsqljs with(nolock) where cd_objid=@bizid and cd_name='crm.impcond'
end else
begin
select biz_id,biz_title,biz_auto2_interval biz_auto_interval,biz_auto2_unit biz_auto_unit,biz_auto2_starttime biz_auto_starttime,biz_auto2_webservice  biz_auto_webservice
from mps_biztype with(nolock) where biz_cmpid=@cmpid and biz_id=@bizid

select * from mps_extsqljs with(nolock) where cd_objid=@bizid and cd_name='crm.bizauto'
select * from mps_extsqljs with(nolock) where cd_objid=@bizid and cd_name='crm.bizcond'
end
set nocount off
end