码迷,mamicode.com
首页 > 其他好文 > 详细

慢充号码渠道号码批量延期

时间:2019-10-05 16:12:15      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:smooth   out   tom   lock   play   count   返回值   ignore   性能   

                                                                                   慢充号码渠道号码批量延期
 
 
 
 
 
--100099,100095,,100101,移动所有号码都延迟2天到账。
--100041,联通和电信所有号码延迟3天到账
 
--begin 20150119 add phoneinterface一些渠道提交的即将慢充号码,100099,100095,,100101,移动所有号码都延迟2天到账
CREATE PROCEDURE [dbo].[慢充号码渠道号码批量延期]
    @子渠道 varchar(100 ),
                @yys int,
                @天数 int,
                @操作者 varchar(50 ),
                @笔数 int,
    @返回值 int output
                
as
begin
                 set nocount on
   -- declare @sum int
                 declare @flag nvarchar (50)
                 --如果怕影响系统性能,可以传入笔数
                 -- select @sum=count(*) from do_phone with (nolock) where isfinal=0 and from_channel=‘phoneinterface‘ and dotype in( 0,92 ,95)
    -- and yys =@yys and from_channel_child in(@子渠道) 
                 update  top (@笔数) do_phone set MaxEndTime =dateadd( day,@天数 ,MaxEndTime)   where isfinal= 0 and from_channel=‘phoneinterface‘ and dotype in( 0, 92 ,95 )
                 and yys = @yys and from_channel_child in(@子渠道)
                 if(@@ROWCOUNT >0)
                   begin
                                                 print ‘更新成功‘
                                                 set @返回值= 1;
                                                 if(@yys =0)
                                   begin
                                                                 set @flag= ‘移动‘
                                   end
                                   else if (@yys= 1)
                                   begin
                                                   set @flag= ‘联通‘
                                   end
                                   else if (@yys= 2)
                                   begin
                                                   set @flag= ‘电信‘
                                   end
                   end
                 else
                                   begin
                                                 print ‘更新失败‘
                                                 set @返回值=- 1;
                                   end
                   insert into [dbo].[log_OperationSupport] (Operator, Content,Createtime )
      values(@操作者 ,‘PhoneInterface父渠道和‘+@子渠道 +‘子渠道的‘+@flag +‘号码批量延期了‘+cast (@笔数 as varchar( 50))+‘笔‘ +cast( @返回值 as varchar(10 )),getdate());
                 
end
--begin 20150119 add phoneinterface一些渠道提交的即将慢充号码,100099,100095,,100101,移动所有号码都延迟2天到账
 
 
 

 
 
 
 
 

慢充号码渠道号码批量延期

标签:smooth   out   tom   lock   play   count   返回值   ignore   性能   

原文地址:https://www.cnblogs.com/ComputerVip/p/11624737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!