惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Spread Privacy
Spread Privacy
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
N
News | PayPal Newsroom
A
Arctic Wolf
NISL@THU
NISL@THU
W
WeLiveSecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
L
Lohrmann on Cybersecurity
Last Week in AI
Last Week in AI
T
Threatpost
The Last Watchdog
The Last Watchdog
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
S
Security Affairs
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
雷峰网
雷峰网
T
Tenable Blog
Schneier on Security
Schneier on Security
H
Heimdal Security Blog
V2EX - 技术
V2EX - 技术
V
V2EX
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Latest news
Latest news
Help Net Security
Help Net Security
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
V
Vulnerabilities – Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - prayforsmile

向android虚拟机中push文件提示Read-only file system 存储 时间对应多条记录 =iif(RowNumber("table6_Group3")=1,"Solid","None") - prayforsmile - 博客园 StringSplitToTable SP 拼音 临时表 调用另一个存储过程 返回主键 时间 sp数组处理 同一个表取取相同列内容剔除,附加 SP插入 rrr 再见吧,09 ddl - prayforsmile - 博客园 ~~ 关于Case项目 2009悲剧男
1
prayforsmile · 2010-05-19 · via 博客园 - prayforsmile

-- =============================================
-- Author:  <Author,,Name>
-- Create date: <Create Date,,>
-- Description: 获得入库单表头信息
-- =============================================
ALTER PROCEDURE [dbo].[Get_InStock]
 @InStock_Ord varchar(20),
    @Sp_Id          int=-1,
    @State          int=-1
AS
BEGIN
 DECLARE @InStkCount    int
 DECLARE @InStock_Id    decimal
 DECLARE @OutStor_id    decimal
 DECLARE @TotalAmt    money
 DECLARE @TotalPerFee   money
 DECLARE @GoldPrice    money
 SELECT @InStkCount=COUNT(InStock_Id) FROM [ExInStock] 
  WHERE (InStock_Ord=@InStock_Ord OR @InStock_Ord='') AND
              (Sp_Id=@Sp_Id OR @Sp_Id=-1) AND
              (state=@state OR @state=-1) AND
              InStockType=1
 SELECT @OutStor_id=OutStor_id,
      @TotalAmt=TotalAmt,
   @TotalPerFee=TotalPerFee,
   @GoldPrice=GoldPrice
  FROM OutStorageOrd A 
--  INNER JOIN Depart_From_Batar B ON B.Dept_Id=A.Customer_Id
  WHERE OutStor_Number=@InStock_Ord AND
--   (@Sp_Id=-1 OR B.Number=(SELECT Number FROM DepartmentInfo WHERE Dept_Id=@Sp_Id))
            (A.Customer_Id=@Sp_Id OR @Sp_Id=-1)
 IF(@InStkCount=0 AND @OutStor_id IS NOT NULL)
 BEGIN TRY
  BEGIN TRAN
  INSERT [ExInStock]
           (InStock_Ord,OutStor_id,Sp_Id,Cost,PerFee,GoldPrice,InStockType,State)
           values(@InStock_Ord,@OutStor_id,@Sp_Id,@TotalAmt,@TotalPerFee,@GoldPrice,1,1)
  SELECT @InStock_Id=@@IDENTITY
  INSERT [ExInStockInfo]
           (BarCode,InStock_Id,Gp_Id,Pm_Id,Pq_Id,AllWeight,GoldWeight,InStock_Ord,InStockType,Sp_Id)
  SELECT A.BarCode,@InStock_Id,A.Gp_Id,A.Pm_Id,d.Pq_Id,A.Weight,A.Net_Weight,b.OutStor_Number,1,@Sp_Id
  FROM GoldProduct AS A
  INNER JOIN OutStorageOrd AS B ON A.OutStor_id=B.OutStor_id
  INNER JOIN ProductModel AS c ON c.Pm_Id=A.Pm_Id
        LEFT OUTER JOIN ProductQuality AS D ON D.Pq_Id_Batar=C.Pq_Id
  WHERE B.OutStor_Number=@InStock_Ord
  
--  FROM GoldProduct AS A,OutStorageOrd AS B,ProductQuality AS C,ProductModel AS D
--  WHERE B.OutStor_Number=@InStock_Ord AND A.OutStor_id=B.OutStor_id
--     AND D.Pm_Id=A.Pm_Id AND C.Pq_Id_Batar=D.Pq_Id
--SELECT @BarCode,@InStock_Id,@Gp_Id,@Pm_Id,@AllWeight,@GoldWeight,
--     @InStock_Ord
  COMMIT TRAN   
 END TRY
 BEGIN CATCH
  IF (@@ERROR<>0)
  BEGIN
   ROLLBACK TRAN
   SELECT ERROR_MESSAGE()
  END
 END CATCH
 SELECT * FROM [ExInStock]
  WHERE (InStock_Ord=@InStock_Ord OR @InStock_Ord='') AND
     (Sp_Id=@Sp_Id OR @Sp_Id=-1) AND
     (state=@state OR @state=-1) AND
              InStockType=1
END

posted on 2010-05-19 16:20  prayforsmile  阅读(179)  评论()    收藏  举报