日期:2014-05-17 浏览次数:20400 次
CREATE TABLE [dbo].[PerformancePercentage] (
[PerformanceID] INT IDENTITY (1, 1) NOT NULL,
[EmployeeCategoryID] INT NOT NULL,
[BusinessCategoryID] INT NOT NULL,
[MonthlyOutputValueMin] DECIMAL (4, 2) NULL,
[MonthlyOutputValueMax] DECIMAL (4, 2) NULL,
[AssignedCountMin] INT NULL,
[AssignedCountMax] INT NULL,
[IsAssgined] BIT NULL,
[Percentage] INT NOT NULL)
create proc GetPerformancePercent
@EmployeeCategoryID int,@BusinessCategoryID int,
@MonthlyOutputValue decimal(4,2),@AssignedCount int,@IsAssgined bit,
@Percentage int output
as
select @Percentage=[Percentage] from [PerformancePercentage]
where [EmployeeCategoryID]=@EmployeeCategoryID and [BusinessCategoryID]=@BusinessCategoryID
and (case when [MonthlyOutputValueMin] is not null then [MonthlyOutputValueMin] end)<@MonthlyOutputValue
and (case when [MonthlyOutputValueMax] is not null then [MonthlyOutputValueMax] end)>@MonthlyOutputValue
and (case when [AssignedCountMin] is not null then [AssignedCountMin] end)<@AssignedCount
and (case when [AssignedCountMax] is not null then [AssignedCountMax] end)>@AssignedCount
and (case when [IsAssgined] is not null then [IsAssgined] end)=@IsAssgined
go