Modified vefn_ChronologyReport to include datetime parameter
Modified vefn_GetMyChronology to include datetime parameter Modified getContentAuditsChronologyByItemID to include datetime parameter Modified getContentAuditsSummaryByItemID to include datetime parameter Modified getAnnotationAuditsChronologyByItemID to include datetime parameter Modified getAnnotationAuditsChronologyByItemIDandUnitID to include datetime parameter Modified getContentAuditsChronologyByItemIDandUnitID to include datetime parameter Modified getContentAuditsSummaryByItemIDandUnitID to include datetime parameter
This commit is contained in:
parent
f8a3adcd32
commit
3dac6dd926
@ -209,7 +209,7 @@ select * from vefn_chronologyreport(2) where type > 0 order by contentid,auditid
|
|||||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
CREATE function [dbo].[vefn_ChronologyReport](@ProcItemID int)
|
CREATE function [dbo].[vefn_ChronologyReport](@ProcItemID int, @DTS datetime)
|
||||||
returns @Report table
|
returns @Report table
|
||||||
(
|
(
|
||||||
src int,
|
src int,
|
||||||
@ -238,8 +238,8 @@ declare @tmpTable table
|
|||||||
)
|
)
|
||||||
insert into @tmpTable select icontentid from vefn_tblchilditems(@ProcItemID,@ProcItemID,1)
|
insert into @tmpTable select icontentid from vefn_tblchilditems(@ProcItemID,@ProcItemID,1)
|
||||||
--added jcb 20111122
|
--added jcb 20111122
|
||||||
declare @dts datetime
|
--declare @dts datetime
|
||||||
set @dts = (select dts from items where itemid = @ProcItemID )
|
--set @dts = (select dts from items where itemid = @ProcItemID )
|
||||||
--set @dts = (SELECT .[dbo].[vefn_GetPreviousRevisionDTSByItemID] (@ProcItemID))
|
--set @dts = (SELECT .[dbo].[vefn_GetPreviousRevisionDTSByItemID] (@ProcItemID))
|
||||||
--end added jcb 20111122
|
--end added jcb 20111122
|
||||||
insert into @Report
|
insert into @Report
|
||||||
@ -631,7 +631,7 @@ GO
|
|||||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
CREATE FUNCTION [dbo].[vefn_GetMyChronology](@ProcItemID int, @ItemID int, @IncludeDeletedChildren int)
|
CREATE FUNCTION [dbo].[vefn_GetMyChronology](@ProcItemID int, @ItemID int, @IncludeDeletedChildren int, @DTS datetime)
|
||||||
RETURNS @Chrono TABLE
|
RETURNS @Chrono TABLE
|
||||||
(
|
(
|
||||||
[AuditID] bigint,
|
[AuditID] bigint,
|
||||||
@ -679,7 +679,7 @@ select distinct [AuditID],[ContentID],[Number],[Text],[Type],[FormatID],[Config]
|
|||||||
,(select dbo.vefn_GetStepTypeNameByItemIDandTypeID(t.itemid,r.type)) TypeName
|
,(select dbo.vefn_GetStepTypeNameByItemIDandTypeID(t.itemid,r.type)) TypeName
|
||||||
,*
|
,*
|
||||||
from vefn_tblchilditems (@ProcItemID,@ItemID,@IncludeDeletedChildren) t
|
from vefn_tblchilditems (@ProcItemID,@ItemID,@IncludeDeletedChildren) t
|
||||||
inner join vefn_chronologyreport(@ProcItemID) r
|
inner join vefn_chronologyreport(@ProcItemID,@DTS) r
|
||||||
on t.icontentid = r.contentid
|
on t.icontentid = r.contentid
|
||||||
-- where ActionDTS > procdts or dts > procdts
|
-- where ActionDTS > procdts or dts > procdts
|
||||||
) ah
|
) ah
|
||||||
@ -715,13 +715,14 @@ CREATE PROCEDURE [dbo].[getContentAuditsChronologyByItemID]
|
|||||||
(
|
(
|
||||||
@ProcedureItemID int,
|
@ProcedureItemID int,
|
||||||
@SelectedItemID int,
|
@SelectedItemID int,
|
||||||
@IncludeDeletedChildren int
|
@IncludeDeletedChildren int,
|
||||||
|
@DTS datetime
|
||||||
)
|
)
|
||||||
|
|
||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
AS
|
AS
|
||||||
begin
|
begin
|
||||||
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren)
|
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren,@DTS)
|
||||||
-- select distinct [AuditID],[ContentID],[Number],[Text],[Type],[FormatID],[Config],[DTS],[UserID],[DeleteStatus],[ActionDTS],[ActionWhat],[ActionWhen],[Path],ItemID,TypeName,ordinalpath
|
-- select distinct [AuditID],[ContentID],[Number],[Text],[Type],[FormatID],[Config],[DTS],[UserID],[DeleteStatus],[ActionDTS],[ActionWhat],[ActionWhen],[Path],ItemID,TypeName,ordinalpath
|
||||||
-- from
|
-- from
|
||||||
-- (
|
-- (
|
||||||
@ -778,7 +779,8 @@ CREATE PROCEDURE [dbo].[getContentAuditsSummaryByItemID]
|
|||||||
(
|
(
|
||||||
@ProcedureItemID int,
|
@ProcedureItemID int,
|
||||||
@SelectedItemID int,
|
@SelectedItemID int,
|
||||||
@IncludeDeletedChildren int
|
@IncludeDeletedChildren int,
|
||||||
|
@DTS datetime
|
||||||
)
|
)
|
||||||
|
|
||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
@ -805,7 +807,7 @@ TypeName nvarchar(max),
|
|||||||
ordinalpath nvarchar(max)
|
ordinalpath nvarchar(max)
|
||||||
)
|
)
|
||||||
insert into @Chrono
|
insert into @Chrono
|
||||||
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren)
|
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren,@DTS)
|
||||||
select * from @Chrono
|
select * from @Chrono
|
||||||
where AuditID is null OR AuditID in (select min(auditID) from @Chrono group by contentid UNION select max(auditID) from @Chrono group by contentid)
|
where AuditID is null OR AuditID in (select min(auditID) from @Chrono group by contentid UNION select max(auditID) from @Chrono group by contentid)
|
||||||
order by OrdinalPath, contentid,auditid
|
order by OrdinalPath, contentid,auditid
|
||||||
@ -1335,13 +1337,14 @@ getAnnotationAuditsChronologyByItemID 30,8505
|
|||||||
CREATE procedure [dbo].[getAnnotationAuditsChronologyByItemID]
|
CREATE procedure [dbo].[getAnnotationAuditsChronologyByItemID]
|
||||||
(
|
(
|
||||||
@ProcItemID int,
|
@ProcItemID int,
|
||||||
@ItemID int
|
@ItemID int,
|
||||||
|
@DTS datetime
|
||||||
)
|
)
|
||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
AS
|
AS
|
||||||
begin
|
begin
|
||||||
declare @dts datetime
|
-- declare @dts datetime
|
||||||
set @dts = (select dts from items where itemid = @procitemid)
|
-- set @dts = (select dts from items where itemid = @procitemid)
|
||||||
declare @tci table
|
declare @tci table
|
||||||
(
|
(
|
||||||
ItemID int,
|
ItemID int,
|
||||||
@ -4642,13 +4645,14 @@ create procedure [dbo].[getAnnotationAuditsChronologyByItemIDandUnitID]
|
|||||||
(
|
(
|
||||||
@ProcItemID int,
|
@ProcItemID int,
|
||||||
@ItemID int,
|
@ItemID int,
|
||||||
@UnitID int
|
@UnitID int,
|
||||||
|
@DTS datetime
|
||||||
)
|
)
|
||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
AS
|
AS
|
||||||
begin
|
begin
|
||||||
declare @dts datetime
|
-- declare @dts datetime
|
||||||
set @dts = (select dts from items where itemid = @procitemid)
|
-- set @dts = (select dts from items where itemid = @procitemid)
|
||||||
declare @tci table
|
declare @tci table
|
||||||
(
|
(
|
||||||
ItemID int,
|
ItemID int,
|
||||||
@ -4758,13 +4762,14 @@ CREATE PROCEDURE [dbo].[getContentAuditsChronologyByItemIDandUnitID]
|
|||||||
@ProcedureItemID int,
|
@ProcedureItemID int,
|
||||||
@SelectedItemID int,
|
@SelectedItemID int,
|
||||||
@IncludeDeletedChildren int,
|
@IncludeDeletedChildren int,
|
||||||
@UnitID int
|
@UnitID int,
|
||||||
|
@DTS datetime
|
||||||
)
|
)
|
||||||
|
|
||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
AS
|
AS
|
||||||
begin
|
begin
|
||||||
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren)
|
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren,@DTS)
|
||||||
-- select distinct [AuditID],[ContentID],[Number],[Text],[Type],[FormatID],[Config],[DTS],[UserID],[DeleteStatus],[ActionDTS],[ActionWhat],[ActionWhen],[Path],ItemID,TypeName,ordinalpath
|
-- select distinct [AuditID],[ContentID],[Number],[Text],[Type],[FormatID],[Config],[DTS],[UserID],[DeleteStatus],[ActionDTS],[ActionWhat],[ActionWhen],[Path],ItemID,TypeName,ordinalpath
|
||||||
-- from
|
-- from
|
||||||
-- (
|
-- (
|
||||||
@ -4827,7 +4832,8 @@ create PROCEDURE [dbo].[getContentAuditsSummaryByItemIDandUnitID]
|
|||||||
@ProcedureItemID int,
|
@ProcedureItemID int,
|
||||||
@SelectedItemID int,
|
@SelectedItemID int,
|
||||||
@IncludeDeletedChildren int,
|
@IncludeDeletedChildren int,
|
||||||
@UnitID int
|
@UnitID int,
|
||||||
|
@DTS datetime
|
||||||
)
|
)
|
||||||
|
|
||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
@ -4855,7 +4861,7 @@ TypeName nvarchar(max),
|
|||||||
ordinalpath nvarchar(max)
|
ordinalpath nvarchar(max)
|
||||||
)
|
)
|
||||||
insert into @Chrono
|
insert into @Chrono
|
||||||
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren)
|
select * from vefn_GetMyChronology(@ProcedureItemID,@SelectedItemID,@IncludeDeletedChildren,@DTS)
|
||||||
where dbo.ve_GetItemApplicability(ItemID) = '-1' or ',' + dbo.ve_GetItemApplicability(ItemID) + ',' like '%,' + cast(@UnitID as varchar(10)) + ',%'
|
where dbo.ve_GetItemApplicability(ItemID) = '-1' or ',' + dbo.ve_GetItemApplicability(ItemID) + ',' like '%,' + cast(@UnitID as varchar(10)) + ',%'
|
||||||
select * from @Chrono
|
select * from @Chrono
|
||||||
where AuditID is null OR AuditID in (select min(auditID) from @Chrono group by contentid UNION select max(auditID) from @Chrono group by contentid)
|
where AuditID is null OR AuditID in (select min(auditID) from @Chrono group by contentid UNION select max(auditID) from @Chrono group by contentid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user