SQL,不定条件查询,case,when,then,end,isnull,join,inner,oncreate procedure SelectProduceInfo
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@Ope varchar(50),
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@ProBeginDate datetime,
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@ProEndDate datetime,
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@IP varchar(50),
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@ComputerName varchar(50),
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@ProType varchar(50),
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@DiskType varchar(50),
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@KBID varchar(50),
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@CustName varchar(50),
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@CfgID int,
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
@ProBatch varchar(50)
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
as
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
select Operator as '操作员',ProduceDate as '生产日期',IPAddress as 'IP地址',ComputerName as '计算机名',
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
'产品类型'=case ProductType when '1' then 'Key' when '2' then 'U盘' when '3' then 'U盘/Key' end,
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
'U盘类型'=case UdiskType when '0' then '单机版安全U盘' when '1' then '企业版安全U盘' when '2' then '企业版管理盘' end,
SQL,不定条件查询,case,when,then,end,isnull,join,inner,onKBUdiskID 
as 'U盘金邦ID',CustomerName as '客户',CfgName as '配置',
SQL,不定条件查询,case,when,then,end,isnull,join,inner,onProduceBatch 
as '生产批次号',ProduceRemark as '生产备注' from ProduceUdiskKeyInfo a inner join UdiskPolicyConfigInfo b
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
on a.ConfigAutoID=b.ConfigAutoID
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
where Operator=isnull(@Ope,Operator) and ProduceDate>=isnull(@ProBeginDate,ProduceDate) 
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
and ProduceDate<=isnull(@ProEndDate,ProduceDate) and IPAddress=isnull(@IP,IPAddress)
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
and ComputerName=isnull(@ComputerName,ComputerName) and ProductType=isnull(@ProType,ProductType)
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
and UdiskType=isnull(@DiskType,UdiskType) and KBUdiskID=isnull(@KBID,KBUdiskID)
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
and CustomerName=isnull(@CustName,CustomerName) and a.ConfigAutoID=isnull(@CfgID,a.ConfigAutoID)
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
and ProduceBatch=isnull(@ProBatch,ProduceBatch)
SQL,不定条件查询,case,when,then,end,isnull,join,inner,on
go

相关文章: