ALTER PROCEDURE we_depart_openRegByPage
	
	(
	@pageIndex int,
	@pageSize int,
	@totalRecord bigint
	)
	
AS
	/* SET NOCOUNT ON */
	
	declare @thisPageSize int
	set @thisPageSize=@pageSize
	if(@pageIndex*@pageSize>@totalRecord)
	set @thisPageSize=@totalRecord % @pageSize
	
	select b.* from (select top (@thisPageSize) a.* from (select top (@pageIndex*@pageSize) id,aliasName from dw where (dw.selfReg=1)and(aliasName IS NOT null) order by dw.id desc) a  order by a.id) b order by b.id desc
	

	RETURN
ALTER PROCEDURE we_depart_openRegCount
	
	
AS
	/* SET NOCOUNT ON */
	select count(id) from dw where (dw.selfReg=1)and(aliasName IS NOT null)
	
	

	RETURN
