Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[crud_tst-chart1_getItems]
- @filters CRUDFilterParameter READONLY,
- @sort sql_variant,
- @direction nvarchar(8),
- @page int,
- @pageSize int,
- @username nvarchar(32)
- AS
- BEGIN
- declare @result TABLE (title nvarchar(256), value int, color nvarchar(128))
- declare @langID int
- select @langID = try_cast(Value as int) from @filters where [Key] = 'langID'
- declare @vip bit
- select @vip = cast(Value as bit) from @filters where [Key] = 'vip'
- if isnull(@vip,0)<>0
- insert into @result
- select 'First company' title, 55 Value, 'pink' color
- union
- select 'Petrov PE' title, 40 Value, 'powderBlue' color
- union
- select 'Ivanov PE' title, 27 Value, 'lightGreen' color
- union
- select 'Condition Limited' title, 22 Value, 'aqua' color
- union
- select 'GorGarSnabStryServiceBit' title, 18 Value, 'lightGrey' color
- else
- insert into @result
- select 'First company' title, 55 Value, 'danger' color
- union
- select 'GorGarSnabStryServiceBit' title, 40 Value, 'primary' color
- union
- select 'Condition Limited' title, 27 Value, 'success' color
- union
- select 'Jack and partners' title, 18 Value, 'info' color
- union
- select 'Log solutions' title, 10 Value, 'secondary' color
- -- 1 SELECT - сами данные
- select * from @result
- order by Value Desc
- -- 2 SELECT - кол-во в таблице
- select count(*) from @result
- -- 3 SELECT Дополнительные настройки таблицы
- select 'progress' ViewType, 1 HidetitleCount, 1 InstantFilter, iif(@langID=1, 'TOP 5 Active customers', 'Топ 5 наиболее активных заказчиков') Title
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement