/*开发批次的当前信息查询界面,显示字段包括批次名,产品名,产品版本,批次数量,开始原因,
所有者,当前工序,工艺路线, 工艺路线版本,车间,并能通过批次名,产品名,工序进行过滤和按照批次名正序排列。
*/
select * from [CamstarPRD].[Container]
select j.WorkflowStepName,j.WorkflowStepId, ContainerName,c.ProductName ,b.ProductRevision,qty,a.StartReasonId,
d.StartReasonName,e.OwnerName,i.SpecName,g.FactoryName,l.WorkflowName,k.WorkflowRevision
from CamstarPRD.Container a
inner join [CamstarPRD].[Product] b on a.ProductId = b.ProductId
inner join [CamstarPRD].[ProductBase] c on b.ProductBaseId = c.ProductBaseId
inner join [CamstarPRD].[StartReason] d on a.StartReasonId = d.StartReasonId
inner join [CamstarPRD].[Owner] e on a.OwnerId = e.OwnerId
inner join [CamstarPRD].[CurrentStatus] f on a.CurrentStatusId = f.CurrentStatusId
inner join [CamstarPRD].[Factory] g on f.FactoryId = g.FactoryId
inner join [CamstarPRD].[Spec] h on f.SpecId = h.SpecId
inner join [CamstarPRD].[SpecBase] i on h.SpecBaseId = i.SpecBaseId
inner join [CamstarPRD].[WorkflowStep] j on f.WorkflowStepId = j.WorkflowStepId
inner join [CamstarPRD].[Workflow] k on j.WorkflowId = k.WorkflowId
inner join [CamstarPRD].[WorkflowBase] l on k.WorkflowBaseId = l.WorkflowBaseId
where containername='1S3152465164000031'