34 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			MySQL
		
	
	
	
		
		
			
		
	
	
			34 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			MySQL
		
	
	
	
|  | CREATE VIEW [dbo].[View_Check_CheckSpecialDetail]  AS 
 | |||
|  | /*ר<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>ͼ*/
 | |||
|  | 	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 '<EFBFBD><EFBFBD>' 
 | |||
|  | 				when checkSpecialDetail.CompleteStatus =0 then '<EFBFBD><EFBFBD>' 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
 |