createprocedure SelectProduceInfo @Opevarchar(50), @ProBeginDatedatetime, @ProEndDatedatetime, @IPvarchar(50), @ComputerNamevarchar(50), @ProTypevarchar(50), @DiskTypevarchar(50), @KBIDvarchar(50), @CustNamevarchar(50), @CfgIDint, @ProBatchvarchar(50) as select Operator as'操作员',ProduceDate as'生产日期',IPAddress as'IP地址',ComputerName as'计算机名', '产品类型'=case ProductType when'1'then'Key'when'2'then'U盘'when'3'then'U盘/Key'end, 'U盘类型'=case UdiskType when'0'then'单机版安全U盘'when'1'then'企业版安全U盘'when'2'then'企业版管理盘'end, KBUdiskID as'U盘金邦ID',CustomerName as'客户',CfgName as'配置', ProduceBatch as'生产批次号',ProduceRemark as'生产备注'from ProduceUdiskKeyInfo a innerjoin UdiskPolicyConfigInfo b on a.ConfigAutoID=b.ConfigAutoID where Operator=isnull(@Ope,Operator) and ProduceDate>=isnull(@ProBeginDate,ProduceDate) and ProduceDate<=isnull(@ProEndDate,ProduceDate) and IPAddress=isnull(@IP,IPAddress) and ComputerName=isnull(@ComputerName,ComputerName) and ProductType=isnull(@ProType,ProductType) and UdiskType=isnull(@DiskType,UdiskType) and KBUdiskID=isnull(@KBID,KBUdiskID) and CustomerName=isnull(@CustName,CustomerName) and a.ConfigAutoID=isnull(@CfgID,a.ConfigAutoID) and ProduceBatch=isnull(@ProBatch,ProduceBatch) go