洛阳中航光电API,使用oracle数据库,从足力健api复制,最新版本java开发

sql_P_GetBlacklist_20180521.sql 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 
  2. /****** Object: StoredProcedure [dbo].[P_GetBlacklist] Script Date: 05/21/2018 16:50:43 ******/
  3. SET ANSI_NULLS ON
  4. GO
  5. SET QUOTED_IDENTIFIER ON
  6. GO
  7. ALTER PROCEDURE [dbo].[P_GetBlacklist]
  8. (
  9. @Tel NVARCHAR(50),
  10. @Callid NVARCHAR(50)
  11. )
  12. AS
  13. BEGIN
  14. SET NOCOUNT ON;
  15. declare @c int=0;
  16. select top 1 @c=COUNT(1) from T_Call_Blacklist
  17. where isnull(F_TelPhone,'')like '%'+@Tel+'%'
  18. and F_IsDelete=0
  19. and getdate() between F_SetTime and F_RemoveTime
  20. if @c>0
  21. begin
  22. --DealType处理方式0:IVR处理1骚扰电话2自助服务3转值班电话4留言5呼损6人工处理
  23. update T_Call_CallRecords set CallState=1,DealType=1,IsDeal=1 where CallId=@Callid
  24. update T_Call_Blacklist set F_InterceptNum=F_InterceptNum+1
  25. where isnull(F_TelPhone,'')like '%'+@Tel+'%'
  26. and F_IsDelete=0
  27. and getdate() between F_SetTime and F_RemoveTime
  28. end
  29. select @c as BlackListVerify
  30. END