69 lines
3.5 KiB
MySQL
69 lines
3.5 KiB
MySQL
|
ALTER TABLE [dbo].[WBS_BreakdownProject] DROP CONSTRAINT [FK_WBS_BreakdownProject_WBS_DivisionProject]
|
|||
|
GO
|
|||
|
|
|||
|
|
|||
|
/****** Object: Index [NonClusteredIndex-20210412-143416] Script Date: 2021/4/12 14:40:06 ******/
|
|||
|
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20210412-143416] ON [dbo].[WBS_DivisionProject]
|
|||
|
(
|
|||
|
[UnitWorkId] ASC
|
|||
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
|||
|
GO
|
|||
|
|
|||
|
/****** Object: Index [NonClusteredIndex-20210412-144153] Script Date: 2021/4/12 14:42:14 ******/
|
|||
|
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20210412-144153] ON [dbo].[WBS_BreakdownProject]
|
|||
|
(
|
|||
|
[DivisionProjectId] ASC
|
|||
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
|||
|
GO
|
|||
|
|
|||
|
|
|||
|
|
|||
|
ALTER PROCEDURE [dbo].[Sp_GJSX_getlist]
|
|||
|
-- Add the parameters for the stored procedure here
|
|||
|
@ProjectId nvarchar(max),
|
|||
|
@sql_where varchar(max)
|
|||
|
AS
|
|||
|
BEGIN
|
|||
|
IF EXISTS(select * from tempdb..sysobjects where id=object_id('tempdb..#GJSX_List'))
|
|||
|
BEGIN
|
|||
|
DROP TABLE #GJSX_List
|
|||
|
END
|
|||
|
DECLARE @Sql NVARCHAR(200)
|
|||
|
select * into #GJSX_List from(
|
|||
|
select
|
|||
|
a.GJSXID
|
|||
|
,a.ProjectId
|
|||
|
,a.detail
|
|||
|
,b.username
|
|||
|
,a.createDate
|
|||
|
,User_ReceiveID=STUFF(( SELECT ',' + p2.UserName FROM dbo.Sys_User as p2 where PATINDEX('%,' + RTRIM(p2.UserId) + ',%',',' +a.User_ReceiveID + ',') >0 FOR XML PATH('')), 1, 1,'')
|
|||
|
, CNProfessionalId=STUFF(( SELECT ',' + Base_CNProfessional.ProfessionalName FROM dbo.Base_CNProfessional where PATINDEX('%,' + RTRIM(Base_CNProfessional.CNProfessionalId) + ',%',',' +a.CNProfessional_ID + ',') >0 FOR XML PATH('')), 1, 1,'')
|
|||
|
,Base_Project.ProjectName
|
|||
|
,Base_Unit.unitname
|
|||
|
,a.CloseDate
|
|||
|
,case a.state when 2 then '<EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD>' when 0 then '<EFBFBD>ر<EFBFBD>' when 1 then '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' end as state
|
|||
|
,QuestionTypeName=STUFF(( SELECT ',' + Base_QuestionType.QuestionTypeName FROM dbo.Base_QuestionType where PATINDEX('%,' + RTRIM(Base_QuestionType.QuestionTypeID) + ',%',',' +a.QuestionTypeID + ',') >0 FOR XML PATH('')), 1, 1,'')
|
|||
|
,a.IsManypeople
|
|||
|
,a.CompleteDate
|
|||
|
,a.AttachUrl
|
|||
|
,user_Acceptance =STUFF(( SELECT ',' + p2.UserName FROM dbo.Sys_User as p2 where PATINDEX('%,' + RTRIM(p2.UserId) + ',%',',' +a.user_Acceptance + ',') >0 FOR XML PATH('')), 1, 1,'')
|
|||
|
from GJSX as a left join Sys_User as b on a.UserId=b.UserId
|
|||
|
left join [dbo].[Base_Project] on a.ProjectId =Base_Project.ProjectId
|
|||
|
left join [dbo].[Base_Unit] on a.UnitId=Base_Unit.UnitId
|
|||
|
left join [dbo].[Base_QuestionType] on a.QuestionTypeID=Base_QuestionType.QuestionTypeID ) as a
|
|||
|
|
|||
|
set @Sql ='select * from #GJSX_List where ProjectId='''+@ProjectId+''' ' +@sql_where
|
|||
|
|
|||
|
exec(@Sql)
|
|||
|
|
|||
|
END
|
|||
|
|
|||
|
|
|||
|
GO
|
|||
|
|
|||
|
|
|||
|
insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('27D8CEC6-5D58-4B06-BF3F-C62E1D361074','3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
|
|||
|
insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('7EB2E0FA-0DEE-45D2-81BA-A49F9F8D556E','3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B','<EFBFBD><EFBFBD>',2)
|
|||
|
insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('CBEF171A-1E96-4523-9CD5-5040D2C42DC6','3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B','ɾ<EFBFBD><EFBFBD>',3)
|
|||
|
insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('124B7659-5F18-49F3-8D30-BF8680830827','3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',4)
|
|||
|
GO
|