如何在 这段储存过程中加分页 create PROCEDURE [dbo].[Z_SelfHelpOrderingQuery] @CorpId varchar(20), @EnCode varchar(20), @MealTypeId varchar(20), @AreaId varchar(20), @CheackMark varchar(20), @MenuName varchar(20), @Start varchar(20), @End varchar(20), @MenuCode varchar(20), @BilltypeId varchar(20) AS begin if (@CheackMark = 1) BEGIN select A.MenuId as id, CONVERT(varchar(10), A.MenuDate, 120) as MenuDate, CONVERT(varchar(10), A.SalesDate, 120) as SalesDate, A.MenuCode, A.MealType, A.MenuName, A.CheackMark, A.ShortName, A.BilltypeId, A.CreateUserId, A.MenuCycleId, A.EnCode, A.MealTypeId,B.AreaId,A.CreateUserName,A.ModifyUserName from YE_School_Menu A WITH(NOLOCK) left join YE_Client_Customer B WITH(NOLOCK) on A.CorpId=B.CorpId And B.EnabledMark=1 and A.EnCode=B.EnCode where A.CorpId=@CorpId and A.MenuCode like @MenuCode and A.CheackMark=@CheackMark and A.BilltypeId=@BilltypeId and A.MealTypeId like @MealTypeId and A.MenuName like @MenuName and A.MenuDate >= @Start and A.MenuDate<=@End and B.AreaId like @AreaId and A.EnCode like @EnCode group by A.MenuId,A.MenuDate,A.MenuCode,A.MealType,A.MenuName,A.CheackMark,A.SalesDate,A.ShortName,A.CreateUserId,A.MenuCycleId,A.EnCode,A.MealTypeId,A.BilltypeId ,B.AreaId,A.CreateUserName,A.ModifyUserName order by A.MenuDate,A.ShortName,A.MealTypeId,A.MenuName,A.SalesDate END select A.MenuId as id, CONVERT(varchar(10), A.MenuDate, 120) as MenuDate, CONVERT(varchar(10), A.SalesDate, 120) as SalesDate, A.MenuCode, A.MealType, A.MenuName, A.CheackMark, A.ShortName, A.BilltypeId, A.CreateUserId, A.MenuCycleId, A.EnCode, A.MealTypeId,B.AreaId,A.CreateUserName,A.ModifyUserName from YE_School_Menu A WITH(NOLOCK) left join YE_Client_Customer B WITH(NOLOCK) on A.CorpId=B.CorpId And B.EnabledMark=1 and A.EnCode=B.EnCode where A.CorpId=@CorpId and A.MenuCode like @MenuCode and A.BilltypeId=@BilltypeId and A.MealTypeId like @MealTypeId and A.MenuName like @MenuName and A.MenuDate >= @Start and A.MenuDate<=@End and B.AreaId like @AreaId and A.EnCode like @EnCode group by A.MenuId,A.MenuDate,A.MenuCode,A.MealType,A.MenuName,A.CheackMark,A.SalesDate,A.ShortName,A.CreateUserId,A.MenuCycleId,A.EnCode,A.MealTypeId,A.BilltypeId ,B.AreaId,A.CreateUserName,A.ModifyUserName order by A.MenuDate,A.ShortName,A.MealTypeId,A.MenuName,A.SalesDate
最新发布