S_WorkCenterNo, EnteredDate,scheduleType,operatorId,partNo,dbo.Get_Part_SpecDesc(a.Site,partNo) as partDesc,
dbo.Get_OperatorDesc(a.Site,operatorId) as operatorName,dbo.Get_ItemDesc(a.Site,OrderNo,ItemNo) as itemDesc,orderRef1 ,
dbo.Get_WorkCenterDesc(a.Site,S_WorkCenterNo) as workCenterDesc , dbo.Get_Part_SpecDesc(a.Site,partNo) as partSpec,circulation_seqNo,circulation_qty
,dbo.Get_PartWeightFactorForReport(a.site,PartNo,OrderNo) as weightFactor,dbo.Get_Part_UMID(a.Site,PartNo) umid,a.jobType,
case when a.worktime is not null and a.worktime>0 then Round(QtyReported/a.worktime,2) else 0 end as efficiency,Round(isnull(a.workTime,0),2) workTime,
Round(dbo.Get_PartWeightFactorForReport(a.site,PartNo,OrderNo)*QtyRequired,2) as weight from SOScheduledRouting a
a.S_WorkCenterNo, a.EnteredDate,a.scheduleType,a.operatorId,a.partNo,dbo.Get_Part_SpecDesc(a.Site,a.partNo) as partDesc,
dbo.Get_OperatorDesc(a.Site,a.operatorId) as operatorName,dbo.Get_ItemDesc(a.Site,a.OrderNo,a.ItemNo) as itemDesc,a.orderRef1 ,
dbo.Get_WorkCenterDesc(a.Site,a.S_WorkCenterNo) as workCenterDesc , dbo.Get_Part_SpecDesc(a.Site,a.partNo) as partSpec,a.circulation_seqNo,a.circulation_qty
,dbo.Get_PartWeightFactorForReport(a.site,a.PartNo,a.OrderNo) as weightFactor,dbo.Get_Part_UMID(a.Site,a.PartNo) umid,a.jobType,
case when a.worktime is not null and a.worktime>0 then Round(a.QtyReported/a.worktime,2) else 0 end as efficiency,Round(isnull(a.workTime,0),2) workTime,
Round(dbo.Get_PartWeightFactorForReport(a.site,a.PartNo,a.OrderNo)*a.QtyRequired,2) as weight ,c.MachRunFactor
,case when 0>=c.MachRunFactor then 0 else Round(a.QtyReported*100/case when isnull(a.worktime,0.1)=0 then 0.1 else a.worktime end/c.MachRunFactor,2) end as xiaolv
from SOScheduledRouting a
left join user_work_center uwc on a.site=uwc.site and a.S_WorkCenterNo =uwc.WorkCenterNo and uwc.userId=#{userId}
left join SORouting c on a.Site=c.Site and a.orderNo=c.orderNo and a.itemNo=c.itemNo
<where>
and uwc.WorkCenterNo is not null
@ -468,50 +471,50 @@
AND a.site = #{site}
</if>
<iftest="orderNo != null and orderNo != ''">
AND OrderNo LIKE #{orderNo}
AND a.OrderNo LIKE #{orderNo}
</if>
<iftest="partDesc != null and partDesc != ''">
AND dbo.Get_Part_SpecDesc(a.Site,partNo) LIKE #{partDesc}
AND dbo.Get_Part_SpecDesc(a.Site,a.partNo) LIKE #{partDesc}
</if>
<iftest="seqNo != null ">
AND seqNo = #{seqNo}
AND a.seqNo = #{seqNo}
</if>
<iftest="partNo != null and partNo != ''">
AND PartNo LIKE #{partNo}
AND a.PartNo LIKE #{partNo}
</if>
<iftest="sWorkCenterNo != null and sWorkCenterNo != ''">
AND S_WorkCenterNo LIKE #{sWorkCenterNo}
AND a.S_WorkCenterNo LIKE #{sWorkCenterNo}
</if>
<iftest="itemNo != null and itemNo != ''">
and ItemNo = #{itemNo}
and a.ItemNo = #{itemNo}
</if>
<iftest="itemDesc != null and itemDesc != ''">
and dbo.Get_ItemDesc(a.Site,OrderNo,ItemNo) = #{itemDesc}
and dbo.Get_ItemDesc(a.Site,a.OrderNo,a.ItemNo) = #{itemDesc}
</if>
<iftest="closedFlag != null and closedFlag != ''">
and ClosedFlag = #{closedFlag}
and a.ClosedFlag = #{closedFlag}
</if>
<iftest="startDate != null ">
and S_ScheduledDate >= #{startDate}
and a.S_ScheduledDate >= #{startDate}
</if>
<iftest="endDate != null ">
and #{endDate} >= S_ScheduledDate
and #{endDate} >= a.S_ScheduledDate
</if>
<iftest="scheduleType != null and scheduleType != ''">
and scheduleType = #{scheduleType}
and a.scheduleType = #{scheduleType}
</if>
<iftest="reportFlag != null and reportFlag != ''">
and ${reportFlag}
</if>
<iftest="operatorName != null and operatorName != ''">
and dbo.Get_OperatorDesc(a.Site,operatorId) like #{operatorName}
and dbo.Get_OperatorDesc(a.Site,a.operatorId) like #{operatorName}
</if>
<iftest="sResourceID != null and sResourceID != ''">