CREATE VIEW [dbo].[View_Check_CheckSpecialDetail] AS /*专项检查明细列表视图*/ SELECT checkSpecialDetail.CheckSpecialDetailId, checkSpecialDetail.CheckSpecialId, checkSpecialDetail.CheckItem, checkSpecialDetail.CheckItemType, checkSpecialDetail.Unqualified, checkSpecialDetail.CheckArea, checkSpecialDetail.UnitId, checkSpecialDetail.HandleStep, checkSpecialDetail.CompleteStatus, (case when checkSpecialDetail.CompleteStatus =1 then '是' when checkSpecialDetail.CompleteStatus =0 then '否' else '' end) as CompleteStatusName, checkSpecialDetail.LimitedDate, checkSpecialDetail.CompletedDate, checkSpecialDetail.Suggestions, checkSpecialDetail.CheckContent, (case when checkSpecialDetail.CheckContent is not null then checkSpecialDetail.CheckContent else checkItemSet.CheckItemName end) as CheckItemStr, checkSpecialDetail.WorkArea, unit.UnitName, const.ConstText as HandleStepStr FROM dbo.Check_CheckSpecialDetail AS checkSpecialDetail --LEFT JOIN dbo.Check_ProjectCheckItemDetail AS checkItemDetail ON checkItemDetail.CheckItemDetailId=checkSpecialDetail.CheckItem LEFT JOIN dbo.Check_ProjectCheckItemSet AS checkItemSet ON checkItemSet.CheckItemSetId=checkSpecialDetail.CheckItem LEFT JOIN dbo.Base_Unit AS unit ON unit.UnitId=checkSpecialDetail.UnitId LEFT JOIN Sys_Const AS const ON const.ConstValue = checkSpecialDetail.HandleStep and const.GroupId='HandleStep' GO alter table [dbo].[Comprehensive_SpecialEquipment] drop constraint [FK_Comprehensive_SpecialEquipment_Base_Equipment] GO