日期:2014-05-17 浏览次数:20377 次
ALTER PROCEDURE [dbo].[Pro_SelectItem]
@User_Name varchar(50),
@qItemTime datetime,
@dItemTime datetime
as
if(isnull(@User_Name,'')='' and ISNULL(@qItemTime,'')<>'' and ISNULL(@dItemTime,'')<>'')
begin
select ine.ItemBz,ine.ItemName,ine.Itemint,ine.ItemTime,su.User_Name,itd.ItemName from
ItemName as ine inner join Sys_user as su on ine.Ubz=su.Ubz inner join ItemDate as itd on ine.ItemName=itd.ItemBz
where ine.ItemTime between @qItemTime and @dItemTime
end
if(isnull(@User_Name,'')<>'' and ISNULL(@qItemTime,'')<>'' and ISNULL(@dItemTime,'')<>'')
begin
select ine.ItemBz,ine.ItemName,ine.Itemint,ine.ItemTime,su.User_Name,itd.ItemName from
ItemName as ine inner join Sys_user as su on ine.Ubz=su.Ubz inner join ItemDate as itd on ine.ItemName=itd.ItemBz
where ine.ItemTime between @qItemTime and @dItemTime and su.Ubz=@User_Name
end
if(isnull(@User_Name,'')='' and ISNULL(@qItemTime,'')<>'' and ISNULL(@dItemTime,'')<>'')
begin
print 1
end
if(isnull(@User_Name,'')<>'' and ISNULL(@qItemTime,'')<>'' and ISNULL(@dItemTime,'')<>'')
begin
print 2
end