Compare commits

..

No commits in common. "d040c1b50eefa09e82fc7f9a25887865607dcd48" and "08a48b7e3c15e47ae65af30e479daa592b8af710" have entirely different histories.

2 changed files with 78 additions and 74 deletions

Binary file not shown.

View File

@ -3996,81 +3996,85 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{ {
var info = GetTestPackageInfo(this.tvControlItem.SelectedNodeID); var info = GetTestPackageInfo(this.tvControlItem.SelectedNodeID);
string sql = @" //模拟数据
select * from ( string sql = "SELECT top 5 'AA' PipelineCode,'BB' MaterialCode,'CC' Specification,'DD' jointCount,'EE' FjointCount,'W1' WelderCode,'3' WelderNum,'1' NdeNum,'11' FNdeNum,'2' NdeReportNo FROM Sys_User union all SELECT top 6 'FF' PipelineCode,'GG' MaterialCode,'HH' Specification,'II' jointCount,'JJ' FjointCount,'W2' WelderCode,'3' WelderNum,'1' NdeNum,'2' FNdeNum,'D2' NdeReportNo FROM Sys_User union all SELECT top 7 'KK' PipelineCode,'LL' MaterialCode,'MM' Specification,'NN' jointCount,'OO' FjointCount,'W3' WelderCode,'3' WelderNum,'1' NdeNum,'2' FNdeNum,'D3' NdeReportNo FROM Sys_User union all SELECT top 1 '1' PipelineCode,'2' MaterialCode,'3' Specification,'4' jointCount,'5' FjointCount,'6' WelderCode,'3' WelderNum,'1' NdeNum,'2' FNdeNum,'D3' NdeReportNo FROM Sys_User";
select d.PipelineCode,
(select MaterialCode from Base_Material as m where d.MainMaterialId=m.MaterialId) as MaterialCode ,
d.Specification,
(select count(1) from Pipeline_WeldJoint as joint where joint.PipelineId=a.PipelineId) as jointCount, --线
( case when a.isAll=1 then
(select count(1) from Pipeline_WeldJoint as joint where joint.PipelineId=a.PipelineId and joint.JointAttribute='F')
else
(select count(1) from Pipeline_WeldJoint as joint where joint.PipelineId=a.PipelineId and joint.JointAttribute='' and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0)
end ) as FjointCount, --线 // string sql = @"use HJGLDB_ZJBSF
c.WelderCode, --
( case when a.isAll=1 then //select * from (
(select count(1) from View_Pipeline_WeldJoint as vjoint where vjoint.PipelineId=a.PipelineId and vjoint.WelderCode=c.WelderCode) //select d.PipelineCode,
else //(select MaterialCode from Base_Material as m where d.MainMaterialId=m.MaterialId) as MaterialCode ,
(select count(1) from View_Pipeline_WeldJoint as vjoint where vjoint.PipelineId=a.PipelineId //d.Specification,
and CHARINDEX(','+vjoint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and vjoint.WelderCode=c.WelderCode) //(select count(1) from Pipeline_WeldJoint as joint where joint.PipelineId=a.PipelineId) as jointCount, --当前管线的焊口总数
end ) as WelderNum, // ( case when a.isAll=1 then
(case when a.isAll=1 then // (select count(1) from Pipeline_WeldJoint as joint where joint.PipelineId=a.PipelineId and joint.JointAttribute='固定F')
(select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust // else
ON trust.TrustBatchItemId = nde.TrustBatchItemId // (select count(1) from Pipeline_WeldJoint as joint where joint.PipelineId=a.PipelineId and joint.JointAttribute='固定' and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0)
inner join View_Pipeline_WeldJoint as joint
ON joint.WeldJointId=trust.WeldJointId // end ) as FjointCount, --当前管线的焊口的固定口总数
where joint.PipelineId=a.PipelineId and joint.WelderCode=c.WelderCode) //c.WelderCode, --焊工号
else // ( case when a.isAll=1 then
( // (select count(1) from View_Pipeline_WeldJoint as vjoint where vjoint.PipelineId=a.PipelineId and vjoint.WelderCode=c.WelderCode)
select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust // else
ON trust.TrustBatchItemId = nde.TrustBatchItemId // (select count(1) from View_Pipeline_WeldJoint as vjoint where vjoint.PipelineId=a.PipelineId
inner join View_Pipeline_WeldJoint as joint // and CHARINDEX(','+vjoint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and vjoint.WelderCode=c.WelderCode)
ON joint.WeldJointId=trust.WeldJointId // end ) as WelderNum,
where joint.PipelineId=a.PipelineId and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and joint.WelderCode=c.WelderCode // (case when a.isAll=1 then
) // (select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust
end // ON trust.TrustBatchItemId = nde.TrustBatchItemId
) as NdeNum, -- // inner join View_Pipeline_WeldJoint as joint
(case when a.isAll=1 then // ON joint.WeldJointId=trust.WeldJointId
(select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust // where joint.PipelineId=a.PipelineId and joint.WelderCode=c.WelderCode)
ON trust.TrustBatchItemId = nde.TrustBatchItemId // else
inner join View_Pipeline_WeldJoint as joint // (
ON joint.WeldJointId=trust.WeldJointId // select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust
where joint.PipelineId=a.PipelineId and joint.JointAttribute='F' and joint.WelderCode=c.WelderCode) // ON trust.TrustBatchItemId = nde.TrustBatchItemId
else // inner join View_Pipeline_WeldJoint as joint
( // ON joint.WeldJointId=trust.WeldJointId
select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust // where joint.PipelineId=a.PipelineId and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and joint.WelderCode=c.WelderCode
ON trust.TrustBatchItemId = nde.TrustBatchItemId // )
inner join View_Pipeline_WeldJoint as joint // end
ON joint.WeldJointId=trust.WeldJointId // ) as NdeNum, --检测口数量
where joint.PipelineId=a.PipelineId and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and joint.JointAttribute='F' and joint.WelderCode=c.WelderCode // (case when a.isAll=1 then
) // (select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust
end // ON trust.TrustBatchItemId = nde.TrustBatchItemId
) as FNdeNum , -- // inner join View_Pipeline_WeldJoint as joint
( // ON joint.WeldJointId=trust.WeldJointId
case when a.isAll=1 then // where joint.PipelineId=a.PipelineId and joint.JointAttribute='固定F' and joint.WelderCode=c.WelderCode)
(stuff((select ','+nde.NDEReportNo from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust // else
ON trust.TrustBatchItemId = nde.TrustBatchItemId // (
inner join View_Pipeline_WeldJoint as joint // select count(1) from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust
ON joint.WeldJointId=trust.WeldJointId // ON trust.TrustBatchItemId = nde.TrustBatchItemId
where joint.PipelineId=a.PipelineId and joint.WelderCode=c.WelderCode FOR xml path ('') ),1,1,'')) // inner join View_Pipeline_WeldJoint as joint
else // ON joint.WeldJointId=trust.WeldJointId
(stuff((select ','+nde.NDEReportNo from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust // where joint.PipelineId=a.PipelineId and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and joint.JointAttribute='固定F' and joint.WelderCode=c.WelderCode
ON trust.TrustBatchItemId = nde.TrustBatchItemId // )
inner join View_Pipeline_WeldJoint as joint // end
ON joint.WeldJointId=trust.WeldJointId // ) as FNdeNum , --检测固定口数量
where joint.PipelineId=a.PipelineId and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and joint.WelderCode=c.WelderCode FOR xml path ( '' ) ),1,1,'') ) // (
end) as NdeReportNo // case when a.isAll=1 then
from // (stuff((select ','+nde.NDEReportNo from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust
PTP_PipelineList as a inner join // ON trust.TrustBatchItemId = nde.TrustBatchItemId
PTP_TestPackage as b on a.PTP_ID=b.PTP_ID // inner join View_Pipeline_WeldJoint as joint
inner join View_Pipeline_WeldJoint as c // ON joint.WeldJointId=trust.WeldJointId
on c.PipelineId=a.PipelineId // where joint.PipelineId=a.PipelineId and joint.WelderCode=c.WelderCode FOR xml path ('') ),1,1,''))
inner join Pipeline_Pipeline as d // else
on c.PipelineId=d.PipelineId // (stuff((select ','+nde.NDEReportNo from Batch_NDEItem as nde inner join Batch_BatchTrustItem as trust
where b.PTP_ID=@PTPID and b.ProjectId=@projectId // ON trust.TrustBatchItemId = nde.TrustBatchItemId
) as t // inner join View_Pipeline_WeldJoint as joint
group by t.PipelineCode,t.MaterialCode,t.Specification,t.jointCount,t.FjointCount,t.WelderCode,t.WelderNum,t.NdeNum,t.FNdeNum,t.NdeReportNo"; // ON joint.WeldJointId=trust.WeldJointId
// where joint.PipelineId=a.PipelineId and CHARINDEX(','+joint.WeldJointCode+',',','+a.WeldJonintCode+'')>0 and joint.WelderCode=c.WelderCode FOR xml path ( '' ) ),1,1,'') )
// end) as NdeReportNo
//from
//PTP_PipelineList as a inner join
//PTP_TestPackage as b on a.PTP_ID=b.PTP_ID
//inner join View_Pipeline_WeldJoint as c
//on c.PipelineId=a.PipelineId
//inner join Pipeline_Pipeline as d
//on c.PipelineId=d.PipelineId
//where b.PTP_ID=@PTPID and b.ProjectId=@projectId
//) as t
//group by t.PipelineCode,t.MaterialCode,t.Specification,t.jointCount,t.FjointCount,t.WelderCode,t.WelderNum,t.NdeNum,t.FNdeNum,t.NdeReportNo";
SqlParameter[] parms = SqlParameter[] parms =
{ {